feat(hub-ui): render message actions as buttons on toast notifications - #215
Merged
Conversation
Port of vitejs/devtools#526 by @dvcolomban. Co-authored-by: dvcolomban <90617742+dvcolomban@users.noreply.github.com>
✅ Deploy Preview for devfra ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Why
Toasts only ever showed the dismiss ✕ — an entry's own
actions(e.g. theactivatekind, which focuses a dock) only rendered in the messages panel's detail view, not on the toast that actually announced it.What changed
ToastOverlay.vuerendersentry.actionsas buttons in the toast's own#actionsslot, dispatching the same way@devframes/plugin-messages's own detail view does (itsApp.vue'sonActivate):docks.switchEntry(action.activate.dockId)foractivateactions,commands.execute(action.command.id, ...)forcommandactions.ToastOverlay.stories.tsexercising the new button.Context
Ports vitejs/devtools#526 ("feat(core): render message actions as buttons on toast notifications") by @dvcolomban to
packages/hub-ui/src/client/components/display/ToastOverlay.vue, the file's new home after the v0.9 migration.The original PR also fixed a dock-id typo (
devframes-plugin-messageswith hyphens vs. the real mounted iddevframes_plugin_messageswith underscores) — this repo'sToastOverlay.vuealready dispatches via theMESSAGES_DOCK_IDconstant with the correct underscored id, so no separate fix was needed here.The playground demo button from the original PR isn't ported here — it can be re-added directly to
vitejs/devtools'splaygrounds/core/src/pages/devtools.vue, which is unaffected by the migration.Closes #212.
Created with the help of an agent.