Repository navigation
Conversation
This was referenced Nov 20, 2026
gilgtm
force-pushed
the
needs-you/workspace-header-slot
branch
from
November 21, 2026 03:44
1f65d62 to
8de1d3f
Compare
This was referenced Nov 21, 2026
…lbar `ConversationWorkspaceProps.headerActions` renders in the main tab's toolbar, before the conversation actions menu, so a page can offer its own controls with pressed, expanded and badge states. Plugins detect the slot with `conversation.workspaceSlots.headerActions === true`; an older host ignores the prop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Gil Birman <gil@squareup.com>
- Keep the main tab's toolbar empty, as before, when a workspace has neither header actions nor menu actions. - Recommend plain icon buttons with `aria-pressed` or `aria-expanded` for header toggles; the plugin `ui.Button` forwards neither. - Type `workspaceSlots` and its flag as optional, as other feature-detected capabilities are, so plugin code checks before use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Gil Birman <gil@squareup.com>
gilgtm
force-pushed
the
needs-you/workspace-header-slot
branch
from
November 23, 2026 17:31
8de1d3f to
86733c2
Compare
gilgtm
marked this pull request as ready for review
November 23, 2026 17:46
wesbillman
reviewed
Nov 23, 2026
wesbillman
left a comment
Collaborator
There was a problem hiding this comment.
🤖 Star Lord reviewed 86733c2 from source and recommends fixing capability detection before merge. Core-team decision: should the workspace accept plugin-rendered controls, or provide typed actions that the host can render with its accessible toolbar controls?
| private readonly chatIconEntries; | ||
| readonly ui: Conversation["ui"]; | ||
| readonly workspaceSlots = Object.freeze({ | ||
| headerActions: true, |
Collaborator
There was a problem hiding this comment.
[P3] Report support from the active workspace provider. Any plugin can register a workspace, and the first active provider wins. If that provider ignores headerActions, a caller following the documented flag check drops its fallback and the controls disappear. Have the selected provider declare support and leave the flag absent when the provider omits it.
This branch has not been deployed
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.
Summary
A plugin page that embeds
ui.Workspacecan now put its own buttons in the Workspace toolbar. Today that toolbar holds only the host's menu and pane toggle, so a page has to add a second bar above the Workspace for its own toggles. This PR adds one optional prop,headerActions, and a flag so a plugin can tell whether the running host supports it.flowchart LR W["Plugin page<br/>ui.Workspace headerActions={buttons}"] W --> A1 W --> A2 subgraph Closed["Side pane closed"] direction LR A1["Page buttons<br/>(headerActions)"] --> M1["⋯ Conversation actions"] --> T1["Pane toggle"] end subgraph Open["Side pane open"] direction LR A2["Page buttons<br/>(headerActions)"] --> M2["⋯ Conversation actions"] ~~~ T2["Pane toggle<br/>(moved to the pane's header)"] endThe host draws the page's buttons first, then its own menu. The page owns the buttons and their pressed and badge states. With the side pane open, the host already moves its pane toggle into the pane's header; this PR does not change that.
Screenshots
Fixture plugin, test data only. The page passes one dashboard toggle (pressed, with a "3" badge) as
headerActions.Toolbar close-ups:
The host shows its pane toggle only after the pane has held a tab, so the first light close-up has none.
Full window, side pane open:
Video
header-20261123-175917-annotated.mp4
The packaged macOS app, run against a local relay (56 s, annotated). It shows the toolbar with no page buttons, then adds a toggle and presses it. Next it opens a thread in the side pane, narrows the window to 1000 px, closes the pane and removes the toggle.
API
ConversationWorkspaceProps.headerActions?: ReactNode. It renders in the main tab's toolbar, before the Conversation actions menu, while that tab is selected.ctx.conversation.workspaceSlots?.headerActions === truewhen the host renders it.workspaceSlotsis a frozen object that names each optionalui.Workspaceprop the host renders.aria-labelandtitle, plusaria-pressedoraria-expandedon a toggle.How
PageTabs.tsxpassesheaderActionsinto the main tab's existingtoolbaritem, whichPanelWorkspacealready draws before the pane toggle. Most of that diff re-indents the existing menu into a fragment.headerActionsnor menu actions, the toolbar stays absent, as before.contracts.tsandservice.tsx(both FOUNDATION files) change only by the prop, the flag and their doc comments.PanelWorkspaceand the pane toggle are unchanged. The slot names no plugin.Risk
Low. The prop is optional and only plugin pages that pass it see a change. An older host has no
workspaceSlots, so the flag readsundefinedand React ignores the unknown prop. Plugins should check the flag and keep their own chrome as a fallback.Testing
Native macOS run of head
86733c2dd: packaged debug app, local relay, throwaway fixture plugin (not committed). The video and screenshots above come from that run. For each step, the run checked the DOM: the page button sits inside the main header, left of the Conversation actions menu, on the same row, andaria-pressedfollows the page's state. With the side pane open, the pane toggle sits in the pane's header, not the main one. At 1000 px the order holds and nothing leaves the header.New unit tests cover the DOM order with and without a menu, and the flag a plugin sees. Both fail against
main. No browser case was added: jsdom checks the order, and the toolbar layout itself is unchanged.Known limits
asideslot PR (feat(conversation): render a page's aside beside the workspace reader #4071, still a draft) addsasideto the sameworkspaceSlotsobject. Whichever merges second needs a one-line merge there.🤖 Generated with Claude Code