Skip to content

fix(fork): the prompt stash matches the queue card - #469

Merged
NoahHendrickson merged 3 commits into
customfrom
t3/update-message-stash-style
Nov 24, 2026
Merged

NoahHendrickson merged 3 commits into
customfrom
t3/update-message-stash-style

Conversation

@NoahHendrickson

@NoahHendrickson NoahHendrickson commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

The stash drawer was portaled over the composer, so the Nov 23 banner-card redesign never reached it. It stayed inset and tucked under the prompt, in small type, with an X to delete.

The open stash now renders as a card in the banners dock, the card nearest the prompt. The dock gives it the queue card's full width, the 8px gap above the composer, the card fill (the thread-composer card on Flat Glass and Basic) and chat-stream type.

  • Shared with the queue card: one CSS block, :is([data-fork-queued-runs-banner], [data-composer-stash-drawer]), for the 40px header and rows that run edge to edge, split by full-width hairlines. It also keeps rows full width when the list scrolls. Both cards use custom/ComposerCardParts.tsx for the counted title ("Stash N", "Queued N") and the muted trash remove.
  • Highlights on Flat Glass: inside both cards, --accent is the composer's control hover. Before, row highlights and ghost-button hovers vanished into the Flat Glass card's own lift; that bug was in the queue card too.
  • Stash-only: the header label follows the interface font size (1rem).
  • Tab: the Stash tab steps aside while the card is open.
  • Fork fences: the edits to ChatComposer.tsx and ComposerStashMenu.tsx are fenced under fork-composer-shell, and the manifest lists both files.

Follow-up, not in this PR: no guard covers the stash selectors yet.

Checks: vp run check:changed and the fork lint ratchet pass. I checked it in a browser on Flat Glass:

  • the card is 736px wide and sits 8px above the prompt;
  • the highlight is the 4% control hover;
  • restore fills the prompt and keeps focus;
  • Escape closes the card, and so does clicking outside it.

Reviewed with sol-loop: 2 rounds with gpt-6.2-sol on high. Sol verdict: approved. That covers the first approach; the dock rework came after it, from the PR review.


🤖 Signed: Claude Opus 5.5 (claude-opus-5-5) via Claude Code
🤖 Claude Opus 5.5 (claude-opus-5-5) subagent: code review. I applied its click-through and hover-wash fixes; the dock rework later made both unnecessary.
🤖 GPT-6.2 Sol (gpt-6.2-sol) via Codex: sol-loop reviewer. I applied its scrolling-row and fence fixes.

The stash drawer is portaled over the composer, so the banner-card redesign
never reached it: it stayed inset, tucked under the prompt, in small type
with an X. It now spans the prompt 8px above it, with the queue card's
header, 40px edge-to-edge rows, chat-stream type and a muted trash remove;
the header label follows the interface font size.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:L labels Nov 24, 2026

@NoahHendrickson NoahHendrickson left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code-quality review of a7550a6 (base 514de9a). Not approving.

The visual goal is right, but the PR gets there by rebuilding by hand, outside the form, every piece of composer context the portal loses. This adds five separate mechanisms that each patch over the portal:

  1. a new form stamp (data-fork-composer-stash-open) that exists only so CSS can zero --chat-composer-drawer-inset, which JS then reads back;
  2. a calc(1rem + 9px) margin that undoes the layer's JS tuck (rootFontSizePx + 1) and adds the cards' 8px gap;
  3. a pointer-events: none override on the layer, needed only because of that margin;
  4. a second copy of the thread-composer card scope in theme.custom.thread-composer.css, which checks the root data-fork-draft-hero-shown where the original checks the overlay's :not([data-draft-hero]), and sets --fork-composer-radius: 12px again;
  5. a line-for-line copy of the queue card's shape rules, plus a widened guard regex for the text-size remap.

The PR's own follow-ups list is mostly fallout from this approach. "Shows less in short windows" comes from the margin eating the layer's computed maxHeight. "Inlet sits closer/narrower" comes from the restated rules not matching Inlet's own drawer rules.

1. Possible code-judo move: render the stash as a card in the banners dock instead of portaling it

The queue card, which the stash is meant to copy, already lives in ComposerBanner.Column inside the form, and the ComposerStashBadge is in that same dock. If ComposerStashMenu rendered there, inside a ComposerBanner.Attachment like the top drawer, it would pick up for free:

  • full width;
  • the 8px lift (> [data-slot=composer-banner-attachment] { margin-bottom: 8px });
  • the card fill and ring;
  • the thread-composer card on Flat Glass and Basic, with the right draft scope;
  • the chat-stream text remap, so the guard needs no change.

All of #1–#5 would go away: no form stamp, no margin magic, no pointer-events override, no root-scoped duplicate in thread-composer.css. The CSS change would shrink to sharing the queue card's row rules (point 2 below).

Things to check before committing to this:

  • Height. Does the dock's overlay cap the card's height sensibly? The queue card uses max-h-32 on its scroll area. Today the layer's canOverflowTop floor does this job.
  • Events. Does moving the drawer inside the form change any keyboard or pointer handling? composerEventScope.ts lists [data-composer-drawer-layer], and the stash adds its own capture-phase keydown and pointerdown listeners.

If one of those really requires the portal, say so in the fence. Then do the fallback below.

Fallback, if the portal has to stay: put the lift in ComposerCommandMenuLayer itself. It already reads --chat-composer-drawer-inset from the form, so read a sibling variable for the overlap (or take a prop) instead of hard-coding rootFontSizePx + 1. The card then sits 8px up because the layer is placed there, not because a margin fights the layer. That removes the calc(1rem + 9px), the pointer-events override and its :has(), and the short-window regression.

2. The queue card's look is copied, not shared

theme.custom.css:2668: padding: 0; overflow: clip; border-radius, the 40px [data-composer-banner-row] rule, gap: 0, and the li hairline all repeat the [data-fork-queued-runs-banner] block 20 lines above. The "twin" will drift the first time one of them changes. Write it once with a shared selector or stamp, e.g. :is([data-fork-queued-runs-banner], [data-composer-stash-drawer]) with :is(ol, ul). Keep only the real stash differences (header font size, scrollbar inset) in their own block.

The JSX has the same problem. ComposerStashMenu.tsx:179 copies the queue card's header markup ("Label" plus the font-normal text-muted-foreground/70 tabular-nums count span), and :284 copies its icon-xs/ghost-muted Trash2Icon button. Since these are meant to stay identical, move them into a small component in apps/web/src/custom/ and use it in both places. The fences in the upstream file then shrink to one import and one call.

3. A Button restyle in feature CSS, and washes that ignore the existing token

theme.custom.css:2715–2721 changes [data-slot="button"] hover and pressed from a feature block, which gets around shadcn/no-restyle. It also uses hand-picked 5% and 8% foreground washes, even though every theme already defines --fork-composer-control-hover for exactly this case.

The stated reason, "on Flat Glass --accent is the card's own fill", applies just as much to the queue card's identical ghost-muted buttons and to its highlighted row. So one of two things is true:

  • the queue card has the same bug, and the fix belongs in one shared place (a composer-card token for ghost-muted hover), or
  • the queue card is fine, and the stash shouldn't need the override either.

4. The same condition in two places in ChatComposer

ChatComposer.tsx:4032 and :4226 both spell out isStashMenuOpen && !composerMenuOpen, once for the stamp and once for the render. If point 1 lands, the stamp goes away. Otherwise, compute one stashDrawerOpen so the stamp can't fall out of sync with what is mounted.

Size

theme.custom.css is already 3,710 lines. This PR adds about 80 more, most of them the duplicated block from point 2. Points 1 and 2 together should bring that close to zero net.

Order of priority: 1, then 2, then 3. Point 4 sorts itself out once 1 lands.

@NoahHendrickson NoahHendrickson left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review of a7550a6ca367cdc639f861e4618cd880ca2a1ba0 (/code-review high, findings checked against the source).

Three findings, inline:

  1. important: the stash card's Flat Glass/Basic scope reads a global root stamp, so a split draft pane flips the stash in the other pane back to glass.
  2. important: overflow: clip on the drawer clips its own ::before drop shadow. The PR lists this as a Glass-only follow-up, but it applies to every theme that keeps the glass card: Glass, Inlet, 3D-glass Flat Glass, and the new-agent draft hero. Only the Flat Glass/Basic thread-composer card is unaffected, because its ::before swaps the outer shadow for an inset ring.
  3. nit: the 25px lift comes out of the layer's 96px floor, so in a short window the stash can show its header and no full entry. That undoes what canOverflowTop was added for. The PR's "list shows less" note understates this.

No other correctness issues found in the TSX, manifest, or guard changes.


🤖 Signed: Claude Opus 5.5 (claude-opus-5-5) via Claude Code

:root[data-fork="noahhendrickson-t3code"]:is(
[data-fork-glass-3d="off"].dark[data-fork-theme="cool-darker"],
[data-fork-theme="basic"]
):not([data-fork-draft-hero-shown])

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

important: data-fork-draft-hero-shown is a counted root stamp shared by every ChatView (custom/forkStageStamps.ts: "Root stamps are counted, so split panes and the side chat share them"). The form rule this stands in for is per pane: [data-chat-composer-overlay]:not([data-draft-hero]).

Failure: on Flat Glass or Basic, use the split toggle, which opens a draft pane (hero shown) beside the thread. Open the stash in the thread pane's composer and it draws as the glass card with 16px corners, not the thread composer's card that the queue card uses.

Fix: scope it to something the portaled drawer carries. For example, ChatComposer could pass a per-composer flag (not draft hero) into ComposerStashMenu and stamp it on the drawer, then key this rule on that stamp instead of :root.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in eec7e86 by deleting this rule. The stash now renders inside the form, in the banners dock, so the per-pane thread-composer scope ([data-chat-composer-overlay]:not([data-draft-hero]) [data-chat-composer-form]) reaches it directly, as it does the queue card. Nothing reads the root stamp now.

Comment thread apps/web/src/theme.custom.css Outdated
--chat-composer-attached-seam: transparent;
margin-bottom: calc(1rem + 9px);
padding: 0;
overflow: clip;

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

important: the drawer is ComposerBanner.Root, and its ::before carries the outer before:shadow-composer dark:before:shadow-composer-dark (ComposerBanner.tsx:65). overflow: clip here clips that pseudo-element's shadow at the card edge. This lands just as the card is lifted 8px off the prompt to float over the transcript.

The PR body lists this only for Glass, but it applies to every theme where the stash keeps the glass card: Glass, Inlet, 3D-glass Flat Glass, and the draft hero. Only the Flat Glass/Basic rule in theme.custom.thread-composer.css avoids it, because it replaces the shadow with an inset ring.

Fix: clip the scroll area or rows, which only need it for the row washes at the rounded corners, instead of the drawer root. Or move the outer shadow onto the drawer element itself.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in eec7e86: there is no outer shadow left to clip. In the dock, the card rule [data-fork-composer-banners] [data-slot="composer-banner"][data-composer-banner-surface="attached"]::before replaces the ::before box-shadow with the inset hairline in every theme, as it does for the queue card. That card has always had overflow: clip, and the stash now shares its block.

Comment thread apps/web/src/theme.custom.css Outdated
pointer-events: auto;
--chat-composer-attachment-overlap: 0px;
--chat-composer-attached-seam: transparent;
margin-bottom: calc(1rem + 9px);

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this margin sits inside the layer, so it takes 25px from ComposerCommandMenuLayer's Math.max(96, spaceAbove - 24) floor, which doesn't know about the lift. At the floor the drawer gets about 71px, but the 40px header plus a 41px first row (border included) is 81px. So in a short window, or with the composer near the top, you get the header and a cut-off first entry. canOverflowTop was added to keep the entries and drop the header.

Fix: apply the lift outside the layer's height budget. For example, add it to the layer's bottom for the stash, or subtract it from the floor.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in eec7e86 by deleting the margin. The stash no longer uses ComposerCommandMenuLayer: it is an in-flow card in the dock, capped by ComposerBanner.Scroll's max-h-[min(24rem,40dvh)], so the layer's floor no longer applies.

The review of #469 found the portaled stash rebuilt, by hand, every piece of
composer context the portal loses. Rendered as the card nearest the prompt
in the banners dock instead, it gets the width, the 8px lift, the card fill
and the chat-stream type from the dock, so the form stamp, the lift margin,
the pointer-events override and the second thread-composer scope go.

It shares the queue card's rules and parts (ComposerCardParts: the counted
title and trash remove). Inside both cards --accent is the composer's
control hover, so row highlights and ghost buttons read on Flat Glass's
card lift. The stash tab steps aside while the card is open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@NoahHendrickson

Copy link
Copy Markdown
Owner Author

Addressed the code-quality review in eec7e86.

1. The stash now renders as a card in the banners dock. It's the last attachment in ComposerBanner.Column, the card nearest the prompt. The dock gives it the width, the 8px lift, the card fill, the thread-composer scope and the chat-stream type. So the form stamp, the calc(1rem + 9px) margin, the pointer-events override, the root-scoped copy in theme.custom.thread-composer.css and the widened guard regex are all gone. The short-window and Inlet follow-ups went with them.

  • Height: ComposerBanner.Scroll keeps its own max-h-[min(24rem,40dvh)] cap. The card is in flow, so the transcript ends above it.
  • Events: I checked these in a browser. Restore fills the prompt and keeps focus there. Escape closes the card, and so does a pointerdown outside it. The menu's capture-phase listeners don't depend on the portal. Like the queue card and the banner stack, the card is stamped data-chat-composer-collapsed-controls, so focus moving into it doesn't count as leaving the composer.
  • Tab: the Stash tab steps aside while the card is open, because the card's header names the stash.

2. One block now covers both cards: :is([data-fork-queued-runs-banner], [data-composer-stash-drawer]), with :is(ol, ul). The scroll inset fix is in it too, so it applies to the queue card as well. The only stash-only rule is the header label at the interface size, which was a separate request. The counted title and the trash remove moved to custom/ComposerCardParts.tsx. Both cards use them, and the fence in ComposerStashMenu.tsx is down to one import and the two calls.

3. The queue card had the same bug. Its editing row and its ghost-muted hovers fill with --accent, and on Flat Glass that's the card's own lift. The fix is now one token override in the shared block, --accent: var(--fork-composer-control-hover), which fixes both cards. That replaces the Button hover restyle and the hand-picked washes.

4. Fixed by 1. ChatComposer computes stashDrawerOpen once and uses it for both the card and the tab.

theme.custom.css is now +27/−5 against base (it was about +80). The whole diff is 5 files plus ComposerCardParts.tsx, +89/−46. vp run check:changed and the fork lint ratchet pass.

Resolves the #467 header conflict: ComposerCardTitle takes text-sm/5,
so the queue and stash titles share one size on the banner scale.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@NoahHendrickson

Copy link
Copy Markdown
Owner Author

Merged origin/custom in 08541a8 to clear the conflict with #467, which is now merged. Both PRs rewrote the queue card's header line. #467's reviewed fix made it text-sm/5, and here it became ComposerCardTitle. The shared ComposerCardTitle now carries text-sm/5, so the queue and stash titles share one size on the banner scale. The stash-only font-size: 1rem row rule is deleted, because the title's own class would override it anyway. At the default Chat stream size both titles render at 1rem / 1.25rem, the same as before. The manifest line follows. vp run check:changed passes.


🤖 Signed: Claude Opus 5.5 (claude-opus-5-5) via Claude Code

@NoahHendrickson
NoahHendrickson merged commit da98766 into custom Nov 24, 2026
32 checks passed
@NoahHendrickson
NoahHendrickson deleted the t3/update-message-stash-style branch November 24, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants