feat(hub): add a command kind for message-panel actions - #189
Open
dvcolomban wants to merge 2 commits into
Open
Conversation
DevframeMessageAction gains a second variant, 'command', alongside the existing 'activate' kind: it invokes a command from the hub's command registry (the same one backing the command palette) by command.id, via the hub:commands:execute RPC. Wired the dispatch in the messages plugin's onActivate handler; MessageDetail.vue already renders any action kind generically and needed no change. Additive only — the existing 'activate' kind and its behavior are unchanged. Updates the tsnapi public-API snapshots for @devframes/hub to reflect the new exported type.
✅ Deploy Preview for devfra ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This PR expands the hub messages subsystem by adding a new DevframeMessageAction variant (kind: 'command') so message-panel actions can invoke registered hub commands via the existing hub:commands:execute RPC (matching the command palette’s execution path).
Changes:
- Introduced
DevframeMessageCommandActionand widenedDevframeMessageActionto a discriminated union. - Wired message action activation in the messages plugin client to dispatch
kind: 'command'viahub:commands:execute. - Updated
@devframes/hubtsnapi snapshots to reflect the new exported type(s).
Reviewed changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/snapshots/tsnapi/@devframes/hub/types.snapshot.d.ts | Snapshot update to export the new DevframeMessageCommandAction type. |
| tests/snapshots/tsnapi/@devframes/hub/index.snapshot.d.ts | Snapshot update to include the new interface and union type widening. |
| plugins/messages/src/client/App.vue | Adds client-side dispatch for kind: 'command' actions via hub:commands:execute. |
| packages/hub/src/types/messages.ts | Defines the new DevframeMessageCommandAction and updates the DevframeMessageAction union. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
DevframeMessageAction gains a second variant, 'command', alongside the existing 'activate' kind: it invokes a command from the hub's command registry (the same one backing the command palette) by command.id, via the hub:commands:execute RPC. Wired the dispatch in the messages plugin's onActivate handler; MessageDetail.vue already renders any action kind generically and needed no change. Additive only — the existing 'activate' kind and its behavior are unchanged. Updates the tsnapi public-API snapshots for @devframes/hub to reflect the new exported type.
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
Message actions today only support one thing: focusing a dock (
kind: 'activate'). That's too narrow for any action that needs to actually do something — run a diagnostic, trigger a refresh, whatever a hub consumer has registered as a command. The command palette already has a general "invoke by id" mechanism (hub:commands:execute); message actions had no equivalent, so every new use case would otherwise need its own bespokekind.What changed
DevframeMessageActionvariant,kind: 'command', dispatched through the hub's existinghub:commands:executeRPC — the same one behind the command palette.onActivatehandler;MessageDetail.vuealready renders any action kind generically, so it didn't need to change.activatekind and its behavior are untouched.@devframes/hubtsnapi snapshots for the new exported type.No new tests: the added dispatch is a two-line
ifmirroring the existing, itself-untestedactivatebranch right next to it. Ran the fullpnpm build && pnpm test && pnpm typecheck && pnpm lintgate — 1082 tests passing, typecheck and lint clean.