Add option for the notification interval#92
Conversation
There was a problem hiding this comment.
1 issue found across 10 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
There was a problem hiding this comment.
No issues found across 10 files
Tip: cubic could auto-approve low-risk PRs like this, if it thinks it's safe to merge. Learn more
Re-trigger cubic
9274696 to
ba38b8a
Compare
|
Thanks for this @kecsap — the implementation is clean and the feature is reasonable. Could you rebase onto current
Once rebased + schema regenerated and green, happy to merge. Appreciate the contribution. |
306535b to
c0fd0e9
Compare
|
There were still problems with the dreamer notifications. It did not honor the new setting. Now, everything is addressed and fixed after rebasing. |
- preserves toast_duration_ms when building the narrowed hook config - keeps dream notifications on the configured duration instead of falling back to 5s - includes regression coverage - keep restart/setup toasts on 10s fallback
Summary by cubic
Adds a configurable toast duration for Magic Context notifications across the TUI. The TUI loads it via RPC and uses a single showToast helper; all flows (including dream and status) now honor the configured duration.
New Features
toast_duration_msto config/schema (1000–60000, default 5000ms); documented inCONFIGURATION.mdand exposed in the Dashboard Config Editor.toast-durationRPC; TUI loads and caches the value on startup and uses a unifiedshowToastwith per-toast overrides (10s for setup/restart).NotificationParamsnow carriestoastDurationMs;create-session-hooksand the command handler thread it through so dream/status toasts use the configured duration; added regression test.StatusDetailexposestoastDurationMs; server toasts are sent via RPC notifications and respect the duration.Migration
toast_duration_msin your config to adjust TUI toast lifetime. Defaults to 5000ms.Written for commit ff07f02. Summary will update on new commits.
Greptile Summary
This PR introduces a configurable
toast_duration_mssetting (schema, Zod validation, documentation, dashboard editor) and wires it end-to-end: a newtoast-durationRPC endpoint lets the TUI fetch the value on startup, a unifiedshowToasthelper centralises per-toast override logic, andNotificationParamsnow carries the duration so dream/status notifications respect it.toast_duration_msis validated by Zod (min 1000 / max 60000 / default 5000) and documented inCONFIGURATION.md; the dashboard Config Editor exposes it in the General section.toast-durationRPC handler returns the resolved value; the TUI caches it in a module variable and retries until a successful load, using explicitdurationOverrideMsfor latency-sensitive toasts (restarts, cancel, skip).sendIgnoredMessageis refactored to use the synchronouspushNotificationqueue instead of the directshowToastSDK call, threadingtoastDurationMsfromNotificationParamsinto the queued payload.Confidence Score: 5/5
Safe to merge; all toast-duration wiring is isolated to notification delivery with correct schema validation and safe fallbacks throughout.
The change is well-scoped: Zod enforces bounds on load, the retry loop degrades gracefully on RPC failure, and explicit durationOverrideMs values are preserved for latency-sensitive toasts. The two findings are minor and do not affect correctness or user-visible behavior.
packages/plugin/src/tui/index.tsx (retry guard) and packages/plugin/src/shared/rpc-types.ts (unused StatusDetail field)
Important Files Changed
Sequence Diagram
sequenceDiagram participant Config as Plugin Config participant RPC as RPC Server participant TUI as TUI (index.tsx) participant Toast as api.ui.toast TUI->>RPC: toast-duration (on startup) RPC-->>TUI: "{ toastDurationMs }" TUI->>TUI: "unifiedToastDurationMs = resolved" Note over TUI: Poll loop (every ~500ms) TUI->>RPC: pending-notifications (sessionId) RPC-->>TUI: messages with toast payloads TUI->>Toast: showToast(durationOverrideMs ?? unifiedToastDurationMs) Note over Config,RPC: Server-side notification path Config->>RPC: toast_duration_ms via NotificationParams RPC->>RPC: pushNotification with durationReviews (7): Last reviewed commit: "fix: thread toast duration through sessi..." | Re-trigger Greptile