diff --git a/.fork/customizations.yaml b/.fork/customizations.yaml index 6b7ca8d672a97..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 @@ -7429,3 +7433,20 @@ - 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 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: + - apps/web/src/custom/doneCelebration.test.ts 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__/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__/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__/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/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/SidebarV2StatusIndicator.tsx b/apps/web/src/custom/SidebarV2StatusIndicator.tsx index b54f2f707da82..c99347a8cac4f 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" ? ( ) : ( - + )} ); @@ -449,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. */ @@ -458,6 +468,8 @@ export function SidebarV2StatusMark(props: { readonly quietWorking?: boolean; }) { const status = props.status; + const dot = useRef(null); + useDoneCelebration(props.seed, status, dot); if (status === null) { if (props.idle === "draft") { return ( @@ -490,7 +502,7 @@ export function SidebarV2StatusMark(props: { ) : status.mark === "woke" ? ( ) : ( - + )} ); 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/apps/web/src/custom/doneCelebration.test.ts b/apps/web/src/custom/doneCelebration.test.ts new file mode 100644 index 0000000000000..19a37b92b84e8 --- /dev/null +++ b/apps/web/src/custom/doneCelebration.test.ts @@ -0,0 +1,28 @@ +import { describe, expect, it } from "vite-plus/test"; + +import { createDoneTransitions } from "./doneCelebration"; + +describe("createDoneTransitions", () => { + 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, or as the + // finished row unmounts from the Working group. + transitions.leave("a", "working", 60_000); + 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.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.leftWorking("a", 120_000)).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 new file mode 100644 index 0000000000000..e4d1c0cf8ae9d --- /dev/null +++ b/apps/web/src/custom/doneCelebration.ts @@ -0,0 +1,123 @@ +/** + * 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"; + +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 unmounted long ago that comes back Done is stale and stays still. + */ +export function createDoneTransitions() { + const seen = new Map(); + return { + /** 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(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 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. 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(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. */ +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; +} + +/** 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; + + // 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"); + ring.setAttribute("data-fork-done-ring", index === 0 ? "flash" : ""); + ring.style.setProperty("--fork-done-ring-color", color); + Object.assign(ring.style, { + left: `${box.left}px`, + top: `${box.top + box.height / 2 - box.width / 2}px`, + width: `${box.width}px`, + height: `${box.width}px`, + }); + 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" }, + ); +} 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); 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-stage.css b/apps/web/src/theme.custom.glass-stage.css index 6958e67ba7845..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,20 +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%); - } - /* 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..778b914eefab1 100644 --- a/apps/web/src/theme.custom.glass-surfaces.css +++ b/apps/web/src/theme.custom.glass-surfaces.css @@ -321,6 +321,23 @@ padding-inline: 4px; } + /* 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] { + box-shadow: + 0 12px 32px -18px rgb(0 0 0 / 45%), + var(--fork-glass-rim); + } + + & [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 @@ -694,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); @@ -706,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] @@ -720,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] @@ -739,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%); } @@ -782,6 +800,26 @@ } /* fork:end fork-collapsed-thread-tabs */ + /* 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; + + & [data-fork-segmented-tab][data-pressed] { + border-color: transparent; + + &::before { + inset: -1px; + } + + &::after { + inset: -2px; + } + } + } + /* 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.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, 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 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