Repository navigation
feat(chat): pinned-prompt banner sticks in ChatPane too (chat-core P5-d) - #9538
Conversation
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Verbatim hook extraction plus an opt-in, review-narrowed SDK seam — the right shape for RFC P5-d, with real evidence (tests, recording, real-pod frames). Suggestions
[DESIGN-REVIEWED] 342b1ac |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Verify the What this change shipsInventory (8 items) — 8 justifiedIntent: let a reader of a long reply in a Members DM or split pane keep the turn's own prompt in view — an ADDITION (closes #9527; RFC chat-core P5 "ChatPage-only chrome sinks into the shared surfaces", with merged prior phases P5-a/P5-b).
Cross-checks run: [FIRST-PRINCIPLES-REVIEWED] 342b1ac |
UX Review (Fable 5) — 🟡 CONCERNSUX-level review of Both screenshots render cleanly — banner anchors under the host header/pane title bars, the dark-theme thumbnail frame reads correctly, no clipping or overlap. The reconciliation is complete: every added surface (pinned collapsed/expanded, image strip, after-jump, split view, frameless, both themes) is screenshotted, the bubble→banner hand-off and jump glide have a committed recording, and the blind reader correctly identified the banner and its fold. Two comprehension gaps the reader hit are exactly the two items the PR already filed as #9569. UX-Verdict: CONCERNS The banner itself reads perfectly cold; its two click actions don't — the blind read just turned #9569's hypotheses into confirmed misreads. Watch
Suggestions
[UX-REVIEWED] 342b1ac |
Opus 4.8 Review — ✅ no blocking findingsReviewed Review detailsBoth candidates die under falsification. Candidate 1 (one-frame banner flash when the setting is OFF): the mechanism rests on the child Candidate 2 (per-row wrapper div causes spacing/anchor drift): the finding is stated in "possible" / "if any container relies on direct-child selectors" terms, the wrapper carries no class and takes the row's own box, indexing is gated to hosts that opt in, and the change is validated by the committed screenshots. (a) and (c) are speculative — dropped. No new grounded finding survives in Step 2. No findings. [OPUS-REVIEWED] 342b1ac Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
e56e77e to
f59125a
Compare
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsFINDING -- website/src/app-sdk/ChatMessageList.tsx:298 -- duplicate prompt timestamps make [GPT-REVIEWED] 342b1ac False positive or not applicable? A repository writer can comment: |
4a1ccd7 to
d4371b4
Compare
957ab59 to
bfe0554
Compare
bfe0554 to
f02eb2d
Compare
f02eb2d to
342b1ac
Compare
Closes #9527
Summary
The main chat pins the current turn's user prompt under its title row as you scroll (
PinnedPrompt);ChatPane— Crew Members DM threads and split-view panes — had none of it. This PR sinks the banner intoChatPane(chat-core RFC P5-d, "ChatPage-only chrome sinks into the shared surfaces" — labelled P5-b when opened; renumbered after #8733/#9577 took P5-b/P5-c on main) with zero behaviour change on ChatPage.pages/chat/usePinnedPrompt.ts(new) — the DOM-driven pin geometry extracted verbatim fromuseChatPageTranscriptEarlyController:updatePinnedPrompt, rAF-coalescedonScrollPin,pinnedJumpChrome, expanded/collapsed state, fold + card refs,displayItemsRef. PlusjumpToPinnedPromptInPlace: the self-driven converging glide for an UNVIRTUALIZED transcript (every row mounted), aborted by user scroll intent.useChatPageTranscriptEarlyControllernow calls the hook and returns the same shape; only the virtualized jump (mountIndex→navToDisplayIndex) stays page-side. Same DOM, same class names, samedata-testid="pinned-prompt"; existing pinned tests untouched.app-sdk/ChatMessageListgains an opt-in seam:onDisplayItemsreports the grouped list from a layout effect (rows are in the DOM when the host reads it) and turns row indexing on — each display item is wrapped in adata-display-indexblock;hiddenRownames the ONE row to hide (the bubble the banner stands in for; ts-keyed with an index fallback, the rule living in the list once rather than in every host). Off by default — the embed SDK's DOM is byte-identical.ChatPanemounts the hook +<PinnedPrompt>in a zero-height band between the top edge fade and the scroller. Fold = the scroller's top edge: under the pane's own title bar in split view, under the HOST header inframelessmode (Members DM) — the band is anchored inside the pane root, so it can never paint over that header. HonourschatConfig.pinLastPrompt; resets on slot switch; row hide is identity-keyed bytsexactly as ChatPage does;pinnedImageUrlthumbnails come for free.isPromptinutils/pinnedPrompt.ts, consumed unchanged by the shared hook) and refactor(chat-core): drop ChatPage's duplicate stop_event / notice / mcp_oauth rows (P5-c) #9577 (P5-c).Respects the #8714 revert: the banner is main's current full-card form, not the minimized corner chip.
Screenshots (real pod, seeded member DM with 6 turns)
pinnedImageUrlRecording (motion cannot be judged from a still): 06-members-dm-pin-and-jump-light.webm — the Members DM scrolled by wheel steps through the bubble→banner hand-off and push-out, then the click-to-jump glide (9 s, trimmed to the on-tape load).
Harness:
website/scripts/capture-chatpane-pinned-prompt.mjs(asserts before every frame: banner text, hidden row, band anchoring, thumbnail count, jump direction; records the .webm with Playwright and trims the priming navigation with Playwright's own ffmpeg).Review dispositions
rowStylegeneralized for one consumer) — adopted:rowStyle?: (item, index) => CSSPropertiesreplaced byhiddenRow?: { ts?: string | null; index: number }; the ts-vs-index shift rule now lives inChatMessageListonce, and the SDK barrel publishes a narrow hidden-row key instead of arbitrary per-row CSS..webmabove, committed and SHA-pinned.indexRowsredundant with the two props that consume it) — adopted: the flag is gone; row indexing is inferred fromonDisplayItems != null || hiddenRow != null. Hosts passing neither (ChatEmbed, SideChat, spec-builder) keep the byte-identical DOM.PinnedPrompt: the thumbnail ring wasring-inset, and an inset box-shadow paints BELOW an<img>'s replaced content, so on an opaque image it never showed at all; an outsetring-border-strong(round 2) was still too faint on the dark card. Round 3, as the lane suggested: a solidbg-mutedplate showing through the image's own padding (p-pxinline,p-0.5in the expanded strip) — a real frame an opaque bitmap cannot cover, mid-grey in both themes, inside the element's box so bubble parity is untouched. This is the one deliberate shared-component change in this PR (ChatPage's thumbnails gain the same frame). All frames + recording re-shot; the seeded image is now a landscape screenshot so the thumbnail's aspect is representative.promptBodypreserves the user's own paragraph breaks by design (its docblock), and altering it changes the main chat's expanded card too, outside this PR's zero-ChatPage-change contract. Recorded on #9569 alongside the other two shared-component items.title; thumbnail click jumps rather than enlarges) — both inherited from the sharedPinnedPromptthe main chat already ships, and this PR's contract is zero ChatPage behaviour change; filed as #9569 on the shared component rather than fixed as a pane-only divergence.Tests (written, CI runs them)
src/test/usePinnedPrompt.test.tsx— geometry-derived pin (text + images), rAF coalescing, disable/re-enable, no-prompt case, in-place glide landing (row.top − chrome), user-scroll abort, unmounted target.src/test/ChatPane.pinnedPrompt.test.tsx—data-display-indexrows + fold sentinel, pin + row hide on scroll,pinLastPrompt=false, frameless anchoring, click-to-jump.useChatPageTranscriptEarlyController.coverage,PinnedPrompt.nudgeExpand,pinnedPrompt.pasteTokens) unchanged.Local:
tsc -bclean, eslint clean on every touched file,I18N_BASE_REF=origin/main node website/scripts/i18n-check.mjspasses (no new strings — the banner reusespages.chat.pinnedPrompt.*).