Skip to content

feat(hub): add a command kind for message-panel actions - #189

Merged
antfu merged 2 commits into
devframes:mainfrom
dvcolomban:dvcol/message-command-action
Aug 12, 2026
Merged

feat(hub): add a command kind for message-panel actions#189
antfu merged 2 commits into
devframes:mainfrom
dvcolomban:dvcol/message-command-action

Conversation

@dvcolomban

@dvcolomban dvcolomban commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

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 bespoke kind.

What changed

  • Adds a second DevframeMessageAction variant, kind: 'command', dispatched through the hub's existing hub:commands:execute RPC — the same one behind the command palette.
  • Wired the dispatch in the messages plugin's onActivate handler; MessageDetail.vue already renders any action kind generically, so it didn't need to change.
  • Purely additive — the existing activate kind and its behavior are untouched.
  • Updated the @devframes/hub tsnapi snapshots for the new exported type.

No new tests: the added dispatch is a two-line if mirroring the existing, itself-untested activate branch right next to it. Ran the full pnpm build && pnpm test && pnpm typecheck && pnpm lint gate — 1082 tests passing, typecheck and lint clean.

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.
@netlify

netlify Bot commented Aug 10, 2026

Copy link
Copy Markdown

Deploy Preview for devfra ready!

Name Link
🔨 Latest commit faf95f4
🔍 Latest deploy log https://app.netlify.com/projects/devfra/deploys/6a7a02d84547870008e26f90
😎 Deploy Preview https://deploy-preview-189--devfra.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@dvcolomban
dvcolomban marked this pull request as ready for review August 10, 2026 15:17
Copilot AI lite review requested due to automatic review settings August 10, 2026 15:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 DevframeMessageCommandAction and widened DevframeMessageAction to a discriminated union.
  • Wired message action activation in the messages plugin client to dispatch kind: 'command' via hub:commands:execute.
  • Updated @devframes/hub tsnapi 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.

Comment thread packages/hub/src/types/messages.ts Outdated
Comment thread plugins/messages/src/client/App.vue Outdated
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.
Copilot AI review requested due to automatic review settings August 10, 2026 16:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 4 changed files in this pull request and generated no new comments.

@antfu
antfu merged commit 2a04efe into devframes:main Aug 12, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants