Repository navigation
Auto-dismiss thread toasts after 10s of visible time - #54
Conversation
- Add `dismissAfterVisibleMs` support to thread toasts - Pause/resume countdown based on tab visibility and window focus - Set Git action result toasts to dismiss after 10s when visible
|
No actionable comments were generated in the recent review. 🎉 WalkthroughThese changes implement auto-dismiss functionality for thread toasts. GitActionsControl.tsx now includes Changes
Sequence DiagramsequenceDiagram
participant Component as Toast Component
participant Renderer as Toast Renderer
participant AutoDismiss as ThreadToastVisibleAutoDismiss
participant TimerMgr as Timer & Visibility Manager
participant DOM as Toast DOM
Component->>Renderer: Render toast with dismissAfterVisibleMs
Renderer->>AutoDismiss: Inject auto-dismiss controller
AutoDismiss->>TimerMgr: Initialize timer (dismissAfterVisibleMs)
AutoDismiss->>TimerMgr: Listen to visibility/focus changes
TimerMgr->>TimerMgr: Pause timer on blur/hidden
TimerMgr->>TimerMgr: Resume timer on focus/visible
TimerMgr->>DOM: Monitor remaining time
alt Timer Expires
TimerMgr->>AutoDismiss: Time remaining = 0
AutoDismiss->>Renderer: Close toast
Renderer->>DOM: Remove toast element
end
AutoDismiss->>TimerMgr: Cleanup on unmount
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts (beta)
Comment |
Auto-dismiss Git action success thread toasts in
|
Greptile SummaryThis PR adds visibility-aware auto-dismiss behavior for git action success toasts. A new
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant GA as GitActionsControl
participant TM as toastManager
participant TD as ThreadToastVisibleAutoDismiss
participant Doc as Document/Window
GA->>TM: add(loading toast, no dismissAfterVisibleMs)
Note over TD: Effect skips (dismissAfterVisibleMs undefined)
GA->>TM: update(success toast, dismissAfterVisibleMs: 10000)
TM-->>TD: Re-render with dismissAfterVisibleMs=10000
TD->>Doc: Check visibilityState & hasFocus
alt Tab visible & focused
TD->>TD: start() — setTimeout(10s)
Doc-->>TD: blur event
TD->>TD: pause() — save remaining ms to Map
Doc-->>TD: focus event
TD->>TD: start() — setTimeout(remaining ms)
TD->>TM: close(toastId)
else Tab hidden/blurred
TD->>TD: Timer paused, waiting for visibility
end
Last reviewed commit: 70752a0 |
UI fixes, /btw, light mode, headless mode, faster phone app with a fuller viewer, KiCad checks, and release packages
Summary
dismissAfterVisibleMsin thread toast metadata.Testing
Summary by CodeRabbit