From 44ecc08c0434390d59e83fd6ba97d21d1acc13fb Mon Sep 17 00:00:00 2001 From: x Date: Sun, 15 Nov 2026 12:05:20 -0500 Subject: [PATCH 1/7] feat(web): a thread that finishes on screen pulses its Done dot When a sidebar status mark turns from Working to Done while the Done dot is on screen, two rings pulse off the dot and a petal's mascot in the same row hops once. Every theme; reduced motion skips it. Each thread's last mark outlives the row, since a finished row moves group, but only for 1.5s, so a row unmounted while working does not celebrate later. Co-Authored-By: Claude Opus 5.5 --- .fork/customizations.yaml | 16 +++ .../__fork_guards__/sidebarV2CardRows.test.ts | 2 +- .../src/custom/SidebarV2StatusIndicator.tsx | 21 +++- apps/web/src/custom/doneCelebration.test.ts | 40 +++++++ apps/web/src/custom/doneCelebration.ts | 110 ++++++++++++++++++ 5 files changed, 185 insertions(+), 4 deletions(-) create mode 100644 apps/web/src/custom/doneCelebration.test.ts create mode 100644 apps/web/src/custom/doneCelebration.ts diff --git a/.fork/customizations.yaml b/.fork/customizations.yaml index 6b7ca8d672a97..5a80b2267f463 100644 --- a/.fork/customizations.yaml +++ b/.fork/customizations.yaml @@ -7429,3 +7429,19 @@ - apps/web/src/custom/SidebarV2ChromeRows.tsx verify: - apps/web/src/__fork_guards__/forkBots.test.ts +- id: fork-done-celebration + intent: > + A thread whose mark turns from Working to Done while it is on screen + celebrates once, in every theme: two rings in the Done dot's colour pulse + off it, and a petal's mascot in the same row gives one small hop. The + transition is remembered per thread across remounts (a finished row moves + out of the Working group), but only briefly, so a row scrolled away while + working that comes back Done stays still. Reduced motion skips it. + tier: 1 + files: + - apps/web/src/custom/doneCelebration.ts + - apps/web/src/custom/SidebarV2StatusIndicator.tsx + shadows: [] + watch: [] + verify: + - apps/web/src/custom/doneCelebration.test.ts diff --git a/apps/web/src/__fork_guards__/sidebarV2CardRows.test.ts b/apps/web/src/__fork_guards__/sidebarV2CardRows.test.ts index c75335b3d76d9..bcd4710fbf703 100644 --- a/apps/web/src/__fork_guards__/sidebarV2CardRows.test.ts +++ b/apps/web/src/__fork_guards__/sidebarV2CardRows.test.ts @@ -401,7 +401,7 @@ describe("fork guard: sidebar-v2-card-rows", () => { expect(marks).toMatch( /tone === "failed" \? \(\s*/u, ); - expect(marks).toContain(''); + expect(marks).toContain(''); // Idle is the hollow twin of the Done dot, per Noey (2026-09-09). expect(marks).toContain( '', diff --git a/apps/web/src/custom/SidebarV2StatusIndicator.tsx b/apps/web/src/custom/SidebarV2StatusIndicator.tsx index b54f2f707da82..cf20e59504e47 100644 --- a/apps/web/src/custom/SidebarV2StatusIndicator.tsx +++ b/apps/web/src/custom/SidebarV2StatusIndicator.tsx @@ -1,3 +1,5 @@ +import { type RefObject, useRef } from "react"; + // Imported through the shim's own path rather than the `lucide-react` alias. // This file is fork-owned, so there is no upstream import site to preserve — // the alias exists to keep *upstream's* imports untouched, not this one. @@ -12,6 +14,7 @@ import { } from "./icons/lucide-phosphor"; import { cn } from "~/lib/utils"; import { BEAD_RING_PERIOD, bakeBeadRingFilm } from "./beadRing"; +import { useDoneCelebration } from "./doneCelebration"; import { useForkWorkingMark } from "./forkWorkingMark"; /** The trailing slot of a Sidebar V2 card row's title line, and this module @@ -376,7 +379,13 @@ export function SidebarV2WorkingMark({ seed }: { seed: string }) { from "finished" and "broke" by form. The glyphs are 12px because Phosphor inks a circle on ~81% of its grid: that is the design's 9.75px, and the same visual weight as the 10px dot beside it. */ -function SidebarV2StatusDot({ tone }: { tone: SidebarV2DotTone }) { +function SidebarV2StatusDot({ + tone, + dotRef, +}: { + tone: SidebarV2DotTone; + dotRef: RefObject; +}) { return ( {tone === "approval" || tone === "input" ? ( @@ -384,7 +393,7 @@ function SidebarV2StatusDot({ tone }: { tone: SidebarV2DotTone }) { ) : tone === "failed" ? ( ) : ( - + )} ); @@ -458,6 +467,12 @@ export function SidebarV2StatusMark(props: { readonly quietWorking?: boolean; }) { const status = props.status; + const dot = useRef(null); + useDoneCelebration( + props.seed, + status === null ? "idle" : status.mark === "dot" ? status.tone : status.mark, + dot, + ); if (status === null) { if (props.idle === "draft") { return ( @@ -490,7 +505,7 @@ export function SidebarV2StatusMark(props: { ) : status.mark === "woke" ? ( ) : ( - + )} ); diff --git a/apps/web/src/custom/doneCelebration.test.ts b/apps/web/src/custom/doneCelebration.test.ts new file mode 100644 index 0000000000000..fe979531f253b --- /dev/null +++ b/apps/web/src/custom/doneCelebration.test.ts @@ -0,0 +1,40 @@ +import { describe, expect, it } from "vite-plus/test"; + +import { createDoneTransitions } from "./doneCelebration"; + +describe("createDoneTransitions", () => { + it("celebrates a Done that just followed Working, once", () => { + const transitions = createDoneTransitions(); + transitions.enter("a", "working", 0); + // The row sat Working for a minute; its mark leaves Working as it turns Done. + transitions.leave("a", "working", 60_000); + expect(transitions.enter("a", "done", 60_000)).toBe(true); + // A second copy of the same thread's mark finds the transition taken. + expect(transitions.enter("a", "done", 60_010)).toBe(false); + }); + + it("celebrates across a remount, when the finished row moves group", () => { + const transitions = createDoneTransitions(); + transitions.enter("a", "working", 0); + transitions.leave("a", "working", 60_000); + expect(transitions.enter("a", "done", 60_016)).toBe(true); + }); + + it("stays still for a row unmounted while Working (a folded section) that comes back Done", () => { + const transitions = createDoneTransitions(); + transitions.enter("a", "working", 0); + transitions.leave("a", "working", 1_000); + expect(transitions.enter("a", "done", 120_000)).toBe(false); + }); + + it.each(["idle", "approval", "failed"])("does not celebrate Working turning %s", (kind) => { + const transitions = createDoneTransitions(); + transitions.enter("a", "working", 0); + transitions.leave("a", "working", 0); + expect(transitions.enter("a", kind, 0)).toBe(false); + }); + + it("does not celebrate a thread first seen Done", () => { + expect(createDoneTransitions().enter("a", "done", 0)).toBe(false); + }); +}); diff --git a/apps/web/src/custom/doneCelebration.ts b/apps/web/src/custom/doneCelebration.ts new file mode 100644 index 0000000000000..9ca866507dc15 --- /dev/null +++ b/apps/web/src/custom/doneCelebration.ts @@ -0,0 +1,110 @@ +/** + * A thread that finishes while you watch the sidebar: two rings pulse off its Done dot, and a + * petal's mascot gives one small hop. See `.fork/customizations.yaml#fork-done-celebration`. + */ +import { type RefObject, useEffect } from "react"; + +/** How long after a mark last showed Working a Done still counts as that thread finishing. */ +const FRESH_MS = 1500; + +/** + * Each thread's last mark, outliving the row that drew it: a finished thread moves out of the + * Working group, so the row showing Done is often a fresh mount. Leaving a mark stamps it, so a + * row scrolled away long ago that comes back Done is stale and stays still. + */ +export function createDoneTransitions() { + const seen = new Map(); + return { + /** Record `kind` for `seed`; true when it is a Done that just followed Working. */ + enter(seed: string, kind: string, now: number): boolean { + const previous = seen.get(seed); + seen.set(seed, { kind, at: now }); + return kind === "done" && previous?.kind === "working" && now - previous.at <= FRESH_MS; + }, + leave(seed: string, kind: string, now: number) { + if (seen.get(seed)?.kind === kind) seen.set(seed, { kind, at: now }); + }, + }; +} + +const transitions = createDoneTransitions(); + +/** Plays the celebration on `dot` when `seed`'s mark turns from Working to Done. */ +export function useDoneCelebration(seed: string, kind: string, dot: RefObject) { + // oxlint-disable-next-line t3code/no-unreasoned-state-sync -- animates the DOM when the mark's status changes, keyed across remounts + useEffect(() => { + const element = dot.current; + // A hidden copy (a collapsed tab while the sidebar is open) must not take the transition + // from the copy on screen. + if (kind !== "done" || (element !== null && isOnScreen(element))) { + if (transitions.enter(seed, kind, performance.now()) && element !== null) { + const row = element.closest("[data-thread-item], [data-fork-thread-tab]"); + celebrateDone(element, row?.querySelector("svg[data-fork-bot-mascot]") ?? null); + } + } + return () => transitions.leave(seed, kind, performance.now()); + }, [seed, kind, dot]); +} + +/** Drawn, and its centre inside every box that clips it: the rings sit on the page, above the clips. */ +function isOnScreen(element: HTMLElement): boolean { + if (!element.checkVisibility({ visibilityProperty: true })) return false; + const box = element.getBoundingClientRect(); + const x = box.left + box.width / 2; + const y = box.top + box.height / 2; + for (let clip = element.parentElement; clip !== null; clip = clip.parentElement) { + const style = getComputedStyle(clip); + if (style.overflowX === "visible" && style.overflowY === "visible") continue; + const bounds = clip.getBoundingClientRect(); + if (x < bounds.left || x > bounds.right || y < bounds.top || y > bounds.bottom) return false; + } + return true; +} + +function celebrateDone(dot: HTMLElement, mascot: SVGElement | null) { + if (matchMedia("(prefers-reduced-motion: reduce)").matches) return; + + // Two rings in the dot's own color, the second 320ms behind the first. + const box = dot.getBoundingClientRect(); + const color = getComputedStyle(dot).backgroundColor; + for (const [index, delay] of [0, 320].entries()) { + const ring = document.createElement("div"); + Object.assign(ring.style, { + position: "fixed", + left: `${box.left}px`, + top: `${box.top + box.height / 2 - box.width / 2}px`, + width: `${box.width}px`, + height: `${box.width}px`, + borderRadius: "50%", + border: `2px solid ${color}`, + boxSizing: "border-box", + // The first ring carries a faint fill, so the pulse reads as a flash, not just a line. + background: index === 0 ? `color-mix(in srgb, ${color} 22%, transparent)` : "transparent", + pointerEvents: "none", + zIndex: "2147483000", + opacity: "0", + }); + document.documentElement.append(ring); + ring.animate( + [ + { transform: "scale(1)", opacity: 0.85 }, + { transform: "scale(4.6)", opacity: 0 }, + ], + { duration: 1200, delay, easing: "cubic-bezier(.2,.7,.3,1)", fill: "both" }, + ).onfinish = () => ring.remove(); + } + + // The mascot: crouch, hop 3.5px, land with a soft squash, settle. Anchored at its feet. + if (mascot === null) return; + mascot.style.transformOrigin = "50% 100%"; + mascot.animate( + [ + { transform: "translateY(0) scale(1, 1)" }, + { transform: "translateY(0) scale(1.06, .9)", offset: 0.14 }, + { transform: "translateY(-3.5px) scale(.96, 1.05)", offset: 0.42 }, + { transform: "translateY(0) scale(1.05, .93)", offset: 0.7 }, + { transform: "translateY(0) scale(1, 1)" }, + ], + { duration: 560, easing: "ease-in-out" }, + ); +} From 2d7f10d87f13e72418c4a2ffbcdde9671bfd4a5b Mon Sep 17 00:00:00 2001 From: x Date: Sun, 15 Nov 2026 12:05:32 -0500 Subject: [PATCH 2/7] fix(web): Glass surfaces read as glass again - The composer's context strip drops upstream's new surface-glass fill, which painted a band behind the pills under the desktop glass. - The music strip and its open button take a white wash and the popups' glass edge instead of a grey slab mixed from the translucent panel. - The Code / Chat switch's chosen mode wears the selected glass. - The Bots header joins the Threads header on the quiet ink. - The petal Threads panel drops the card tint other right panels keep, so it matches the sidebar; the panel is stamped from React, not :has(). Co-Authored-By: Claude Opus 5.5 --- .../forkCoolDarkerTheme.test.ts | 3 +- .../src/__fork_guards__/forkGlass3d.test.ts | 5 +- .../__fork_guards__/forkPopupSurface.test.ts | 9 +++ .../__fork_guards__/forkStageStamps.test.ts | 7 ++ apps/web/src/custom/bots/BotThreadsPanel.tsx | 2 + apps/web/src/custom/forkStageStamps.ts | 13 +++ apps/web/src/theme.custom.glass-stage.css | 9 +++ apps/web/src/theme.custom.glass-surfaces.css | 81 +++++++++++++++++++ apps/web/src/theme.custom.palettes.css | 25 +++++- 9 files changed, 150 insertions(+), 4 deletions(-) diff --git a/apps/web/src/__fork_guards__/forkCoolDarkerTheme.test.ts b/apps/web/src/__fork_guards__/forkCoolDarkerTheme.test.ts index ed7f8ee6f5e6d..8491a8382f2b6 100644 --- a/apps/web/src/__fork_guards__/forkCoolDarkerTheme.test.ts +++ b/apps/web/src/__fork_guards__/forkCoolDarkerTheme.test.ts @@ -165,7 +165,7 @@ describe("fork guard: fork-cool-darker-theme", () => { expect( ruleBodyFor(themeRules, [ ...DARKER_PANEL, - ":is( [data-fork-projects-row], [data-fork-project-section-header], [data-fork-status-section-header], [data-fork-thread-card-meta], [data-fork-thread-card-actions], [data-fork-idle-mark] )", + ":is( [data-fork-projects-row], [data-fork-bots-row], [data-fork-project-section-header], [data-fork-status-section-header], [data-fork-thread-card-meta], [data-fork-thread-card-actions], [data-fork-idle-mark] )", ]), ).toMatch(new RegExp(`--contrast-muted-foreground${quietInk.source}`, "u")); // The draft pencil is drawn at muted/70, so it takes the ink directly. @@ -179,6 +179,7 @@ describe("fork guard: fork-cool-darker-theme", () => { // Every hook has to exist for the rule to land on anything. for (const [file, hook] of [ ["../custom/SidebarV2ChromeRows.tsx", "data-fork-projects-row"], + ["../custom/bots/SidebarV2BotsSection.tsx", "data-fork-bots-row"], ["../custom/SidebarV2ProjectGroupHeader.tsx", "data-fork-project-section-header"], ["../custom/SidebarV2StatusSectionHeader.tsx", "data-fork-status-section-header"], ["../custom/SidebarV2ThreadCardMeta.tsx", "data-fork-thread-card-meta"], diff --git a/apps/web/src/__fork_guards__/forkGlass3d.test.ts b/apps/web/src/__fork_guards__/forkGlass3d.test.ts index 8b0e090a4696e..d023be6df659e 100644 --- a/apps/web/src/__fork_guards__/forkGlass3d.test.ts +++ b/apps/web/src/__fork_guards__/forkGlass3d.test.ts @@ -36,9 +36,10 @@ describe("fork guard: fork-glass-3d", () => { for (const rule of selection) { const isTokens = compact(rule.selector) === compact(`${NOT_OFF}${PALETTE}`); // The collapsed sidebar's tab row (fork-collapsed-thread-tabs) is the list laid - // sideways; the model picker's open provider tab (fork-model-picker) is selected too. + // sideways; the model picker's open provider tab (fork-model-picker) and the sidebar's + // chosen Code / Chat mode (fork-chat-mode) are selected too. const isSelectedRow = - /\[data-thread-item\]|\[data-fork-chrome-row\]|\[data-fork-thread-tabs\]|\[data-fork-model-picker="providers"\] \[data-model-picker-provider\]\[aria-current="true"\]/u.test( + /\[data-thread-item\]|\[data-fork-chrome-row\]|\[data-fork-thread-tabs\]|\[data-fork-sidebar-mode-tabs\]|\[data-fork-model-picker="providers"\] \[data-model-picker-provider\]\[aria-current="true"\]/u.test( rule.selector.replace(/\s+/gu, " "), ); expect(isTokens || isSelectedRow, `not a selected row: "${rule.selector}"`).toBe(true); diff --git a/apps/web/src/__fork_guards__/forkPopupSurface.test.ts b/apps/web/src/__fork_guards__/forkPopupSurface.test.ts index a4c946b2779de..30da73954127a 100644 --- a/apps/web/src/__fork_guards__/forkPopupSurface.test.ts +++ b/apps/web/src/__fork_guards__/forkPopupSurface.test.ts @@ -71,6 +71,15 @@ describe("fork guard: fork-popup-surface", () => { ); }); + it("leaves the composer's context strip bare", () => { + const rule = cssRules(palettes).find( + (candidate) => + candidate.selector.replace(/\s+/gu, " ") === + `${GLASS_GATE} [data-fork-composer-context-row] [data-slot="composer-context-strip"].surface-glass`, + ); + expect(rule?.body).toMatch(/background:\s*none/u); + }); + it("keeps the overlays' floor opaque", () => { // The surface-glass overlays sit over transcript inside #root, where the // popup cutout cannot clear, so their floor must be an opaque rgb() diff --git a/apps/web/src/__fork_guards__/forkStageStamps.test.ts b/apps/web/src/__fork_guards__/forkStageStamps.test.ts index ad0ca5fd95935..c78720f45f897 100644 --- a/apps/web/src/__fork_guards__/forkStageStamps.test.ts +++ b/apps/web/src/__fork_guards__/forkStageStamps.test.ts @@ -229,6 +229,13 @@ const STAMPS: ReadonlyArray<{ ["components/chat/ThreadFindBar.tsx", "ref={forkFindBarRef}"], ], }, + { + stamp: "data-fork-bot-threads-panel", + producers: [ + ["custom/forkStageStamps.ts", 'panelStampRef("data-fork-bot-threads-panel")'], + ["custom/bots/BotThreadsPanel.tsx", "ref={forkBotThreadsPanelRef}"], + ], + }, { stamp: "data-fork-morph-failed", producers: [["custom/inletMenuMorph.ts", 'trigger.dataset.forkMorphFailed = ""']], diff --git a/apps/web/src/custom/bots/BotThreadsPanel.tsx b/apps/web/src/custom/bots/BotThreadsPanel.tsx index dec1afe19bb24..c7ba322dc19ad 100644 --- a/apps/web/src/custom/bots/BotThreadsPanel.tsx +++ b/apps/web/src/custom/bots/BotThreadsPanel.tsx @@ -27,6 +27,7 @@ import { buildThreadRouteParams } from "~/threadRoutes"; import { formatRelativeTimeLabel } from "~/timestampFormat"; import { useUiStateStore } from "~/uiStateStore"; +import { forkBotThreadsPanelRef } from "../forkStageStamps"; import { SidebarV2SectionLabel } from "../SidebarV2SectionLabel"; import { SidebarV2StatusMark } from "../SidebarV2StatusIndicator"; import { SidebarV2CheckoutMark } from "../SidebarV2ThreadCardMeta"; @@ -153,6 +154,7 @@ function BotThreadsBody(props: { isElectron && "drag-region", isElectron && props.rightmost && "wco:pr-(--workspace-native-controls-inset)", )} + ref={forkBotThreadsPanelRef} data-fork-bot-threads-header="" // BOT_THREADS_PANEL_BOT_ATTRIBUTE and BOT_THREADS_PANEL_THREAD_ATTRIBUTE (the store reads them). data-fork-bot-threads-bot={botKey} diff --git a/apps/web/src/custom/forkStageStamps.ts b/apps/web/src/custom/forkStageStamps.ts index d88b33ab4aa5e..26cd53c08626b 100644 --- a/apps/web/src/custom/forkStageStamps.ts +++ b/apps/web/src/custom/forkStageStamps.ts @@ -42,6 +42,19 @@ function columnStampRef(attribute: string) { export const forkDockedDetailsRef = columnStampRef("data-fork-has-docked-details"); export const forkFindBarRef = columnStampRef("data-fork-has-find-bar"); +/** A stable ref that stamps its element's workspace panel with `attribute` while mounted. */ +function panelStampRef(attribute: string) { + return (element: HTMLElement | null) => { + const panel = element?.closest("[data-preview-panel-mode]"); + if (!panel) return; + panel.setAttribute(attribute, ""); + return () => panel.removeAttribute(attribute); + }; +} + +/** The petal Threads panel (fork-bot-work-threads), a list where every other panel is read. */ +export const forkBotThreadsPanelRef = panelStampRef("data-fork-bot-threads-panel"); + /** The stage-card pages' card (the guard lists its producers). */ export const forkStageCardRef = rootStampRef("data-fork-has-stage-card"); export const forkThreadTabsRef = rootStampRef("data-fork-has-thread-tabs"); diff --git a/apps/web/src/theme.custom.glass-stage.css b/apps/web/src/theme.custom.glass-stage.css index 6958e67ba7845..7039cb4676115 100644 --- a/apps/web/src/theme.custom.glass-stage.css +++ b/apps/web/src/theme.custom.glass-stage.css @@ -301,6 +301,15 @@ linear-gradient(rgb(var(--fork-glass-tint) / var(--fork-glass-card-alpha)) 0 100%); } + /* The petal Threads panel is a thread list like the sidebar, not a reading + surface, so it takes neither: it reads at the gutter's alpha, which is + the sidebar's. */ + &[data-fork-sidebar-vibrancy="true"].dark[data-fork-theme="cool-darker"][data-fork-has-chat-column] + [data-slot="sidebar-inset"] + [data-preview-panel-mode="inline"][data-fork-bot-threads-panel] { + background-image: none; + } + /* Beside a docked sidebar the card stands 3px off it rather than 8px, and the sidebar's groups give up their right padding, so a row's space to the card comes as near the 8px it keeps from the window as the layout allows: diff --git a/apps/web/src/theme.custom.glass-surfaces.css b/apps/web/src/theme.custom.glass-surfaces.css index 1df4abd7ade8c..2dce62a83c39b 100644 --- a/apps/web/src/theme.custom.glass-surfaces.css +++ b/apps/web/src/theme.custom.glass-surfaces.css @@ -321,6 +321,44 @@ padding-inline: 4px; } + /* The music strip (fork-music-panel) is a card on the panel: the popups' + halo, sheens and glint ring over its own drop shadow. Its open button + takes the chips' rim, so the two still read as one piece. */ + &.dark[data-fork-theme="cool-darker"] [data-slot="sidebar-footer"] { + & [data-fork-music-strip] { + position: relative; + box-shadow: + 0 12px 32px -18px rgb(0 0 0 / 45%), + var(--fork-glass-halo), + var(--fork-glass-sheen); + } + + & [data-fork-music-strip]::before { + content: ""; + position: absolute; + inset: 0; + z-index: 2; + padding: 0.5px; + border-radius: inherit; + background: linear-gradient( + to bottom, + rgb(255 255 255 / 22%), + rgb(255 255 255 / 0%) 8px calc(100% - 8px), + rgb(255 255 255 / 10%) + ); + mask: + linear-gradient(#000 0 0) content-box exclude, + linear-gradient(#000 0 0); + pointer-events: none; + } + + & [data-fork-music-toggle][aria-pressed="true"] { + box-shadow: + var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), + var(--fork-glass-rim); + } + } + /* The popups the chips open and the composer's model, effort and mode menus: every composer popup carries data-chat-composer-floating-layer (useComposerMenuProps), and the fork's own popups that are not composer @@ -782,6 +820,49 @@ } /* fork:end fork-collapsed-thread-tabs */ + /* The sidebar's Code / Chat switch (fork-chat-mode): its chosen mode is a + selected item too, so it wears the same selected glass in place of its + own sidebar fill and opaque border, which read as a dark disc. The extra + marker outranks the SegmentedTab rule above. */ + &.dark[data-fork-theme="cool-darker"] + [data-fork-sidebar-mode-tabs] + [data-fork-segmented-tab][data-pressed] { + position: relative; + border-color: transparent; + background-color: var(--sidebar-row-active); + box-shadow: + var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), + var(--fork-glass-selected-shadow); + + &::before { + content: ""; + position: absolute; + inset: -1px; + border-radius: inherit; + box-shadow: var(--fork-glass-selected-glint); + pointer-events: none; + } + + &::after { + content: ""; + position: absolute; + inset: -2px; + padding: 1px; + border-radius: inherit; + background: var(--fork-glass-dark-edge); + mask: + linear-gradient(#000 0 0) content-box exclude, + linear-gradient(#000 0 0); + pointer-events: none; + } + } + + &[data-fork-sidebar-vibrancy="true"].dark[data-fork-theme="cool-darker"] + [data-fork-sidebar-mode-tabs] + [data-fork-segmented-tab][data-pressed] { + background-color: rgb(255 255 255 / 6%); + } + /* fork:begin fork-model-picker — see .fork/customizations.yaml#fork-model-picker The model picker's rail tab for the open scope is a selected item, so it wears the selected rows' glass at Selected items only too, its dark edge diff --git a/apps/web/src/theme.custom.palettes.css b/apps/web/src/theme.custom.palettes.css index d62174d493b6a..178243364a5de 100644 --- a/apps/web/src/theme.custom.palettes.css +++ b/apps/web/src/theme.custom.palettes.css @@ -279,7 +279,7 @@ circle — rests on the quiet ink instead of the panel's #8a8a8a, so the labels, marks, carets and icon buttons tint with the surface under them. This is an allowlist: anything not named here or below keeps the opaque - ink. + ink. The Bots row is the Projects row's twin, so it rests on the same ink. The derived token, not --muted-foreground: index.css computes --contrast-muted-foreground on [data-app-sidebar] and a descendant inherits @@ -289,6 +289,7 @@ [data-sidebar-version="v2"] :is( [data-fork-projects-row], + [data-fork-bots-row], [data-fork-project-section-header], [data-fork-status-section-header], [data-fork-thread-card-meta], @@ -1570,6 +1571,15 @@ border-color: rgb(255 255 255 / 8%); } +/* The composer's context strip is surface-glass too (upstream #34846), but the + cutoff ends the transcript above it, so here it stays bare: the opaque fill + painted a band behind the chips. */ +:root[data-fork="noahhendrickson-t3code"][data-fork-sidebar-vibrancy="true"].dark[data-fork-theme="cool-darker"] + [data-fork-composer-context-row] + [data-slot="composer-context-strip"].surface-glass { + background: none; +} + :root[data-fork="noahhendrickson-t3code"][data-fork-sidebar-vibrancy="true"].dark[data-fork-theme="cool-darker"] button.surface-glass:is(:hover, [data-pressed]) { background: @@ -1797,6 +1807,19 @@ --accent: rgb(255 255 255 / 8%); } +/* The music strip and its open button (fork-music-panel) mix their fill from + --sidebar, which here is the translucent panel: the mix landed as a flat + grey slab over the material. They take the row washes' white instead, so + the wallpaper carries through like every other pane on the panel. */ +:root[data-fork="noahhendrickson-t3code"][data-fork-sidebar-vibrancy="true"].dark[data-fork-theme="cool-darker"] + [data-slot="sidebar-footer"] { + --fork-music-card: rgb(255 255 255 / 6%); + + & [data-fork-music-strip] { + --fork-music-step: rgb(255 255 255 / 8%); + } +} + /* The pinned divider and the Working / Settled shelf rules break the opaque divider rule above, by request. At 60% the opaque #3f3f3f lands as a dark bar over the glass; a short interior rule does not run long enough for the From 5a68fb8bde7f2a0eac3eba453fb482fc91733722 Mon Sep 17 00:00:00 2001 From: x Date: Sun, 15 Nov 2026 12:20:48 -0500 Subject: [PATCH 3/7] refactor(web): answer the review on Glass surfaces and the Done celebration - The Code / Chat switch joins the collapsed tabs' selected-glass rules instead of copying them, and its track gives the halo room under Selected items only, where it was clipped. - The music strip wears the chips' rim instead of a copy of the popups' glint ring. - The celebration hook takes the typed status, measures only once a Working -> Done is waiting, and leaves the rings' look to CSS. - One closestStampRef serves the column and panel stamps. Co-Authored-By: Claude Opus 5.5 --- .fork/customizations.yaml | 5 +- .../__fork_guards__/forkStageStamps.test.ts | 2 +- .../src/custom/SidebarV2StatusIndicator.tsx | 7 +- apps/web/src/custom/doneCelebration.test.ts | 30 ++---- apps/web/src/custom/doneCelebration.ts | 63 ++++++++----- apps/web/src/custom/forkStageStamps.ts | 33 +++---- apps/web/src/theme.custom.css | 19 ++++ apps/web/src/theme.custom.glass-surfaces.css | 93 +++++-------------- 8 files changed, 112 insertions(+), 140 deletions(-) diff --git a/.fork/customizations.yaml b/.fork/customizations.yaml index 5a80b2267f463..4dd4baddb1134 100644 --- a/.fork/customizations.yaml +++ b/.fork/customizations.yaml @@ -7435,12 +7435,13 @@ celebrates once, in every theme: two rings in the Done dot's colour pulse off it, and a petal's mascot in the same row gives one small hop. The transition is remembered per thread across remounts (a finished row moves - out of the Working group), but only briefly, so a row scrolled away while - working that comes back Done stays still. Reduced motion skips it. + out of the Working group), but only briefly, so a row unmounted while + working (a folded section) that comes back Done stays still. Reduced motion skips it. tier: 1 files: - apps/web/src/custom/doneCelebration.ts - apps/web/src/custom/SidebarV2StatusIndicator.tsx + - apps/web/src/theme.custom.css shadows: [] watch: [] verify: diff --git a/apps/web/src/__fork_guards__/forkStageStamps.test.ts b/apps/web/src/__fork_guards__/forkStageStamps.test.ts index c78720f45f897..e87ccd7063dd1 100644 --- a/apps/web/src/__fork_guards__/forkStageStamps.test.ts +++ b/apps/web/src/__fork_guards__/forkStageStamps.test.ts @@ -232,7 +232,7 @@ const STAMPS: ReadonlyArray<{ { stamp: "data-fork-bot-threads-panel", producers: [ - ["custom/forkStageStamps.ts", 'panelStampRef("data-fork-bot-threads-panel")'], + ["custom/forkStageStamps.ts", '"data-fork-bot-threads-panel",'], ["custom/bots/BotThreadsPanel.tsx", "ref={forkBotThreadsPanelRef}"], ], }, diff --git a/apps/web/src/custom/SidebarV2StatusIndicator.tsx b/apps/web/src/custom/SidebarV2StatusIndicator.tsx index cf20e59504e47..c99347a8cac4f 100644 --- a/apps/web/src/custom/SidebarV2StatusIndicator.tsx +++ b/apps/web/src/custom/SidebarV2StatusIndicator.tsx @@ -458,6 +458,7 @@ export type SidebarV2TopStatusMark = /** One mark renderer for card and slim rows so monitoring is never a second path. */ export function SidebarV2StatusMark(props: { readonly status: SidebarV2TopStatusMark | null; + /** The rain's phase, and the Done celebration's key: rows pass their scoped thread key. */ readonly seed: string; /** Card rows draw the idle dot; without one an idle mark draws nothing. Unpromoted drafts use the pencil as their idle glyph. */ @@ -468,11 +469,7 @@ export function SidebarV2StatusMark(props: { }) { const status = props.status; const dot = useRef(null); - useDoneCelebration( - props.seed, - status === null ? "idle" : status.mark === "dot" ? status.tone : status.mark, - dot, - ); + useDoneCelebration(props.seed, status, dot); if (status === null) { if (props.idle === "draft") { return ( diff --git a/apps/web/src/custom/doneCelebration.test.ts b/apps/web/src/custom/doneCelebration.test.ts index fe979531f253b..19a37b92b84e8 100644 --- a/apps/web/src/custom/doneCelebration.test.ts +++ b/apps/web/src/custom/doneCelebration.test.ts @@ -3,38 +3,26 @@ import { describe, expect, it } from "vite-plus/test"; import { createDoneTransitions } from "./doneCelebration"; describe("createDoneTransitions", () => { - it("celebrates a Done that just followed Working, once", () => { + it("sees a Done that just followed Working, once", () => { const transitions = createDoneTransitions(); transitions.enter("a", "working", 0); - // The row sat Working for a minute; its mark leaves Working as it turns Done. + // The row sat Working for a minute; its mark leaves Working as it turns Done, or as the + // finished row unmounts from the Working group. transitions.leave("a", "working", 60_000); - expect(transitions.enter("a", "done", 60_000)).toBe(true); + expect(transitions.leftWorking("a", 60_016)).toBe(true); + transitions.enter("a", "done", 60_016); // A second copy of the same thread's mark finds the transition taken. - expect(transitions.enter("a", "done", 60_010)).toBe(false); - }); - - it("celebrates across a remount, when the finished row moves group", () => { - const transitions = createDoneTransitions(); - transitions.enter("a", "working", 0); - transitions.leave("a", "working", 60_000); - expect(transitions.enter("a", "done", 60_016)).toBe(true); + expect(transitions.leftWorking("a", 60_020)).toBe(false); }); it("stays still for a row unmounted while Working (a folded section) that comes back Done", () => { const transitions = createDoneTransitions(); transitions.enter("a", "working", 0); transitions.leave("a", "working", 1_000); - expect(transitions.enter("a", "done", 120_000)).toBe(false); - }); - - it.each(["idle", "approval", "failed"])("does not celebrate Working turning %s", (kind) => { - const transitions = createDoneTransitions(); - transitions.enter("a", "working", 0); - transitions.leave("a", "working", 0); - expect(transitions.enter("a", kind, 0)).toBe(false); + expect(transitions.leftWorking("a", 120_000)).toBe(false); }); - it("does not celebrate a thread first seen Done", () => { - expect(createDoneTransitions().enter("a", "done", 0)).toBe(false); + it("does not see a thread first seen Done", () => { + expect(createDoneTransitions().leftWorking("a", 0)).toBe(false); }); }); diff --git a/apps/web/src/custom/doneCelebration.ts b/apps/web/src/custom/doneCelebration.ts index 9ca866507dc15..e4d1c0cf8ae9d 100644 --- a/apps/web/src/custom/doneCelebration.ts +++ b/apps/web/src/custom/doneCelebration.ts @@ -4,46 +4,65 @@ */ import { type RefObject, useEffect } from "react"; +import type { SidebarV2TopStatusMark } from "./SidebarV2StatusIndicator"; + /** How long after a mark last showed Working a Done still counts as that thread finishing. */ const FRESH_MS = 1500; +type MarkKind = "working" | "done" | "other"; + /** * Each thread's last mark, outliving the row that drew it: a finished thread moves out of the * Working group, so the row showing Done is often a fresh mount. Leaving a mark stamps it, so a - * row scrolled away long ago that comes back Done is stale and stays still. + * row unmounted long ago that comes back Done is stale and stays still. */ export function createDoneTransitions() { - const seen = new Map(); + const seen = new Map(); return { - /** Record `kind` for `seed`; true when it is a Done that just followed Working. */ - enter(seed: string, kind: string, now: number): boolean { - const previous = seen.get(seed); - seen.set(seed, { kind, at: now }); - return kind === "done" && previous?.kind === "working" && now - previous.at <= FRESH_MS; + /** Whether `key` left Working just now, so a Done mark for it is that thread finishing. */ + leftWorking(key: string, now: number): boolean { + const previous = seen.get(key); + return previous?.kind === "working" && now - previous.at <= FRESH_MS; + }, + enter(key: string, kind: MarkKind, now: number) { + seen.set(key, { kind, at: now }); }, - leave(seed: string, kind: string, now: number) { - if (seen.get(seed)?.kind === kind) seen.set(seed, { kind, at: now }); + leave(key: string, kind: MarkKind, now: number) { + if (seen.get(key)?.kind === kind) seen.set(key, { kind, at: now }); }, }; } const transitions = createDoneTransitions(); -/** Plays the celebration on `dot` when `seed`'s mark turns from Working to Done. */ -export function useDoneCelebration(seed: string, kind: string, dot: RefObject) { +/** Plays the celebration on `dot` when the mark keyed `threadKey` turns from Working to Done. */ +export function useDoneCelebration( + threadKey: string, + status: SidebarV2TopStatusMark | null, + dot: RefObject, +) { + const kind: MarkKind = + status?.mark === "working" + ? "working" + : status?.mark === "dot" && status.tone === "done" + ? "done" + : "other"; // oxlint-disable-next-line t3code/no-unreasoned-state-sync -- animates the DOM when the mark's status changes, keyed across remounts useEffect(() => { const element = dot.current; + const now = performance.now(); + const finished = kind === "done" && transitions.leftWorking(threadKey, now); // A hidden copy (a collapsed tab while the sidebar is open) must not take the transition - // from the copy on screen. - if (kind !== "done" || (element !== null && isOnScreen(element))) { - if (transitions.enter(seed, kind, performance.now()) && element !== null) { + // from the copy on screen. Measured only once a transition is waiting. + if (!finished || (element !== null && isOnScreen(element))) { + transitions.enter(threadKey, kind, now); + if (finished && element !== null) { const row = element.closest("[data-thread-item], [data-fork-thread-tab]"); celebrateDone(element, row?.querySelector("svg[data-fork-bot-mascot]") ?? null); } } - return () => transitions.leave(seed, kind, performance.now()); - }, [seed, kind, dot]); + return () => transitions.leave(threadKey, kind, performance.now()); + }, [threadKey, kind, dot]); } /** Drawn, and its centre inside every box that clips it: the rings sit on the page, above the clips. */ @@ -61,6 +80,7 @@ function isOnScreen(element: HTMLElement): boolean { return true; } +/** The rings' look is in theme.custom.css ([data-fork-done-ring]). */ function celebrateDone(dot: HTMLElement, mascot: SVGElement | null) { if (matchMedia("(prefers-reduced-motion: reduce)").matches) return; @@ -69,20 +89,13 @@ function celebrateDone(dot: HTMLElement, mascot: SVGElement | null) { const color = getComputedStyle(dot).backgroundColor; for (const [index, delay] of [0, 320].entries()) { const ring = document.createElement("div"); + ring.setAttribute("data-fork-done-ring", index === 0 ? "flash" : ""); + ring.style.setProperty("--fork-done-ring-color", color); Object.assign(ring.style, { - position: "fixed", left: `${box.left}px`, top: `${box.top + box.height / 2 - box.width / 2}px`, width: `${box.width}px`, height: `${box.width}px`, - borderRadius: "50%", - border: `2px solid ${color}`, - boxSizing: "border-box", - // The first ring carries a faint fill, so the pulse reads as a flash, not just a line. - background: index === 0 ? `color-mix(in srgb, ${color} 22%, transparent)` : "transparent", - pointerEvents: "none", - zIndex: "2147483000", - opacity: "0", }); document.documentElement.append(ring); ring.animate( diff --git a/apps/web/src/custom/forkStageStamps.ts b/apps/web/src/custom/forkStageStamps.ts index 26cd53c08626b..493034feb116c 100644 --- a/apps/web/src/custom/forkStageStamps.ts +++ b/apps/web/src/custom/forkStageStamps.ts @@ -29,31 +29,28 @@ function rootStampRef(attribute: string) { return (element: HTMLElement | null) => (element === null ? undefined : retain(attribute)); } -/** A stable ref that stamps its element's chat column with `attribute` while mounted. */ -function columnStampRef(attribute: string) { +/** A stable ref that stamps the closest `selector` around its element with `attribute` while mounted. */ +function closestStampRef(selector: string, attribute: string) { return (element: HTMLElement | null) => { - const column = element?.closest("[data-chat-column]"); - if (!column) return; - column.setAttribute(attribute, ""); - return () => column.removeAttribute(attribute); + const target = element?.closest(selector); + if (!target) return; + target.setAttribute(attribute, ""); + return () => target.removeAttribute(attribute); }; } +const columnStampRef = (attribute: string) => closestStampRef("[data-chat-column]", attribute); + export const forkDockedDetailsRef = columnStampRef("data-fork-has-docked-details"); export const forkFindBarRef = columnStampRef("data-fork-has-find-bar"); -/** A stable ref that stamps its element's workspace panel with `attribute` while mounted. */ -function panelStampRef(attribute: string) { - return (element: HTMLElement | null) => { - const panel = element?.closest("[data-preview-panel-mode]"); - if (!panel) return; - panel.setAttribute(attribute, ""); - return () => panel.removeAttribute(attribute); - }; -} - -/** The petal Threads panel (fork-bot-work-threads), a list where every other panel is read. */ -export const forkBotThreadsPanelRef = panelStampRef("data-fork-bot-threads-panel"); +/** The petal Threads panel (fork-bot-work-threads), a list where every other panel is read. + BotThreadsPanel renders that shell itself, but it is upstream's PreviewPanelShell, so the + panel's header tags it. */ +export const forkBotThreadsPanelRef = closestStampRef( + "[data-preview-panel-mode]", + "data-fork-bot-threads-panel", +); /** The stage-card pages' card (the guard lists its producers). */ export const forkStageCardRef = rootStampRef("data-fork-has-stage-card"); diff --git a/apps/web/src/theme.custom.css b/apps/web/src/theme.custom.css index 42768e0ff1939..76c1a940b6d5d 100644 --- a/apps/web/src/theme.custom.css +++ b/apps/web/src/theme.custom.css @@ -3038,3 +3038,22 @@ display: none; } } + +/* fork:begin fork-done-celebration — see .fork/customizations.yaml#fork-done-celebration + The rings a finished thread's Done dot pulses (custom/doneCelebration.ts), on the page so no + clip cuts them and above every layer; the script places, colours and animates each. The first + ring carries a faint fill, so the pulse reads as a flash, not just a line. */ +:root[data-fork="noahhendrickson-t3code"] > [data-fork-done-ring] { + position: fixed; + z-index: 2147483000; + box-sizing: border-box; + border: 2px solid var(--fork-done-ring-color); + border-radius: 50%; + opacity: 0; + pointer-events: none; +} + +:root[data-fork="noahhendrickson-t3code"] > [data-fork-done-ring="flash"] { + background: color-mix(in srgb, var(--fork-done-ring-color) 22%, transparent); +} +/* fork:end fork-done-celebration */ diff --git a/apps/web/src/theme.custom.glass-surfaces.css b/apps/web/src/theme.custom.glass-surfaces.css index 2dce62a83c39b..778b914eefab1 100644 --- a/apps/web/src/theme.custom.glass-surfaces.css +++ b/apps/web/src/theme.custom.glass-surfaces.css @@ -321,35 +321,14 @@ padding-inline: 4px; } - /* The music strip (fork-music-panel) is a card on the panel: the popups' - halo, sheens and glint ring over its own drop shadow. Its open button - takes the chips' rim, so the two still read as one piece. */ + /* The music strip (fork-music-panel) and its open button wear the chips' + rim, the strip over its own drop shadow, so the two read as one piece. + Neither has a border, so the rim's inset light lands on the edge. */ &.dark[data-fork-theme="cool-darker"] [data-slot="sidebar-footer"] { & [data-fork-music-strip] { - position: relative; box-shadow: 0 12px 32px -18px rgb(0 0 0 / 45%), - var(--fork-glass-halo), - var(--fork-glass-sheen); - } - - & [data-fork-music-strip]::before { - content: ""; - position: absolute; - inset: 0; - z-index: 2; - padding: 0.5px; - border-radius: inherit; - background: linear-gradient( - to bottom, - rgb(255 255 255 / 22%), - rgb(255 255 255 / 0%) 8px calc(100% - 8px), - rgb(255 255 255 / 10%) - ); - mask: - linear-gradient(#000 0 0) content-box exclude, - linear-gradient(#000 0 0); - pointer-events: none; + var(--fork-glass-rim); } & [data-fork-music-toggle][aria-pressed="true"] { @@ -732,9 +711,10 @@ The collapsed sidebar's tab row: the open thread's tab and the chosen project wear the selected thread card's glass, not the generic segmented chip, so the row reads as the sidebar's list laid sideways. The extra - marker outranks the SegmentedTab rule above. */ + marker outranks the SegmentedTab rule above. The Code / Chat + switch's chosen mode is a selected item too, so the rules take it as well. */ &.dark[data-fork-theme="cool-darker"] - [data-fork-thread-tabs] + :is([data-fork-thread-tabs], [data-fork-sidebar-mode-tabs]) :is([data-fork-thread-tab][data-active="true"], [data-fork-segmented-tab][data-pressed]) { position: relative; background-color: var(--sidebar-row-active); @@ -744,7 +724,7 @@ } &.dark[data-fork-theme="cool-darker"] - [data-fork-thread-tabs] + :is([data-fork-thread-tabs], [data-fork-sidebar-mode-tabs]) :is( [data-fork-thread-tab][data-active="true"], [data-fork-segmented-tab][data-pressed] @@ -758,7 +738,7 @@ } &.dark[data-fork-theme="cool-darker"] - [data-fork-thread-tabs] + :is([data-fork-thread-tabs], [data-fork-sidebar-mode-tabs]) :is( [data-fork-thread-tab][data-active="true"], [data-fork-segmented-tab][data-pressed] @@ -777,7 +757,7 @@ /* Figma's 6% white, under real glass only. */ &[data-fork-sidebar-vibrancy="true"].dark[data-fork-theme="cool-darker"] - [data-fork-thread-tabs] + :is([data-fork-thread-tabs], [data-fork-sidebar-mode-tabs]) :is([data-fork-thread-tab][data-active="true"], [data-fork-segmented-tab][data-pressed]) { background-color: rgb(255 255 255 / 6%); } @@ -820,47 +800,24 @@ } /* fork:end fork-collapsed-thread-tabs */ - /* The sidebar's Code / Chat switch (fork-chat-mode): its chosen mode is a - selected item too, so it wears the same selected glass in place of its - own sidebar fill and opaque border, which read as a dark disc. The extra - marker outranks the SegmentedTab rule above. */ - &.dark[data-fork-theme="cool-darker"] - [data-fork-sidebar-mode-tabs] - [data-fork-segmented-tab][data-pressed] { - position: relative; - border-color: transparent; - background-color: var(--sidebar-row-active); - box-shadow: - var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), - var(--fork-glass-selected-shadow); + /* The sidebar's Code / Chat switch (fork-chat-mode) shares that selected glass + (above). Its tab keeps a 1px border, transparent here in place of its opaque + one, so the glint and the dark edge step out onto the border box. Its track + is the tab's own height and clips, so it gives the halo room to show. */ + &.dark[data-fork-theme="cool-darker"] [data-fork-sidebar-mode-tabs] { + overflow-clip-margin: 3px; - &::before { - content: ""; - position: absolute; - inset: -1px; - border-radius: inherit; - box-shadow: var(--fork-glass-selected-glint); - pointer-events: none; - } + & [data-fork-segmented-tab][data-pressed] { + border-color: transparent; - &::after { - content: ""; - position: absolute; - inset: -2px; - padding: 1px; - border-radius: inherit; - background: var(--fork-glass-dark-edge); - mask: - linear-gradient(#000 0 0) content-box exclude, - linear-gradient(#000 0 0); - pointer-events: none; - } - } + &::before { + inset: -1px; + } - &[data-fork-sidebar-vibrancy="true"].dark[data-fork-theme="cool-darker"] - [data-fork-sidebar-mode-tabs] - [data-fork-segmented-tab][data-pressed] { - background-color: rgb(255 255 255 / 6%); + &::after { + inset: -2px; + } + } } /* fork:begin fork-model-picker — see .fork/customizations.yaml#fork-model-picker From d503238ead3ed068b9f58422380be7bbf422c22c Mon Sep 17 00:00:00 2001 From: x Date: Sun, 15 Nov 2026 12:38:41 -0500 Subject: [PATCH 4/7] fix(web): every Glass right panel reads like the sidebar The right panels beside the chat card (browser, terminal, files, diff, the petal Threads list) no longer add the card's tint and wash, so they read at the gutter's alpha, the sidebar's. The petal panel's stamp only existed to exempt it from that tint, so it goes too. The embedded side chat relied on the panel's tint, so its card paints its own fill again. Co-Authored-By: Claude Opus 5.5 --- .../forkGlassStageCard.test.ts | 21 ++++++----- .../__fork_guards__/forkStageStamps.test.ts | 7 ---- apps/web/src/custom/bots/BotThreadsPanel.tsx | 2 - apps/web/src/custom/forkStageStamps.ts | 22 +++-------- apps/web/src/theme.custom.glass-stage.css | 37 ++----------------- 5 files changed, 20 insertions(+), 69 deletions(-) diff --git a/apps/web/src/__fork_guards__/forkGlassStageCard.test.ts b/apps/web/src/__fork_guards__/forkGlassStageCard.test.ts index 2c91a7ea07061..d38939b477661 100644 --- a/apps/web/src/__fork_guards__/forkGlassStageCard.test.ts +++ b/apps/web/src/__fork_guards__/forkGlassStageCard.test.ts @@ -116,16 +116,17 @@ describe("fork guard: fork-glass-stage-card", () => { expect(Math.abs(composite - stage)).toBeLessThanOrEqual(1); }); - it("paints an embedded side chat's material once, from the right panel", () => { - // The card rules would add a second tint and wash over the panel's own. - const nested = rules.find( - (rule) => - rule.selector.includes(VIBRANCY) && - compact(rule.selector).endsWith(`[data-side-chat-pane]${CHAT}::before`), - ); - expect(flat(nested?.body)).toBe("background: none;"); - const ramp = rules.findIndex((rule) => rule.selector.includes(":has(.fork-timeline-cutoff)")); - expect(rules.indexOf(nested!)).toBeGreaterThan(ramp); + it("paints an embedded side chat's material once, from its own card", () => { + // The right panels read at the gutter's alpha, like the sidebar, so they paint no tint + // of their own, and the side chat's card keeps the card's fill. + expect( + rules.filter( + (rule) => + rule.selector.includes('[data-preview-panel-mode="inline"]') && + rule.body.includes("background"), + ), + ).toEqual([]); + expect(rules.filter((rule) => rule.selector.includes("[data-side-chat-pane]"))).toEqual([]); }); it("dithers the stage ramp, or it bands under the desktop glass", () => { diff --git a/apps/web/src/__fork_guards__/forkStageStamps.test.ts b/apps/web/src/__fork_guards__/forkStageStamps.test.ts index e87ccd7063dd1..ad0ca5fd95935 100644 --- a/apps/web/src/__fork_guards__/forkStageStamps.test.ts +++ b/apps/web/src/__fork_guards__/forkStageStamps.test.ts @@ -229,13 +229,6 @@ const STAMPS: ReadonlyArray<{ ["components/chat/ThreadFindBar.tsx", "ref={forkFindBarRef}"], ], }, - { - stamp: "data-fork-bot-threads-panel", - producers: [ - ["custom/forkStageStamps.ts", '"data-fork-bot-threads-panel",'], - ["custom/bots/BotThreadsPanel.tsx", "ref={forkBotThreadsPanelRef}"], - ], - }, { stamp: "data-fork-morph-failed", producers: [["custom/inletMenuMorph.ts", 'trigger.dataset.forkMorphFailed = ""']], diff --git a/apps/web/src/custom/bots/BotThreadsPanel.tsx b/apps/web/src/custom/bots/BotThreadsPanel.tsx index c7ba322dc19ad..dec1afe19bb24 100644 --- a/apps/web/src/custom/bots/BotThreadsPanel.tsx +++ b/apps/web/src/custom/bots/BotThreadsPanel.tsx @@ -27,7 +27,6 @@ import { buildThreadRouteParams } from "~/threadRoutes"; import { formatRelativeTimeLabel } from "~/timestampFormat"; import { useUiStateStore } from "~/uiStateStore"; -import { forkBotThreadsPanelRef } from "../forkStageStamps"; import { SidebarV2SectionLabel } from "../SidebarV2SectionLabel"; import { SidebarV2StatusMark } from "../SidebarV2StatusIndicator"; import { SidebarV2CheckoutMark } from "../SidebarV2ThreadCardMeta"; @@ -154,7 +153,6 @@ function BotThreadsBody(props: { isElectron && "drag-region", isElectron && props.rightmost && "wco:pr-(--workspace-native-controls-inset)", )} - ref={forkBotThreadsPanelRef} data-fork-bot-threads-header="" // BOT_THREADS_PANEL_BOT_ATTRIBUTE and BOT_THREADS_PANEL_THREAD_ATTRIBUTE (the store reads them). data-fork-bot-threads-bot={botKey} diff --git a/apps/web/src/custom/forkStageStamps.ts b/apps/web/src/custom/forkStageStamps.ts index 493034feb116c..d88b33ab4aa5e 100644 --- a/apps/web/src/custom/forkStageStamps.ts +++ b/apps/web/src/custom/forkStageStamps.ts @@ -29,29 +29,19 @@ function rootStampRef(attribute: string) { return (element: HTMLElement | null) => (element === null ? undefined : retain(attribute)); } -/** A stable ref that stamps the closest `selector` around its element with `attribute` while mounted. */ -function closestStampRef(selector: string, attribute: string) { +/** A stable ref that stamps its element's chat column with `attribute` while mounted. */ +function columnStampRef(attribute: string) { return (element: HTMLElement | null) => { - const target = element?.closest(selector); - if (!target) return; - target.setAttribute(attribute, ""); - return () => target.removeAttribute(attribute); + const column = element?.closest("[data-chat-column]"); + if (!column) return; + column.setAttribute(attribute, ""); + return () => column.removeAttribute(attribute); }; } -const columnStampRef = (attribute: string) => closestStampRef("[data-chat-column]", attribute); - export const forkDockedDetailsRef = columnStampRef("data-fork-has-docked-details"); export const forkFindBarRef = columnStampRef("data-fork-has-find-bar"); -/** The petal Threads panel (fork-bot-work-threads), a list where every other panel is read. - BotThreadsPanel renders that shell itself, but it is upstream's PreviewPanelShell, so the - panel's header tags it. */ -export const forkBotThreadsPanelRef = closestStampRef( - "[data-preview-panel-mode]", - "data-fork-bot-threads-panel", -); - /** The stage-card pages' card (the guard lists its producers). */ export const forkStageCardRef = rootStampRef("data-fork-has-stage-card"); export const forkThreadTabsRef = rootStampRef("data-fork-has-thread-tabs"); diff --git a/apps/web/src/theme.custom.glass-stage.css b/apps/web/src/theme.custom.glass-stage.css index 7039cb4676115..c081e250de13f 100644 --- a/apps/web/src/theme.custom.glass-stage.css +++ b/apps/web/src/theme.custom.glass-stage.css @@ -157,15 +157,6 @@ ); } - /* Upstream's embedded side chat sits in the right panel, which already supplies the - card's tint and wash (below), so its own card paints no fill. After the ramp, which - it matches in weight. */ - &[data-fork-sidebar-vibrancy="true"].dark[data-fork-theme="cool-darker"] - [data-side-chat-pane] - [data-chat-column-maximized-away]::before { - background: none; - } - /* The gutter: the inset round a chat view takes the panel's fill. Two rules because the two clients paint it differently — an opaque colour, or a gradient over the inset the vibrancy block has already cleared. Settings, @@ -253,8 +244,9 @@ below the window's top. */ &.dark[data-fork-theme="cool-darker"] { --fork-thread-tabs-overlap: var(--fork-glass-card-inset); - /* The white wash that lifts the card level with the panel; the right - panel beside the card takes it too. */ + /* The white wash that lifts the card level with the panel. The right panels + beside the card take neither it nor the card's tint, by request: they + read at the gutter's alpha, which is the sidebar's. */ --fork-glass-card-wash: rgb(255 255 255 / 4%); } @@ -287,29 +279,6 @@ background: none; } - /* The right panel sits in the gutter beside the card, not on it, so under - the desktop glass it would read at the gutter's alpha: below the reading - value text panels keep. It adds the card's alpha of the same tint and - composites back to the stage's, and the card's wash so it reads level - with the card beside it. As an image, under the vibrancy block's clear of - its colour. */ - &[data-fork-sidebar-vibrancy="true"].dark[data-fork-theme="cool-darker"][data-fork-has-chat-column] - [data-slot="sidebar-inset"] - [data-preview-panel-mode="inline"] { - background-image: - linear-gradient(var(--fork-glass-card-wash) 0 100%), - linear-gradient(rgb(var(--fork-glass-tint) / var(--fork-glass-card-alpha)) 0 100%); - } - - /* The petal Threads panel is a thread list like the sidebar, not a reading - surface, so it takes neither: it reads at the gutter's alpha, which is - the sidebar's. */ - &[data-fork-sidebar-vibrancy="true"].dark[data-fork-theme="cool-darker"][data-fork-has-chat-column] - [data-slot="sidebar-inset"] - [data-preview-panel-mode="inline"][data-fork-bot-threads-panel] { - background-image: none; - } - /* Beside a docked sidebar the card stands 3px off it rather than 8px, and the sidebar's groups give up their right padding, so a row's space to the card comes as near the 8px it keeps from the window as the layout allows: From 6663c612032397a54a7c2130fc11fcd37cc68a45 Mon Sep 17 00:00:00 2001 From: x Date: Sun, 15 Nov 2026 12:55:55 -0500 Subject: [PATCH 5/7] fix(web): Inlet's rightmost open tab flares onto the panel, not past it The tab strip ended at the window gutter, so the last tab's outer flare ran past the panel's rounded corner. Under Inlet the strip now ends at the panel's margin and corner plus the flare. Windows keeps its caption inset. Co-Authored-By: Claude Opus 5.5 --- apps/web/src/theme.custom.inlet-menus.css | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/apps/web/src/theme.custom.inlet-menus.css b/apps/web/src/theme.custom.inlet-menus.css index 8ba79c7ab8cc9..d9fdc2503a26e 100644 --- a/apps/web/src/theme.custom.inlet-menus.css +++ b/apps/web/src/theme.custom.inlet-menus.css @@ -877,6 +877,18 @@ --workspace-controls-top: 0px; } +/* The strip ends where the last tab's outer flare still lands on the panel's + straight top edge: the panel's margin and corner, plus the flare. The + window gutter it keeps otherwise ran the flare off the panel's corner. */ + +:root[data-fork="noahhendrickson-t3code"]:not(.wco)[data-fork-theme="inlet"][data-fork-inlet-color] + [data-fork-thread-tabs] { + padding-inline-end: calc( + env(safe-area-inset-right) + var(--fork-inlet-margin) + var(--fork-inlet-radius) + + var(--fork-inlet-tab-fillet) + ); +} + /* ── Tab strip: connective tabs ────────────────────────────────────────────── The strip's own controls (project switcher, status menu, new agent, More) take Inlet's 8px corners over the default pills, the switcher's track 10px, From c884bd6a2a540876434db70896e871666330512b Mon Sep 17 00:00:00 2001 From: x Date: Sun, 15 Nov 2026 12:55:57 -0500 Subject: [PATCH 6/7] fix(web): a model picked in Inlet's open composer menu relabels its button The menu morph draws a copy of the button over it while the menu is open, copied once at open, so a new pick left the old label at the old width over the new button, and its caret hung off the tab. The copy is retaken whenever the button's contents change. Co-Authored-By: Claude Opus 5.5 --- apps/web/src/custom/inletMenuMorph.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/apps/web/src/custom/inletMenuMorph.ts b/apps/web/src/custom/inletMenuMorph.ts index ac2b9c2eb6e27..723b94060c16a 100644 --- a/apps/web/src/custom/inletMenuMorph.ts +++ b/apps/web/src/custom/inletMenuMorph.ts @@ -333,7 +333,7 @@ function startMorph(popup: HTMLElement, trigger: HTMLElement | null) { const path = document.createElementNS(SVG_NS, "path"); path.setAttribute("fill", fill); svg.append(path); - const face = cloneWithStyles(trigger); + let face = cloneWithStyles(trigger); layer.append(svg, face); if (docked) popup.before(layer); else document.body.append(layer); @@ -488,6 +488,17 @@ function startMorph(popup: HTMLElement, trigger: HTMLElement | null) { }); const column = docked ? popup.parentElement : null; removal.observe(column ?? document.body, { childList: true }); + // The face copies the button, so a pick that relabels it (a new model in the composer's menu) + // copies it again. + const relabel = new MutationObserver(() => { + const next = cloneWithStyles(owner); + next.style.opacity = face.style.opacity; + face.replaceWith(next); + face = next; + drawn = ""; + redraw(); + }); + relabel.observe(trigger, { childList: true, characterData: true, subtree: true }); const stopResize = observeResize(glass, redraw); const stopColumnResize = column ? observeResize(column, redraw) : () => {}; window.addEventListener("scroll", redraw, true); @@ -509,6 +520,7 @@ function startMorph(popup: HTMLElement, trigger: HTMLElement | null) { closing.disconnect(); placement.disconnect(); removal.disconnect(); + relabel.disconnect(); moveTarget.removeEventListener("transitionrun", onMoveStart); moveTarget.removeEventListener("transitionend", onMoveEnd); moveTarget.removeEventListener("transitioncancel", onMoveEnd); From 67c25e3109c55f1f4a87ddf461aa249567063bdd Mon Sep 17 00:00:00 2001 From: x Date: Sun, 15 Nov 2026 12:56:08 -0500 Subject: [PATCH 7/7] feat(web): petals as a mascot track in the collapsed tab strip Beside the project switcher, one mascot per petal the sidebar lists, apart from the thread tabs. The petal on screen, or whose work is, is pressed; picking one opens it, and a petal whose work needs you opens with its Threads panel, as in the sidebar. Co-Authored-By: Claude Opus 5.5 --- .fork/customizations.yaml | 12 ++- apps/web/src/custom/CollapsedThreadTabs.tsx | 17 ++++- .../src/custom/bots/CollapsedPetalTabs.tsx | 73 +++++++++++++++++++ docs/user/thread-sidebar.md | 2 + 4 files changed, 99 insertions(+), 5 deletions(-) create mode 100644 apps/web/src/custom/bots/CollapsedPetalTabs.tsx diff --git a/.fork/customizations.yaml b/.fork/customizations.yaml index 4dd4baddb1134..35dec494fa28c 100644 --- a/.fork/customizations.yaml +++ b/.fork/customizations.yaml @@ -7144,8 +7144,10 @@ (`bot`, mascot:*) there and inherits every other tag, so a bot's subagent is never a bot. Subagents made before that fix keep the copied tags and list as bots until archived; there is no migration. - The collapsed tab strip and mobile are not bot-aware, and mobile lists bots - as No-project threads. + The collapsed tab strip lists bots as a track of mascots beside its project + switcher (custom/bots/CollapsedPetalTabs), never as tabs: the bot on screen, or + whose work is, is pressed, and picking one opens its conversation. Mobile is + not bot-aware and lists bots as No-project threads. tier: 4 files: - packages/shared/src/forkBotTags.ts @@ -7167,6 +7169,7 @@ - apps/web/src/custom/bots/SidebarV2BotCardBody.tsx - apps/web/src/custom/bots/useIsBotThread.ts - apps/web/src/custom/bots/SidebarV2BotsSection.tsx + - apps/web/src/custom/bots/CollapsedPetalTabs.tsx - apps/web/src/custom/SidebarV2SectionLabel.tsx - apps/web/src/custom/SidebarV2StatusIndicator.tsx - apps/web/src/custom/sidebarV2CardStatus.ts @@ -7274,8 +7277,9 @@ setting for every bot. Sections that match nothing are dropped, and a list narrowed to nothing offers to clear. The search field takes focus only when its button opens it, never when the panel remounts - with search still open. The collapsed tab strip shows neither bots nor their work, as the - thread list does not. Mobile is not aware of any of it. + with search still open. The collapsed tab strip shows no bot work as tabs, as the thread + list does not; its bots are a mascot track beside the project switcher (fork-bots). + Mobile is not aware of any of it. tier: 4 files: - packages/shared/src/forkBotTags.ts diff --git a/apps/web/src/custom/CollapsedThreadTabs.tsx b/apps/web/src/custom/CollapsedThreadTabs.tsx index cf3cf77f24019..8972ede3721b2 100644 --- a/apps/web/src/custom/CollapsedThreadTabs.tsx +++ b/apps/web/src/custom/CollapsedThreadTabs.tsx @@ -2,7 +2,11 @@ * thread panes, filtered by project, the overflow behind More, New agent last. See * `.fork/customizations.yaml#fork-collapsed-thread-tabs`. Renders only while collapsed. */ import { useAtomValue } from "@effect/atom-react"; -import { scopeThreadRef, scopedThreadKey } from "@t3tools/client-runtime/environment"; +import { + parseScopedThreadKey, + scopeThreadRef, + scopedThreadKey, +} from "@t3tools/client-runtime/environment"; import { threadWokeAt } from "@t3tools/client-runtime/state/thread-settled"; import { resolveThreadCurrentPullRequestLink, @@ -115,6 +119,7 @@ import { } from "./sidebarV2StatusGrouping"; import { useStartNewAgentDraft } from "./useNewAgentDraft"; import { forkThreadTabsRef } from "./forkStageStamps"; +import { CollapsedPetalTabs } from "./bots/CollapsedPetalTabs"; const STATUSES_STORAGE_KEY = "t3code:fork:collapsed-thread-tabs-statuses:v1"; const StoredStatuses = Schema.Array(Schema.Literals(COLLAPSED_TAB_STATUSES)); @@ -549,6 +554,16 @@ function CollapsedThreadTabsStrip(props: { readonly paneThreadRefs: readonly Sco ))} + { + clearSidebarSelection(); + void router.navigate({ + to: "/$environmentId/$threadId", + params: buildThreadRouteParams(threadRef), + }); + }} + /> diff --git a/apps/web/src/custom/bots/CollapsedPetalTabs.tsx b/apps/web/src/custom/bots/CollapsedPetalTabs.tsx new file mode 100644 index 0000000000000..835562e12c8ae --- /dev/null +++ b/apps/web/src/custom/bots/CollapsedPetalTabs.tsx @@ -0,0 +1,73 @@ +/** + * The collapsed tab strip's petals — see `.fork/customizations.yaml#fork-bots`: a track of + * mascots beside the project switcher, apart from the thread tabs, one per petal the sidebar + * lists. The petal on screen, or whose work is, is pressed; picking one opens its conversation. + */ +import { scopedThreadKey, scopeThreadRef } from "@t3tools/client-runtime/environment"; +import type { ScopedThreadRef } from "@t3tools/contracts"; + +import { Tooltip, TooltipPopup, TooltipTrigger } from "~/components/ui/tooltip"; +import { useQuietThreadShells } from "~/state/entities"; + +import { SegmentedTab, SegmentedTabs } from "../SegmentedTabs"; +import { BotMascot } from "./BotMascot"; +import { botMascotShape } from "./botMascotTags"; +import { listSidebarBots } from "./botThreads"; +import { openBotThreadsPanel } from "./botThreadsPanelStore"; +import { botWorkAttentionByBot } from "./botWork"; +import { useBotThreadsPanelBot } from "./useBotWorkOwner"; + +export function CollapsedPetalTabs(props: { + readonly openThreadRef: ScopedThreadRef | null; + readonly onOpen: (threadRef: ScopedThreadRef) => void; +}) { + const threads = useQuietThreadShells(); + const owner = useBotThreadsPanelBot(props.openThreadRef); + const petals = listSidebarBots(threads); + if (petals.length === 0) return null; + const ownerKey = owner === null ? null : scopedThreadKey(owner); + return ( + { + // Pressing the lit petal from its work unpresses it; that goes back to its conversation. + const key = value[0] ?? ownerKey; + if (key == null) return; + const petal = petals.find( + (thread) => scopedThreadKey(scopeThreadRef(thread.environmentId, thread.id)) === key, + ); + if (petal === undefined) return; + const ref = scopeThreadRef(petal.environmentId, petal.id); + // As in the sidebar: a petal whose work needs you opens with its Threads panel. + if (botWorkAttentionByBot(threads).has(key)) openBotThreadsPanel(ref); + if (props.openThreadRef !== null && scopedThreadKey(props.openThreadRef) === key) return; + props.onOpen(ref); + }} + data-fork-tab-strip-projects="" + data-fork-tab-strip-petals="" + className="min-w-0 shrink overflow-x-auto rounded-full [scrollbar-width:none]" + > + {petals.map((petal) => { + const key = scopedThreadKey(scopeThreadRef(petal.environmentId, petal.id)); + return ( + + + } + > + + + {petal.title} + + ); + })} + + ); +} diff --git a/docs/user/thread-sidebar.md b/docs/user/thread-sidebar.md index 46a8e39aab57a..87983df43fa7d 100644 --- a/docs/user/thread-sidebar.md +++ b/docs/user/thread-sidebar.md @@ -411,6 +411,8 @@ answer its questions. A petal is a long-running agent with one ongoing conversation, such as one that checks your inbox each morning or watches a repository. Petals have their own section above **Threads** in the sidebar and never appear among your threads. +With the sidebar collapsed, their mascots sit beside the project switcher at the +top; pick one to open that petal. Press the plus beside **Petals**, name the petal, and tell it its job in plain words. It writes the job down, schedules its own wake-ups, and asks for anything