feat(tui): add interactive toast actions - #42407
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
TUI toasts now pause while hovered and use the whole card as a single click target:
The header shows the destination subtly at rest and highlights the whole-card action on hover.
How
packages/tui/src/ui/toast.tsxtracks 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.tsxdispatchesplugins.listfrom plugin failure toasts.packages/tui/src/app.tsxdispatchesmcp.listfrom failed and unauthenticated MCP toasts.Scope
Actions are local TUI callbacks. This does not add arbitrary plugin-defined actions or change the public toast protocol.
Testing
bun typecheckfrompackages/tuibun run test test/cli/tui/toast.test.tsx test/plugin-hot-reload.test.tsxfrompackages/tui(9 passed)bun run dev:liveverification with a real failed plugin: hover kept the toast visible beyond five seconds, and clicking opened PluginsDemo
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]