Skip to content

feat(plugins): let panels add tab menu actions - #4267

Draft
tellaho wants to merge 1 commit into
mainfrom
tho/plugin-tab-actions
Draft

tellaho wants to merge 1 commit into
mainfrom
tho/plugin-tab-actions

Conversation

@tellaho

@tellaho tellaho commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Category — improvement
User impact — A plugin can put a shortcut for its current content in the tab’s context menu.

Problem
A panel can set its live tab title, but its content cannot contribute a command to that tab’s menu.

Solution
Add an optional list of actions to ctx.panels.useTabTitle. The existing tab menu shows the panel’s commands alongside host commands and runs them through its existing focus and dismissal behavior. The panel’s commands retire when its contribution unmounts.

File changes

src/features/panels/PanelWorkspace.tsx
Publish and retire actions with the tab title, and include them in the existing tab menu.

src/features/panels/service.ts
Describe the optional argument on the injected hook.

src/features/panels/PanelWorkspace.test.tsx
Exercise an action from a plugin panel through the existing menu and verify the host action is still available after the plugin content unmounts.

docs/plugin-authoring-guide.md
Describe the action shape, stable array and compatibility with older hosts.

Try it

  1. Run bin/pnpm exec vitest run src/features/panels/PanelWorkspace.test.tsx.
  2. The plugin fixture opens its tab menu and selects Show logs. The visible content changes to the current build’s logs. After the panel content unmounts, the menu still offers Open in browser.

Validation

All 75 panel tests passed on the tree committed as 624564024e. This is the shared host contract used by the Docs draft in #3776.

The plugin-author contract and the pre-push TypeScript, related unit, and design-system checks passed at this head.

Co-authored-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@feedback.communities.buzz.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant