Repository navigation
Conversation
…test message
A plugin page that shows a channel through `ui.Workspace` can pass
`trailing: { restHeight, content({ expanded, toggle }) }` to show a card,
such as a decision to make, over the end of the channel timeline. The host
advertises the slot with `ctx.conversation.workspaceSlots.trailing`; a thread
target and older hosts ignore it.
The card scrolls in its own sheet over the history. At rest its first
`restHeight` pixels sit below the latest message, which a box of that height
keeps above it. A wheel or touch over the card grows it, then slides it up
off the view's top; the history never moves. Over the history above a grown
card, the history scrolls as usual. `toggle()` grows the card to 60px below
the view's top, re-aiming if the layout settles mid-scroll, and back. Jump to
latest and a send return the card to rest. Jump to latest stays above the
card's visible top, and rows under the card aren't marked read.
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-trailing-slot
branch
from
November 23, 2026 18:21
2b9781d to
9ae351e
Compare
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.
A plugin page that shows a channel in
ui.Workspacecan now put content after the latest message, such as a card that asks the reader for a decision. It follows the pattern of #4071 and #4072: a new optional prop, detected through a frozenctx.conversation.workspaceSlotsflag. Nothing changes unless a page passes the prop.FOUNDATION files:
src/features/conversation/contracts.ts(the prop and its doc comment, +8 lines) andsrc/features/conversation/service.tsx(workspaceSlots = Object.freeze({ trailing: true })and its type, +8 lines). Whichever of this PR, #4071 and #4072 lands second merges its flag into the same object.Behavior
The contract applies to a channel target only; a thread target ignores
trailing.restHeightpixels in view, just below the latest message. This rest position is the timeline's latest position for following, Jump to latest, the at-bottom test, the scroll after a send, and catch-up reading. Rows that the content covers are not read.toggle():state.expandedis true past the rest position.position: sticky; bottom: 0footer inside the content sits flush on the history's bottom edge.display: flow-root).Docs:
docs/plugin-architecture.mdanddocs/plugin-authoring-guide.md. The guide advises an opaque sticky footer, and a box-shadow outline rather than a bottom border, because a sticky element sits inside its box's border.Validation
Vitest: messages, channels and conversation pass (5,206 tests). New unit tests cover:
use-reading.test.ts);ConversationTab.test.tsx,PageTabs.test.tsx);service.test.tsx).Browser: 11 new cases (22 runs across both engines) in
tests/browser/conversation-workspace.spec.mjs(trailing content), which pass on Chromium and WebKit. Each one needs real layout, sticky positioning and scroll ranges, which jsdom can't provide.Fail-then-pass checks:
flow-rootfails three cases.scroll,channel-openingand this spec pass on Chromium, WebKit and both measurement projects (44 cases), and the 3,673src/features/messagesunit tests pass.CI: the React feat: persist sidebar preferences in packaged desktop #440 failures ("useEffectEvent called during render") in
navigation-thread-history,inbox-parity,initial-position,right-pane-dismissal,thread-unreadandchannel-openingcame from this PR.use-readingcalled the trailing edge through an effect event, and unread attention reaches it while rows render. The edge is now a ref, and those specs pass on both engines.mainpasses them.Other specs:
history-loading,history-prefix,timeline-setupandnavigation-channel-historypass on both engines. One existing WebKit case,timeline-setup"wheel baseline", failed 1 of 3 on repeat. It uses staticpage.setContentand doesn't load this code, and it passed 4 of 4 on the base revision.Native (packaged macOS app, local relay, throwaway plugin): an annotated run covered:
That run found the collapsed-margin bug fixed here.
Not verified:
🤖 Generated with Claude Code