Skip to content

feat(tui): add interactive toast actions - #42407

Merged
kitlangton merged 7 commits into
v2from
toast-actions
Aug 13, 2026
Merged

feat(tui): add interactive toast actions#42407
kitlangton merged 7 commits into
v2from
toast-actions

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

What

TUI toasts now pause while hovered and use the whole card as a single click target:

  • actionable toasts dismiss and run their action
  • ordinary toasts dismiss without another effect
  • notifications arriving during a hover wait instead of replacing what the user is reading
  • plugin and MCP failures link directly to their existing management dialogs

The header shows the destination subtly at rest and highlights the whole-card action on hover.

How

  • packages/tui/src/ui/toast.tsx tracks remaining timeout duration, pauses/resumes it across hover, queues notifications while a toast is held, and activates or dismisses on click.
  • packages/tui/src/plugin/context.tsx dispatches plugins.list from plugin failure toasts.
  • packages/tui/src/app.tsx dispatches mcp.list from failed and unauthenticated MCP toasts.
  • Focused provider tests cover action activation, queued progression, and plain dismissal.

Scope

Actions are local TUI callbacks. This does not add arbitrary plugin-defined actions or change the public toast protocol.

Testing

  • bun typecheck from packages/tui
  • bun run test test/cli/tui/toast.test.tsx test/plugin-hot-reload.test.tsx from packages/tui (9 passed)
  • Push hook workspace typecheck (34 packages passed)
  • Live bun run dev:live verification with a real failed plugin: hover kept the toast visible beyond five seconds, and clicking opened Plugins

Demo

The recording uses a real plugin failure in the live V2 TUI. The first segment is accelerated while the pointer holds the toast beyond its timeout.

toast-actions.mp4

Flow

flowchart TD
  A[Toast appears] --> B{Pointer enters?}
  B -- no --> C[Timer expires]
  C --> D[Dismiss]
  B -- yes --> E[Pause remaining time]
  E --> F{Card clicked?}
  F -- actionable --> G[Dismiss and run action]
  F -- ordinary --> D
  F -- no, pointer leaves --> H[Resume remaining time]
  H --> C
  E --> I[New toast arrives]
  I --> J[Queue behind held toast]
Loading

@kitlangton
kitlangton enabled auto-merge (squash) August 13, 2026 21:27
@kitlangton
kitlangton merged commit 95be074 into v2 Aug 13, 2026
8 checks passed
@kitlangton
kitlangton deleted the toast-actions branch August 13, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant