Repository navigation
fix(chat): keep the pinned prompt card above the composer dock - #15828
Conversation
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. [DESIGN-REVIEWED] c4a72c2 Description read[DESCRIPTION-READ] bea7bef7ca3180d74e6446e14d9e50c9dbd99ec9cee33d1384e4cbea2c8b4c22 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Verify the side-pane host: the manual overlap measurements cover only the main chat's dock; ChatPane's 12px Not justified as shipped
What this change shipsInventory (9 items) — 8 justifiedIntent: a FIX — the pinned prompt card must never cover the chat input box on a short pane; provenance is a Slack report plus the PR's own measured reproduction on base (1039px overlap).
Checks run: [FIRST-PRINCIPLES-REVIEWED] c4a72c2 Description read[DESCRIPTION-READ] 33aba6e7f2eee842b800d34278b0d561e5536686e033a4cd4f81f600068daa39 That sha256 names the PR description this verdict read. Recompute it with |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
UX Review (Fable 5) — ✅ PASSUX-level review of UX-Verdict: PASS Verify by playing the supplied recording that expand/collapse stays one continuous motion under the new ceiling — this lane confirmed the mechanism in the diff but cannot play video. [UX-REVIEWED] c4a72c2 Description read[DESCRIPTION-READ] f9a980905618f6540b2a82c255da9ff30d3e2fc6059ff66a58a547099a07147b That sha256 names everything this verdict read: the PR description, plus the 7 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
af1888e to
c51c399
Compare
|
Opus 5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
c51c399 to
78b08ce
Compare
|
|
|
|
The pinned-prompt card is an overlay beside the transcript scroller and paints above the composer dock, and nothing bounded its height: the progressive fold held a tall prompt's card at the bubble's remaining height and the expansion grew it to 40vh plus an image strip. On a short pane both ran past the scroller's bottom and over the input box and the Dynamic Dashboard bar. The ceiling is the transcript floor: the scroller's bottom less its own padding-bottom, which is each host's statement of where readable rows stop. usePinnedPrompt measures it off the scroller, clamps the fold's live height to it and hands it to the card as maxH; PinnedPrompt sets it as max-height on the bubble and lays the body out as a shrinkable flex column so the cap scrolls the prompt instead of clipping it. The morph parks the box at flex-start for its duration so the expand animation reveals the text as before.
78b08ce to
c4a72c2
Compare
|
buluoray
left a comment
There was a problem hiding this comment.
Review at c4a72c2f7fbc51e6905a04478b21c2432e7aa1da — approve
I checked the fix against the source, and the tests fail when the fix is taken out.
Verified in source
- Ceiling:
usePinnedPrompt.tscomputesfloor = scroller.getBoundingClientRect().bottom − computed padding-bottom.computePinnedCardMaxH(utils/pinnedPrompt.ts) returnsmax(0, floor − foldY − ROW_PAD_Y). That matches the card's top, which sitsROW_PAD_Ybelow the fold. The fold'sliveHis clamped withMath.min(maxH, …), andPinnedPrompt.tsxsetsmaxHeightplusoverflow-hiddenon the bubble. - Re-derive: the ResizeObserver now watches the scroller as well as the card. The effect is keyed on
pinned?.idx, which fixes hand-offs between prompts that have nots.nextPinnedPromptStatecarriesmaxHon the same-message path and includes it in the identity short-circuit. - Morph:
alignItems: flex-startis set during the morph. It is cleared ontransitionend, on an interrupted morph and on fold takeover, so it never outlives either writer. - Hosts: on
ChatPage, the scroller pads bydockH + DOCK_CLEARANCE_PX, so the floor sits 16px above the dock. OnChatPane(the first-principles lane's Watch), the scroller pads 12px and the<Composer>is in normal flow below the scroller. The floor is therefore above the composer there too. Disposition: checked, and it doesn't block. - The commit message and description match the code. I found no false statement that would land in main.
tsc -p tsconfig.app.jsonand eslint on the touched files are clean. The 4 pinned-prompt test files pass: 110/110. CI is green at head; each cancelled run is a superseded duplicate of a check that succeeded.
Mutation checks (each one reverted afterwards)
| Fix removed | Tests that failed |
|---|---|
the Math.min(maxH, …) fold clamp |
clamps the fold to the ceiling…, takes the host's bottom padding off the floor…, moves the ceiling with the scroller on the same message… |
the pinned?.idx effect dependency |
re-attaches the observers across a hand-off between prompts that carry no \ts`` |
observer.observe(scrollerRef.current) |
re-attaches the observers… and re-derives the flag when the card itself resizes… |
paddingBottom → 0 |
takes the host's bottom padding off the floor — the dock the main chat pads for |
the bubble's maxHeight style |
sets the ceiling as the box's max-height, caps the fold too… |
Bot findings: GPT, Opus, Design and First-Principles report nothing that blocks. The earlier GPT/UX findings (the observer keying, the scroll cue, the two scroll regions) are fixed at this head, and I confirmed each fix in source. The UX Watch asks for one continuous motion; in source, flex-start during the morph keeps the body at its natural height. I did not play the recording.
Overlap with sibling PRs
- #15820: merges cleanly (
git merge-tree) and works with this change. When the status stack is occupied, #15820 gives the scrollermarginBottom: dockHandpaddingBottom: 16. That moves the scroller's bottom edge, the floor follows it, and the new scroller observer picks up the resize. Follow-up for whichever PR lands second: thepage-layout.mdparagraph added here says "the main chat pads by the dock's height plus a clearance", which only covers #15820's composer-only state. - #15526: merges cleanly.
maxH={pinned.maxH}survives in the mergedChatPage.tsx.
Follow-ups (non-blocking)
- When
maxHevaluates to 0 (fold at or below the floor), the bubble collapses to a sliver showing only its ring and shadow, instead of being hidden. It is an edge case and not reachable in normal layouts.
iamwhatever
left a comment
There was a problem hiding this comment.
Reviewed. The ceiling is the scroller bottom minus padding-bottom, landed as maxHeight on the clipping box, and the fold is clamped with min(maxH, ...); the resize observer is keyed on idx/ts/scrollerRef and disconnected on cleanup; the flex-start swap is cleared on transitionend and fold interruption; the 40vh paragraph cap still wins when smaller. CSS and layout only.
Non-blocking: computePinnedCardMaxH floors at 0 but not at the resting height, so on a pane where maxH is below the natural collapsed height the collapsed-height observer reports the clamped box (feeding pinCollapsedHRef and the hand-off line), min-h-0 lets a one-line prompt read as clamped and show a false chevron, and at maxH=0 the card vanishes and bannerH=0 turns the push off. max(maxH, restingH) or skipping the report while maxH binds would close it; no test covers that case. The second pinnedPrompt.test.ts case recomputes min itself.
…chain) Reverts, newest first: - 5534a7a fix(chat): keep the pinned prompt card above the composer dock (#15828) - 1a3732a fix(chat): keep message actions visible under a pinned long prompt (#13630) - c250d3e fix(chat): hand the pinned prompt over at the pin line, not past it (#11462) the moment its top crosses the fold line, the card stands in for it, and the card shrinks line by line as the reader scrolls. #13630 re-based the fold on the bubble and re-showed the action strip beneath the card; #15828 capped the card at the transcript floor so it stops at the composer dock. For a prompt taller than the viewport the three together make the prompt unreadable: the row is hidden as soon as its top passes the fold, the card shows only the first `maxH` pixels, and scrolling down only makes the card shorter -- the lines below the cap can never be reached (before #15828 they sat under the composer instead). The maintainer's call is that the whole fold / stand-in / hand-off geometry is over-engineering: the banner exists to keep one line of the latest prompt at the top as a click target to jump back, not to be a seamless continuation of the bubble. Roll back to the pre-#11462 behaviour -- the row stays visible and scrolls normally, the card appears once the row's bottom edge has passed the band. Conflict resolution, no behaviour beyond the revert: - `components/markdown/sanitize.ts`: the `data-message-*` attribute reservation #13630 added to MarkdownRenderer had moved here in #14580; removed here instead. - `pages/chat/PinnedPrompt.tsx`: #13318's `max-w-full` (Content Width setting) is kept; #12891's line-height fix lived inside the wheel forwarder #11462 added and goes with it. - `.github/coverage-baselines/frontend.txt`: current baseline kept. - `test/MarkdownRenderer.surface.test.tsx`, `test/MarkdownRenderer.domGolden.test.tsx`: two later tests encoded the `data-message-*` reservation as a dropped attribute; the reserved inputs are removed so the snapshots stay as is. Refs #16340
…chain) Reverts, newest first: - 5534a7a fix(chat): keep the pinned prompt card above the composer dock (#15828) - 1a3732a fix(chat): keep message actions visible under a pinned long prompt (#13630) - c250d3e fix(chat): hand the pinned prompt over at the pin line, not past it (#11462) the moment its top crosses the fold line, the card stands in for it, and the card shrinks line by line as the reader scrolls. #13630 re-based the fold on the bubble and re-showed the action strip beneath the card; #15828 capped the card at the transcript floor so it stops at the composer dock. For a prompt taller than the viewport the three together make the prompt unreadable: the row is hidden as soon as its top passes the fold, the card shows only the first `maxH` pixels, and scrolling down only makes the card shorter -- the lines below the cap can never be reached (before #15828 they sat under the composer instead). The maintainer's call is that the whole fold / stand-in / hand-off geometry is over-engineering: the banner exists to keep one line of the latest prompt at the top as a click target to jump back, not to be a seamless continuation of the bubble. Roll back to the pre-#11462 behaviour -- the row stays visible and scrolls normally, the card appears once the row's bottom edge has passed the band. Conflict resolution, no behaviour beyond the revert: - `components/markdown/sanitize.ts`: the `data-message-*` attribute reservation #13630 added to MarkdownRenderer had moved here in #14580; removed here instead. - `pages/chat/PinnedPrompt.tsx`: #13318's `max-w-full` (Content Width setting) is kept; #12891's line-height fix lived inside the wheel forwarder #11462 added and goes with it. - `.github/coverage-baselines/frontend.txt`: current baseline kept. - `test/MarkdownRenderer.surface.test.tsx`, `test/MarkdownRenderer.domGolden.test.tsx`: two later tests encoded the `data-message-*` reservation as a dropped attribute; the reserved inputs are removed so the snapshots stay as is. Refs #16340
…chain) Reverts, newest first: - 5534a7a fix(chat): keep the pinned prompt card above the composer dock (#15828) - 1a3732a fix(chat): keep message actions visible under a pinned long prompt (#13630) - c250d3e fix(chat): hand the pinned prompt over at the pin line, not past it (#11462) - 65e23bb fix(chat): keep a long prompt readable instead of pinning it (#16321), merged while this revert was in review: its guard is written against the fold geometry (`bubbleBottom`, `foldY`, `restingH`) and is subsumed by the bottom-edge hand-off this revert restores. the moment its top crosses the fold line, the card stands in for it, and the card shrinks line by line as the reader scrolls. #13630 re-based the fold on the bubble and re-showed the action strip beneath the card; #15828 capped the card at the transcript floor so it stops at the composer dock. For a prompt taller than the viewport the three together make the prompt unreadable: the row is hidden as soon as its top passes the fold, the card shows only the first `maxH` pixels, and scrolling down only makes the card shorter -- the lines below the cap can never be reached (before #15828 they sat under the composer instead). The maintainer's call is that the whole fold / stand-in / hand-off geometry is over-engineering: the banner exists to keep one line of the latest prompt at the top as a click target to jump back, not to be a seamless continuation of the bubble. Roll back to the pre-#11462 behaviour -- the row stays visible and scrolls normally, the card appears once the row's bottom edge has passed the band. Conflict resolution, no behaviour beyond the revert: - `components/markdown/sanitize.ts`: the `data-message-*` attribute reservation #13630 added to MarkdownRenderer had moved here in #14580; removed here instead. - `pages/chat/PinnedPrompt.tsx`: #13318's `max-w-full` (Content Width setting) is kept; #12891's line-height fix lived inside the wheel forwarder #11462 added and goes with it. - `.github/coverage-baselines/frontend.txt`: current baseline kept. - `test/MarkdownRenderer.surface.test.tsx`, `test/MarkdownRenderer.domGolden.test.tsx`: two later tests encoded the `data-message-*` reservation as a dropped attribute; the reserved inputs are removed so the snapshots stay as is. Refs #16340
…chain) Reverts, newest first: - 5534a7a fix(chat): keep the pinned prompt card above the composer dock (#15828) - 1a3732a fix(chat): keep message actions visible under a pinned long prompt (#13630) - c250d3e fix(chat): hand the pinned prompt over at the pin line, not past it (#11462) - 65e23bb fix(chat): keep a long prompt readable instead of pinning it (#16321), merged while this revert was in review: its guard is written against the fold geometry (`bubbleBottom`, `foldY`, `restingH`) and is subsumed by the bottom-edge hand-off this revert restores. the moment its top crosses the fold line, the card stands in for it, and the card shrinks line by line as the reader scrolls. #13630 re-based the fold on the bubble and re-showed the action strip beneath the card; #15828 capped the card at the transcript floor so it stops at the composer dock. For a prompt taller than the viewport the three together make the prompt unreadable: the row is hidden as soon as its top passes the fold, the card shows only the first `maxH` pixels, and scrolling down only makes the card shorter -- the lines below the cap can never be reached (before #15828 they sat under the composer instead). The maintainer's call is that the whole fold / stand-in / hand-off geometry is over-engineering: the banner exists to keep one line of the latest prompt at the top as a click target to jump back, not to be a seamless continuation of the bubble. Roll back to the pre-#11462 behaviour -- the row stays visible and scrolls normally, the card appears once the row's bottom edge has passed the band. Conflict resolution, no behaviour beyond the revert: - `components/markdown/sanitize.ts`: the `data-message-*` attribute reservation #13630 added to MarkdownRenderer had moved here in #14580; removed here instead. - `pages/chat/PinnedPrompt.tsx`: #13318's `max-w-full` (Content Width setting) is kept; #12891's line-height fix lived inside the wheel forwarder #11462 added and goes with it. - `.github/coverage-baselines/frontend.txt`: current baseline kept. - `test/MarkdownRenderer.surface.test.tsx`, `test/MarkdownRenderer.domGolden.test.tsx`: two later tests encoded the `data-message-*` reservation as a dropped attribute; the reserved inputs are removed so the snapshots stay as is. - `test/PinnedPrompt.images.test.tsx` (new): the fold's tests carried this file's coverage; without them it reads 78.4%. The thumbnail / failed-image fallback and the jump click were untested pre-#11462 and are covered here. Refs #16340
Problem / Motivation
Goal: The pinned copy of your last prompt never covers the chat input box.
The chat pins the most recent user prompt under the session title while it scrolls away. Two things grow that card: the progressive fold holds it at the prompt bubble's remaining height while the row leaves, and the chevron (or a resting pointer) expands it. Nothing capped either, so on a short pane a long prompt's card ran straight down over the composer and the Dynamic Dashboard bar. Reported in Slack with a screenshot of a 30-item numbered prompt painted over the input box; the reporter traced it to the hover-expand feature.
Why it matters
Anyone who pastes a long prompt in a window that is not very tall loses the input box until they scroll far enough for the card to shrink again. The expand feature exists to let you re-read your prompt; instead it takes the composer away.
Not a goal
max-h-[40vh]cap on the expanded text; the new ceiling sits beside it and whichever is smaller wins.What changed (motivation → approach → change)
usePinnedPrompt.tspadding-bottom— and derivesmaxHfor the card; clamps the fold's live height to it; also observes the scroller's size so a resize re-derives it, and keys that observer on the pinned index too, so a hand-off between prompts without atsre-attaches itutils/pinnedPrompt.tscomputePinnedCardMaxH(foldY, floorY);maxHcarried onPinnedPromptStatePinnedPrompt.tsxmaxHlands asmax-heighton the bubble and the bubble clips (overflow-hidden), so nothing inside can paint past the ceiling; the body is a shrinkable flex column (min-h-0,flex-col,items-stretch) and the expanded image strip scrolls like the text, so the cap scrolls the content instead of cutting it; the morph parks the box atflex-startfor its 150ms so the expand animation reveals the text as beforeChatPage.tsx,ChatPane.tsxmaxHthroughwebsite/src/index.css.pinned-scroll-more: the mask-image fade (a functional gradient, not a fill)website/docs/page-layout.mdSymptom: the card paints over the composer. Cause: the card is an overlay beside the scroller that paints above the dock, and its height came from the prompt (fold) or the viewport (40vh), never from where the transcript ends. Fix: cap it at the transcript floor. The scroller's
padding-bottomis already each host's statement of where readable rows stop (the main chat pads by the dock height plus a clearance, the side pane by 12px), so the hook reads the floor off the scroller rather than taking a prop, and the two cannot be set apart. A host that moves its floor only has to keep its padding honest.Backwards compatibility
Compatible: no API or data change.
maxHis an optional prop; the card is unbounded as before when a host has measured no floor.Tests
pinnedPrompt.test.ts:computePinnedCardMaxHis the card-top-to-floor distance, caps the fold, never goes negative.usePinnedPrompt.test.tsx: new block pins the ceiling — reported asmaxH, clampsliveH, subtracts the scroller'spadding-bottom, leaves a fitting fold alone, moves on a scroller resize for the same pinned message, and re-attaches the observers across a hand-off between prompts that carry nots. Two existing fold tests get a taller fixture scroller so they keep testing the fold; the ResizeObserver test now expects the scroller to be observed too.PinnedPrompt.ceiling.test.tsx(new):maxHlands asmax-height, the box clips, the box and body carry the shrinkable-column classes in both states, the expanded image strip and the all-images-gone glyph live inside the paragraph, the bottom fade class follows the scroll position (on with more below, off at the end and when the text fits, never while collapsed), and the morph'sflex-startis set in flight and cleared ontransitionend.Related set: 10 pinned-prompt vitest files (incl.
kiroLightShellHooks, whose literal for the card's class string follows the newitems-stretch overflow-hiddenbox), 188 tests pass;tsc -p tsconfig.app.jsonclean.Manual verification
Scripted Playwright (Chromium launched without
--hide-scrollbars, so scrollbars render as a user sees them) against two isolated pods built from this worktree and fromorigin/mainatd8fa6a527e, same imported session (a 30-item prompt, two replies), 1400×560 and 1400×420 viewports, default and translucent-panels (glass) looks. Measured the card's bottom against[data-testid="composer-dock-root"]:DOCK_CLEARANCE_PX).Screenshots / video
Mid-fold, dark: before (origin/main) left, after right.
Same with translucent panels on (cropped to the card and the composer, where the glass treatment is):
1400×420, card expanded with the chevron:
1400×420, a six-image prompt expanded: thumbnails and text in one scroll region under the ceiling.
Recording — scroll until the prompt pins (the fold), then expand and collapse; first on
origin/main, then on this branch's final build, scrollbars rendered:pinned-prompt-before-after-final.webm
recorded from c4a72c2 (the final build; and d8fa6a5 for the baseline half) ·
kirodotdev/KiroCrewworktrees viakirocrew pod up· mode: default,mc-liquid-glass=onfor the glass frames · real gateway serving the built SPA with a session imported through/api/chat/slots/import, no fixtures or stubsRelated Issues
no linked issue: reported in Slack (#kirocrew, thread
1790835724.150339); no GitHub issue was filed.Pattern harvest
Not generalizable: one overlay with one host-owned floor; the fix is a single geometric ceiling, not a recurring code shape.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)