Skip to content

feat(conversation): render a page's aside beside the workspace reader - #4071

Closed
gilgtm wants to merge 2 commits into
mainfrom
needs-you/workspace-aside-slot
Closed

gilgtm wants to merge 2 commits into
mainfrom
needs-you/workspace-aside-slot

Conversation

@gilgtm

@gilgtm gilgtm commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

A plugin page that embeds ctx.conversation.ui.Workspace cannot put its own content beside the channel transcript. It can only place it above or below the whole Workspace, so a page that wants a dashboard or details column next to the conversation would have to rebuild the reader. This adds one optional prop that the host renders after the main tab's reader, between the transcript and the side pane, plus a flag so a plugin can tell whether the running host supports it.

API

  • ConversationWorkspaceProps.aside?: ReactNode. It renders as the next sibling of the main tab's reader, inside a new flex row (.workspaceRow, position: relative). The host gives the aside no width, frame or scrolling; the content sets its own width. Its offset parent is that row, so a page can watch the row's size (for example, with a ResizeObserver on offsetParent) and pick its own layout when the side pane opens or the window narrows.
  • ctx.conversation.workspaceSlots?.aside === true when the host renders it. workspaceSlots is a frozen object that names each optional ui.Workspace prop the host renders.

Why this is the smallest general extension point. It is one ReactNode slot and one capability flag, and it names no plugin. The reader, tabs and side pane keep their current owners and behavior. The row wrapper replaces the existing inner .conversation div in the same position. The reader's absolutely positioned descendants already resolve inside [data-attachment-drop-zone], so making the row positioned affects only the aside. The contracts.ts and service.tsx changes are limited to the prop, the flag and their docs (both files are FOUNDATION).

Older hosts. An older host has no workspaceSlots object, so the flag is undefined, and React ignores the unknown aside prop. Plugins should read the flag with ?. and fall back to their current layout, for example a page-level column outside the Workspace. workspaceSlots and its keys are typed optional for that reason, the same way feature-detected capabilities like readModelSettings? are.

Sibling PR. The headerActions slot PR (#4072) adds headerActions to the same workspaceSlots object and the same docs paragraph. Each PR applies to main alone; whichever merges second needs a one-line merge in each spot.

Tests

  • PageTabs.test.tsx: the aside renders as the reader's next sibling, inside the main tabpanel.
  • service.test.tsx: a plugin sees workspaceSlots.aside === true.
  • tests/browser/conversation-workspace.spec.mjs, one new browser case: with a reply open in the side pane, the aside's offsetParent is the row that also holds the transcript, and it sits between the transcript and the side pane. jsdom has no layout or offsetParent, so only a browser can check this contract. It fails in Chromium and WebKit when position: relative is removed from .workspaceRow, and passes in both with it. The full spec passes in both engines (10 tests). The ReaderPage fixture gets a zero-width aside, so other cases' layout does not change.
  • Native macOS check, packaged debug app against a local relay, with a throwaway plugin that was not committed: no aside, then a 280 px aside docked after the reader; the side pane open (row too narrow, aside collapses); the sidebar hidden (aside between transcript and pane); a 1000 px window; then the aside removed, with the same reader element and no remount. That run used this PR's first commit. The review commit changes only types, tests and docs.

Not yet checked: light and dark themes, enlarged text, keyboard focus order through the aside, and human testing.

🤖 Generated with Claude Code

gilgtm and others added 2 commits November 20, 2026 21:39
`ConversationWorkspaceProps.aside` renders after the main tab's reader,
between the transcript and the side pane, in a positioned row that is the
aside's offset parent. The aside sets its own width. Plugins detect the
slot with `conversation.workspaceSlots.aside === 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>
- Cover the aside's offset parent and its place between the transcript
  and the side pane in the conversation workspace browser suite; jsdom
  cannot compute layout. Fails without `.workspaceRow`'s position.
- 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

gilgtm commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Superseded by #4212, which puts the aside in the channel timeline's scroller so it scrolls with the transcript. That PR keeps this PR's aside prop and workspaceSlots.aside flag unchanged.

@gilgtm

gilgtm commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Closing: superseded by #4212, which provides the same aside slot with the floating-panel layout.

@gilgtm gilgtm closed this Nov 22, 2026
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