Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
Advanced mode takes Simple's visual language: palette, menus, surfaces, buttons and icons (#3690)
Milind Soni29d3bbb6f3ae
diff --git a/docs/verification/evidence/advanced-visual-cleanup/advanced-bot-menu-daylight.jpg b/docs/verification/evidence/advanced-visual-cleanup/advanced-bot-menu-daylight.jpgnew file mode 100644index 0000000000..df202fdc09Binary files /dev/null and b/docs/verification/evidence/advanced-visual-cleanup/advanced-bot-menu-daylight.jpg differdiff --git a/docs/verification/evidence/advanced-visual-cleanup/advanced-bot-menu-midnight.jpg b/docs/verification/evidence/advanced-visual-cleanup/advanced-bot-menu-midnight.jpgnew file mode 100644index 0000000000..5bff06563aBinary files /dev/null and b/docs/verification/evidence/advanced-visual-cleanup/advanced-bot-menu-midnight.jpg differdiff --git a/docs/verification/evidence/advanced-visual-cleanup/advanced-chat-daylight.jpg b/docs/verification/evidence/advanced-visual-cleanup/advanced-chat-daylight.jpgnew file mode 100644index 0000000000..6ae94e5b7eBinary files /dev/null and b/docs/verification/evidence/advanced-visual-cleanup/advanced-chat-daylight.jpg differdiff --git a/docs/verification/evidence/advanced-visual-cleanup/advanced-chat-midnight.jpg b/docs/verification/evidence/advanced-visual-cleanup/advanced-chat-midnight.jpgnew file mode 100644index 0000000000..3f5b4ec208Binary files /dev/null and b/docs/verification/evidence/advanced-visual-cleanup/advanced-chat-midnight.jpg differdiff --git a/docs/verification/evidence/advanced-visual-cleanup/advanced-model-picker-daylight.jpg b/docs/verification/evidence/advanced-visual-cleanup/advanced-model-picker-daylight.jpgnew file mode 100644index 0000000000..c00f634f1fBinary files /dev/null and b/docs/verification/evidence/advanced-visual-cleanup/advanced-model-picker-daylight.jpg differdiff --git a/docs/verification/evidence/advanced-visual-cleanup/advanced-model-picker-midnight.jpg b/docs/verification/evidence/advanced-visual-cleanup/advanced-model-picker-midnight.jpgnew file mode 100644index 0000000000..f1686a1423Binary files /dev/null and b/docs/verification/evidence/advanced-visual-cleanup/advanced-model-picker-midnight.jpg differdiff --git a/docs/verification/evidence/advanced-visual-cleanup/advanced-profile-menu-midnight.jpg b/docs/verification/evidence/advanced-visual-cleanup/advanced-profile-menu-midnight.jpgnew file mode 100644index 0000000000..c9cb8dbb2bBinary files /dev/null and b/docs/verification/evidence/advanced-visual-cleanup/advanced-profile-menu-midnight.jpg differdiff --git a/docs/verification/evidence/advanced-visual-cleanup/advanced-settings-daylight.jpg b/docs/verification/evidence/advanced-visual-cleanup/advanced-settings-daylight.jpgnew file mode 100644index 0000000000..d71f95771dBinary files /dev/null and b/docs/verification/evidence/advanced-visual-cleanup/advanced-settings-daylight.jpg differdiff --git a/docs/verification/evidence/advanced-visual-cleanup/advanced-settings-midnight.jpg b/docs/verification/evidence/advanced-visual-cleanup/advanced-settings-midnight.jpgnew file mode 100644index 0000000000..752b9cc5d3Binary files /dev/null and b/docs/verification/evidence/advanced-visual-cleanup/advanced-settings-midnight.jpg differdiff --git a/docs/verification/evidence/advanced-visual-cleanup/simple-unchanged-midnight.jpg b/docs/verification/evidence/advanced-visual-cleanup/simple-unchanged-midnight.jpgnew file mode 100644index 0000000000..8067220c3dBinary files /dev/null and b/docs/verification/evidence/advanced-visual-cleanup/simple-unchanged-midnight.jpg differdiff --git a/scripts/check-skin-contrast.mjs b/scripts/check-skin-contrast.mjsindex ada76f0dd7..ed63122d3d 100644--- a/scripts/check-skin-contrast.mjs+++ b/scripts/check-skin-contrast.mjs@@ -39,17 +39,8 @@ function parseSkins(source) {}// The phone block re-declares some tokens of a skin under a width query, so// that skin is measured twice: as it renders on desktop and as "<id> (phone)".- const phoneTokens = new Map();for (const [, id, body] of phone.matchAll(/\[data-skin="([a-z-]+)"\]\)?\s*\{([^}]*)\}/g)) {- phoneTokens.set(id, declarations(body));- skins.set(`${id} (phone)`, { ...skins.get(id), ...phoneTokens.get(id) });- }- // Advanced mode re-declares some tokens of a skin, measured as "<id> (advanced)",- // and with the phone block over it as "<id> (advanced, phone)".- for (const [, id, body] of desktop.matchAll(/\[data-skin="([a-z-]+)"\]:where\(:root\[data-interface="advanced"\][^{]*\{([^}]*)\}/g)) {- const advanced = { ...skins.get(id), ...declarations(body) };- skins.set(`${id} (advanced)`, advanced);- if (phoneTokens.has(id)) skins.set(`${id} (advanced, phone)`, { ...advanced, ...phoneTokens.get(id) });+ skins.set(`${id} (phone)`, { ...skins.get(id), ...declarations(body) });}return skins;}@@ -202,12 +193,12 @@ for (const [id, tokens] of skins) {continue;}for (const { fg, bg, ratio } of problems) {- const floor = BASELINE_FLOORS.get(`${id.replace(/ \(.*\)$/, "")}|${fg}|${bg}`);+ const floor = BASELINE_FLOORS.get(`${id.replace(/ \(phone\)$/, "")}|${fg}|${bg}`);if (floor === undefined || ratio < floor - BASELINE_DRIFT) skinFailed = true;}console.log(`${skinFailed ? "✗" : "~"} ${id}${skinFailed ? "" : " (known upstream gaps)"}`);for (const { fg, bg, ratio, min } of problems) {- const floor = BASELINE_FLOORS.get(`${id.replace(/ \(.*\)$/, "")}|${fg}|${bg}`);+ const floor = BASELINE_FLOORS.get(`${id.replace(/ \(phone\)$/, "")}|${fg}|${bg}`);const baseline = floor === undefined ? "" : `; baseline ${floor.toFixed(2)}:1`;console.log(` ${fg} on ${bg}: ${ratio.toFixed(2)}:1 (needs ${min}:1${baseline})`);}diff --git a/src/components/ApprovalModeSelector.tsx b/src/components/ApprovalModeSelector.tsxindex 784e0ceb35..5ee75c39d5 100644--- a/src/components/ApprovalModeSelector.tsx+++ b/src/components/ApprovalModeSelector.tsx@@ -1,9 +1,10 @@import { Fragment, useEffect, useRef, useState } from "react";-import { Check, ListChecks } from "lucide-react";+import { Check, ChevronDown, ListChecks } from "lucide-react";import { approvalModeFor, type ApprovalMode } from "../../shared/approval-mode";import { cn } from "@/lib/cn";import { useMenuMotion } from "./MenuMotion";+import { MENU_ITEM_SEPARATOR, MENU_SHEET } from "./menu-recipe";import { APPROVAL_LEVELS_URL, openExternalLink } from "@/lib/app-links";import { t } from "@/lib/i18n";import {@@ -90,9 +91,9 @@ export function ApprovalModeSelector({triggerRef.current?.focus();onManageCommandAllowlist();}}- className="flex items-center gap-3 border-t border-hairline/20 px-4 py-3 text-left text-[14px] text-ink hover:bg-raised-hover"+ className="flex items-center gap-2 rounded-md px-2 py-1.5 text-left text-[14px] text-ink hover:bg-menu-hover">- <ListChecks size={18} className="shrink-0 opacity-80" />+ <ListChecks size={16} className="shrink-0 text-ink-secondary" />{t("commandAllowlist.title")}</button>);@@ -120,7 +121,7 @@ export function ApprovalModeSelector({) : (<CurrentIcon size={16} className="shrink-0 opacity-80" />)}- {wide && <span aria-hidden className="text-[11px] text-ink-secondary">⌄</span>}+ {wide && <ChevronDown size={14} aria-hidden className="shrink-0 text-ink-secondary" />}</button>{motion.shown && (@@ -129,14 +130,14 @@ export function ApprovalModeSelector({aria-label={t("approvalMode.menuAria", { provider: providerName })}{...motion.exitProps}className={cn(- "absolute z-40 w-[340px] overflow-hidden rounded-2xl border border-hairline/40 bg-raised shadow-2xl",+ "absolute z-40 w-[340px] overflow-hidden", MENU_SHEET,menuDirection === "up" ? "bottom-full mb-2" : "top-full mt-2",align === "right" ? "right-0" : "left-0",wide && "w-full min-w-[340px]",motion.className,)}>- <div className="border-b border-hairline/20 px-4 py-3">+ <div className="px-2 pb-1 pt-1.5"><div className="text-[14px] font-medium text-ink">{t("approvalMode.question", { provider: providerName })}</div>@@ -149,7 +150,8 @@ export function ApprovalModeSelector({{t("approvalMode.learnMore")}</button></div>- <div className="flex flex-col py-1.5">+ <div role="separator" className={MENU_ITEM_SEPARATOR} />+ <div className="flex flex-col gap-1">{visibleOptions.map((option) => {const selected = option.mode === mode;const Icon = option.Icon;@@ -167,15 +169,15 @@ export function ApprovalModeSelector({setOpen(false);}}className={cn(- "flex items-start gap-3 px-4 py-3 text-left hover:bg-raised-hover",+ "flex items-start gap-2 rounded-md px-2 py-1.5 text-left hover:bg-menu-hover",modesDisabled && "cursor-not-allowed opacity-45 hover:bg-transparent",)}>- <Icon size={18} className="mt-0.5 shrink-0 opacity-80" />+ <Icon size={16} className="mt-px shrink-0 text-ink-secondary" /><span className="flex min-w-0 flex-1 flex-col gap-0.5"><span className="flex items-center justify-between gap-3 text-[14px] text-ink">{option.label}- {selected && <Check size={15} className="shrink-0" />}+ {selected && <Check size={14} className="shrink-0" />}</span><span className="text-[13px] leading-snug text-ink-secondary">{option.description}@@ -188,7 +190,7 @@ export function ApprovalModeSelector({})}{!visibleOptions.some((option) => option.mode === "full") && allowlistAction}{!trustedModesAvailable && (trustedModesNotice || driverKind === "codex" || requiresLocalDesktop) && (- <div className="border-t border-hairline/20 px-4 py-2.5 text-[12px] leading-snug text-ink-secondary">+ <div className="px-2 py-1.5 text-[12px] leading-snug text-ink-tertiary">{trustedModesNotice ?? t("approvalMode.customLocalOnlyDot")}</div>)}diff --git a/src/components/BotContextMenu.position.test.ts b/src/components/BotContextMenu.position.test.tsindex 76d0d603ac..f05d8760f7 100644--- a/src/components/BotContextMenu.position.test.ts+++ b/src/components/BotContextMenu.position.test.ts@@ -4,6 +4,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";import type { Bot } from "@/state/store";const fixture = vi.hoisted(() => ({+ advanced: false,effects: [] as Array<() => void | (() => void)>,portal: null as { node: ReactElement<{ ref: RefObject<HTMLDivElement | null> }>; target: unknown } | null,}));@@ -20,18 +21,21 @@ vi.mock("react-dom", async (importOriginal) => {});vi.mock("./DesktopCapabilities", () => ({ useDesktopCapabilities: () => ({}) }));vi.mock("@/lib/thread-preferences", () => ({ useShowThreads: () => true }));+vi.mock("@/lib/interface-mode", () => ({ useAdvancedMode: () => fixture.advanced }));vi.mock("@/state/store", async (importOriginal) => {const original = await importOriginal<typeof import("@/state/store")>();return { ...original, useStore: () => ({ state: { ...original.initialState, bots: [bot, { ...bot, id: "other" }] }, dispatch: vi.fn() }) };});const { BotContextMenu } = await import("./Sidebar");+const { t } = await import("@/lib/i18n");const bot: Bot = {id: "dumpling", threadId: "thread", name: "Dumpling", title: "", description: "", notifications: true,color: "green", unread: false, messages: [], modelSelection: { instanceId: "test", model: "test" },};const listeners = new Map<string, () => void>();beforeEach(() => {+ fixture.advanced = false;fixture.effects = [];fixture.portal = null;listeners.clear();@@ -105,4 +109,15 @@ describe("bot actions menu viewport placement", () => {layoutEffects();expect(negative.style).toEqual({ top: "8px", left: "8px" });});++ it("keeps Advanced's flat list of bot actions, drawn on the shared menu sheet", () => {+ fixture.advanced = true;+ const html = render();+ for (const key of ["task.newShort", "folder.new", "task.deleteAll", "sidebar.bot.pin", "sidebar.bot.makeChief", "sidebar.bot.moveToSection", "sidebar.bot.markUnread", "sidebar.bot.editProfile", "sidebar.bot.duplicate", "sidebar.copyConversationId", "sidebar.bot.archive", "common.delete"] as const) {+ expect(html, key).toContain(t(key));+ }+ expect(html).not.toContain(t("sidebar.bot.more"));+ expect(html).toContain("rounded-[var(--radius-menu)]");+ expect(html).not.toContain("shadow-2xl");+ });});diff --git a/src/components/BotModelBadge.tsx b/src/components/BotModelBadge.tsxindex 6a2b8f3ad7..86c50a87ff 100644--- a/src/components/BotModelBadge.tsx+++ b/src/components/BotModelBadge.tsx@@ -21,11 +21,10 @@ export function botTooltip(bot: Pick<Bot, "name" | "title" | "chiefOfStaff" | "m].filter(Boolean).join(" · ");}-export function BotModelBadge({ bot, instances, avatarSize, subtle = false }: {+export function BotModelBadge({ bot, instances, avatarSize }: {bot: Pick<Bot, "modelSelection">;instances: InstanceInfo[];avatarSize: number;- subtle?: boolean;}) {const model = botModel(bot, instances);if (!model) return null;@@ -35,7 +34,7 @@ export function BotModelBadge({ bot, instances, avatarSize, subtle = false }: {<span data-testid="model-badge" role="img" aria-label={description} title={model.label}className="absolute -bottom-0.5 -left-0.5 flex items-center justify-center rounded-full border-2 border-panel bg-panel"style={{ width: size, height: size }}>- <InstanceProviderMark instance={model.instance} size={size - 4} subtle={subtle} />+ <InstanceProviderMark instance={model.instance} size={size - 4} subtle /></span>);}@@ -60,7 +59,7 @@ export function BotModelMark({ bot, instances }: { bot: Pick<Bot, "modelSelectioreturn (<span data-testid="model-badge" role="img" aria-label={description} title={model.label}className="ml-auto flex shrink-0 items-center self-center text-ink-secondary">- <InstanceProviderMark instance={model.instance} size={14} />+ <InstanceProviderMark instance={model.instance} size={14} subtle /></span>);}diff --git a/src/components/BotProjects.tsx b/src/components/BotProjects.tsxindex 147380a37e..6c78828a47 100644--- a/src/components/BotProjects.tsx+++ b/src/components/BotProjects.tsx@@ -3,6 +3,7 @@ import { createPortal } from "react-dom";import { ArrowDown, ArrowUp, CheckCheck, Folder, MoreHorizontal, Pencil, Plus, X } from "lucide-react";import { useStore, type Bot, type BotProject } from "@/state/store";import { cn } from "@/lib/cn";+import { MENU_SHEET } from "./menu-recipe";import { useHeldMenuMotion } from "./MenuMotion";import { t } from "@/lib/i18n";@@ -62,13 +63,13 @@ export function FolderActions({ project, canMoveUp, canMoveDown, canMarkRead, saonClick={(event) => { if (menu) { close(); return; } const rect = event.currentTarget.getBoundingClientRect(); onMenuChange({ left: rect.left, top: rect.bottom + 4 }); }}className="flex size-6 shrink-0 items-center justify-center rounded opacity-0 hover:bg-raised hover:text-ink focus-visible:opacity-100 group-hover/folder:opacity-100 max-md:opacity-70 touch:opacity-70"><MoreHorizontal size={13} /></button>{motion.shown && position && createPortal(<div ref={menuRef} role="menu" aria-label={t("folder.actions", { name: project.name })} aria-busy={saving || undefined} data-thread-overlay style={position}- className={cn("fixed z-50 w-[220px] rounded-lg border border-hairline/50 bg-card p-1 shadow-xl", motion.className)} {...motion.exitProps}+ className={cn("fixed z-50 w-[220px]", MENU_SHEET, motion.className)} {...motion.exitProps}onMouseDown={(event) => event.stopPropagation()}onKeyDown={(event) => { if (event.key === "Escape") { event.preventDefault(); event.stopPropagation(); close(); } else navigateThreadMenu(event); }}>- <button type="button" role="menuitem" onClick={() => { close(); onEdit(); }} className="flex w-full items-center gap-2 rounded px-2.5 py-2 text-left text-[12px] text-ink hover:bg-raised"><Pencil size={12} />{t("folder.settings")}</button>- <button type="button" role="menuitem" disabled={!canMarkRead || saving} onClick={() => onMarkRead(close)} className="flex w-full items-center gap-2 rounded px-2.5 py-2 text-left text-[12px] text-ink hover:bg-raised disabled:opacity-40"><CheckCheck size={12} />{t("folder.markRead")}</button>- <button type="button" role="menuitem" disabled={!canMoveUp || saving} onClick={() => move(-1)} className="flex w-full items-center gap-2 rounded px-2.5 py-2 text-left text-[12px] text-ink hover:bg-raised disabled:opacity-40"><ArrowUp size={12} />{t("folder.moveUp")}</button>- <button type="button" role="menuitem" disabled={!canMoveDown || saving} onClick={() => move(1)} className="flex w-full items-center gap-2 rounded px-2.5 py-2 text-left text-[12px] text-ink hover:bg-raised disabled:opacity-40"><ArrowDown size={12} />{t("folder.moveDown")}</button>+ <button type="button" role="menuitem" onClick={() => { close(); onEdit(); }} className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[14px] leading-[18px] text-ink hover:bg-menu-hover"><Pencil size={16} />{t("folder.settings")}</button>+ <button type="button" role="menuitem" disabled={!canMarkRead || saving} onClick={() => onMarkRead(close)} className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[14px] leading-[18px] text-ink hover:bg-menu-hover disabled:opacity-40"><CheckCheck size={16} />{t("folder.markRead")}</button>+ <button type="button" role="menuitem" disabled={!canMoveUp || saving} onClick={() => move(-1)} className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[14px] leading-[18px] text-ink hover:bg-menu-hover disabled:opacity-40"><ArrowUp size={16} />{t("folder.moveUp")}</button>+ <button type="button" role="menuitem" disabled={!canMoveDown || saving} onClick={() => move(1)} className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[14px] leading-[18px] text-ink hover:bg-menu-hover disabled:opacity-40"><ArrowDown size={16} />{t("folder.moveDown")}</button></div>, document.body)}</>;}diff --git a/src/components/CallView.tsx b/src/components/CallView.tsxindex ef143deb77..cb561a2cfd 100644--- a/src/components/CallView.tsx+++ b/src/components/CallView.tsx@@ -28,6 +28,7 @@ import { callCapabilityHelp, type CallCapabilityHelp } from "@/lib/call-capabiliimport { onCallStartRequest } from "@/lib/call-start-request";import { VoiceSetupDialog } from "./VoiceSetupDialog";import { openBotSettings } from "./bot-panel/panel-link";+import { MENU_SHEET } from "./menu-recipe";type Phase = "listening" | "sending" | "working" | "speaking";const CALL_ENDPOINT_MS = 850;@@ -418,7 +419,7 @@ export function CallModeMenu({ id, mode, onChoose, onClose, placement = "header"if (event.key === "Tab") onClose();else navigateThreadMenu(event);}}- className={cn("popover-surface animate-pop-in absolute right-0 z-30 w-[280px] rounded-xl border border-hairline bg-panel p-1.5 text-left shadow-2xl space-y-1", placement === "composer" ? "bottom-full mb-1.5" : "top-full mt-1.5")}+ className={cn("animate-pop-in absolute right-0 z-30 w-[280px] text-left", MENU_SHEET, placement === "composer" ? "bottom-full mb-1.5" : "top-full mt-1.5")}>{CALL_MODES.map((entry) => {const unavailable = entry.id === "turns" ? turnsUnavailable : null;@@ -434,12 +435,12 @@ export function CallModeMenu({ id, mode, onChoose, onClose, placement = "header"if (!unavailable) onChoose(entry.id);}}className={cn(- "flex w-full items-start gap-2.5 rounded-lg px-2.5 py-2 text-left outline-none hover:bg-raised focus-visible:bg-raised aria-disabled:cursor-default aria-disabled:hover:bg-transparent",- mode === entry.id && "bg-raised/60",+ "flex w-full items-start gap-2 rounded-md px-2 py-1.5 text-left outline-none hover:bg-menu-hover aria-disabled:cursor-default aria-disabled:hover:bg-transparent",+ mode === entry.id && "bg-menu-active",)}><span className="min-w-0 flex-1">- <span className={cn("block text-[13px] font-medium", unavailable ? "text-ink-tertiary" : "text-ink")}>{t(entry.label)}</span>+ <span className={cn("block text-[14px] leading-[18px]", unavailable ? "text-ink-tertiary" : "text-ink")}>{t(entry.label)}</span><span className="mt-0.5 block text-[12px] leading-[1.4] text-ink-secondary">{unavailable ? `${unavailable.label}. ${unavailable.reason}` : callModeHint(entry.id, { cloudHome })}</span>diff --git a/src/components/CanvasComputers.tsx b/src/components/CanvasComputers.tsxindex f7e0edd065..07a4ce2631 100644--- a/src/components/CanvasComputers.tsx+++ b/src/components/CanvasComputers.tsx@@ -1,6 +1,6 @@import { useCallback, useEffect, useRef, useState, type PointerEvent as ReactPointerEvent } from "react";import { createPortal } from "react-dom";-import { Box, ExternalLink, Loader2, Monitor, Plus, RefreshCw, X } from "lucide-react";+import { ArrowUpRight, Box, ExternalLink, Loader2, Monitor, Plus, RefreshCw, X } from "lucide-react";import { api, useStore } from "@/state/store";import type { TeamComputer } from "../../shared/team-computer";import { ConfirmDialog } from "./ConfirmDialog";@@ -264,7 +264,7 @@ export function CanvasComputers({ open, createRequest, drop, sections, onClose,{heldHereNow && <button className={`${control} text-accent`} disabled={busy !== null} onClick={() => void mutate(computer.id, () => post(computer.id, "control", { action: "release", controlLeaseId: controlLeaseId.current }), () => { setHeldHere(null); setViewer(null); })}>{t("canvasComputers.returnToBots")}</button>}{computer.held && !heldHereNow && <button className={control} disabled title={t("canvasComputers.inUseTitle")}>{t("canvasComputers.inUse")}</button>}</div>- {viewer?.id === computer.id && <a href={viewer.url} target="_blank" rel="noopener noreferrer" className="mt-2 block rounded-lg px-3 py-2 text-[12px] text-accent hover:bg-control">{t("canvasComputers.openSecure")} ↗</a>}+ {viewer?.id === computer.id && <a href={viewer.url} target="_blank" rel="noopener noreferrer" className="mt-2 block rounded-lg px-3 py-2 text-[12px] text-accent hover:bg-control">{t("canvasComputers.openSecure")} <ArrowUpRight size={14} aria-hidden="true" className="inline align-[-2px]" /></a>}</article>; })}</div><footer className="border-t border-hairline/40 p-3"><button className={`${control} w-full text-left`} onClick={settings}>{t("canvasComputers.moreSettings")}</button></footer>diff --git a/src/components/ChatMoreMenu.test.ts b/src/components/ChatMoreMenu.test.tsindex de091119b5..f60d8402e2 100644--- a/src/components/ChatMoreMenu.test.ts+++ b/src/components/ChatMoreMenu.test.ts@@ -159,7 +159,7 @@ describe("ChatHeaderMenu, Advanced mode's header ⋯", () => {expect(menu.items.find((item) => item.key === "inspector")).toMatchObject({ separatorBefore: true });expect(menu.items.every((item) => !item.disabled && item.heading !== "In Advanced mode")).toBe(true);expect(menu).toMatchObject({ placement: "below", openOnHover: true });- expect(menu.trigger).toMatch(/data-testid="chat-more" class="flex rounded-md p-1.5 hover:bg-raised/);+ expect(menu.trigger).toMatch(/data-testid="chat-more" class="flex size-8 items-center justify-center rounded-full /);});it("has no thread items even if rendered by ChatMoreMenu in Advanced mode", () => {diff --git a/src/components/ChatMoreMenu.tsx b/src/components/ChatMoreMenu.tsxindex 94d7ba2761..6be0656e36 100644--- a/src/components/ChatMoreMenu.tsx+++ b/src/components/ChatMoreMenu.tsx@@ -217,7 +217,7 @@ export function ChatHeaderMenu({ bot }: { bot: Bot }): JSX.Element {<spandata-testid="chat-more"className={cn(- "flex rounded-md p-1.5 hover:bg-raised",+ "flex size-8 items-center justify-center rounded-full transition-colors hover:bg-ink/[0.06]",open || on ? "text-accent" : "text-ink-secondary hover:text-ink",)}title={t("chat.more")}diff --git a/src/components/ChatView.controls.test.ts b/src/components/ChatView.controls.test.tsindex 17f4334ccc..5432715aae 100644--- a/src/components/ChatView.controls.test.ts+++ b/src/components/ChatView.controls.test.ts@@ -295,9 +295,9 @@ describe("glass header", () => {expect(markup.slice(scroller)).toMatch(/class="glass-scroller-content[^"]*"[^>]*role="log"/);});- it("fades the transcript into the canvas under Simple mode's header, where Advanced keeps the glass", () => {+ it("fades the transcript into the canvas under the header in both modes", () => {const bar = (markup: string) => markup.match(/<div data-glass-bar="top"[^>]*>/)?.[0] ?? "";- expect(bar(renderToStaticMarkup(createElement(ChatView, { bot })))).not.toContain("data-glass-fade");+ expect(bar(renderToStaticMarkup(createElement(ChatView, { bot })))).toContain('data-glass-fade=""');fixture.advanced = false;try {const markup = renderToStaticMarkup(createElement(ChatView, { bot }));diff --git a/src/components/ChatView.tsx b/src/components/ChatView.tsxindex 74884fc03d..e43c5e93b0 100644--- a/src/components/ChatView.tsx+++ b/src/components/ChatView.tsx@@ -822,7 +822,7 @@ const MessagesList = memo(function MessagesList({);});-const CHATHEAD_PILL = "flex min-w-0 items-center gap-2 rounded-full border border-hairline/40 bg-control/60 py-0.5 pl-1.5 text-ink";+const CHATHEAD_PILL = `flex min-w-0 items-center gap-2 rounded-full py-0.5 pl-1.5 text-ink ${ELEVATED_FLOAT}`;export function ChatView({ bot: profile }: { bot: Bot }) {const bot = useMemo(() => currentTaskBot(profile), [profile]);@@ -1017,7 +1017,7 @@ export function ChatView({ bot: profile }: { bot: Bot }) {<CallOverlay bot={bot} /><GlassScrollFrame className="flex-1 [--glass-tint:var(--color-app)]">{/* z-[25]: above the room set-up card (z-20), below the CallOverlay (z-30). */}- <GlassBar edge="top" fade={simpleHead} className="z-[25]">+ <GlassBar edge="top" fade={!remoteClient} className="z-[25]"><div{...headerDragProps}className={cn(@@ -1129,7 +1129,7 @@ export function ChatView({ bot: profile }: { bot: Bot }) {onClick={(event) => { if (!state.computerOpen) rememberComputerPanelOpen({ botId: bot.id, opener: event.currentTarget, tabs: event.detail === 0 }); dispatch({ type: "toggleComputer" }); }}className={cn("relative",- simpleHead ? "flex size-8 items-center justify-center rounded-full transition-colors hover:bg-ink/[0.06]" : "rounded-md p-1.5 hover:bg-raised",+ "flex size-8 items-center justify-center rounded-full transition-colors hover:bg-ink/[0.06]",state.computerOpen ? "text-accent" : "text-ink-secondary hover:text-ink",)}title={t("chat.computer")} aria-label={busy && place === "browser" ? `${t("chat.computer")}, ${t("place.live")}` : t("chat.computer")}diff --git a/src/components/ClaudeUpdatePrompt.tsx b/src/components/ClaudeUpdatePrompt.tsxindex d30512f253..398acd0c70 100644--- a/src/components/ClaudeUpdatePrompt.tsx+++ b/src/components/ClaudeUpdatePrompt.tsx@@ -61,7 +61,7 @@ export function ClaudeUpdatePrompt({<buttontype="button"onClick={update}- className="flex items-center gap-1.5 rounded-full bg-accent px-3 py-1 text-[13px] font-medium text-white hover:brightness-110"+ className="ui-button-primary flex items-center gap-1.5 rounded-full bg-accent px-3 py-1 text-[13px] font-medium text-white hover:brightness-110"><Download size={12} aria-hidden="true" /> {t("chat.claudeUpdate.doIt")}</button>diff --git a/src/components/CodeBlock.tsx b/src/components/CodeBlock.tsxindex 062365f98d..6705d229c9 100644--- a/src/components/CodeBlock.tsx+++ b/src/components/CodeBlock.tsx@@ -188,7 +188,7 @@ export function CodePlate({ copied, onCopy, copyLabel, items }: {: <Copy size={14} aria-hidden="true" />}</button>{copied !== "idle" && <span role="status" className="sr-only">{copied === "failed" ? t("common.copyFailed") : t("code.copiedTitle")}</span>}- <SidebarPopoverMenu items={items} ariaLabel={t("chat.more")} placement="below" compact triggerClassName="rounded-full" triggerTitle={t("chat.more")}+ <SidebarPopoverMenu items={items} ariaLabel={t("chat.more")} placement="below" triggerClassName="rounded-full" triggerTitle={t("chat.more")}renderTrigger={() => <span className={PLATE_BUTTON}><MoreHorizontal size={14} aria-hidden="true" /></span>} /></div>);diff --git a/src/components/Composer.simple.test.ts b/src/components/Composer.simple.test.tsindex d7266e57b5..b561d75402 100644--- a/src/components/Composer.simple.test.ts+++ b/src/components/Composer.simple.test.ts@@ -263,10 +263,11 @@ describe("the Simple composer in a group chat", () => {});describe("the Advanced composer", () => {- it("keeps the paperclip, the approval shield and the split call button, with no +", () => {+ it("keeps the paperclip, the approval shield and the split call button, with no +, on Simple's floating surface", () => {fixture.advanced = true;render({ bot });expect(plus()).toBeNull();+ expect(container.querySelector('[data-tour="composer"]')!.className.split(" ")).toEqual(expect.arrayContaining(["rounded-2xl", "bg-composer", "ring-[0.5px]", "shadow-(--shadow-float)"]));expect(container.querySelector('button[aria-label="Attach a file"]')).not.toBeNull();expect(container.querySelector('[aria-haspopup="menu"][aria-label$="for Claude"]')).not.toBeNull();expect(fixture.call).toMatchObject({ placement: "composer" });diff --git a/src/components/Composer.tsx b/src/components/Composer.tsxindex bebfb32579..478d98ed4a 100644--- a/src/components/Composer.tsx+++ b/src/components/Composer.tsx@@ -795,7 +795,7 @@ export function Composer({data-composer-backdropclassName={cn("pointer-events-none absolute -left-5 -right-5 bg-app", advanced ? "-bottom-3 top-1/2" : cn("top-0", simpleDock ? "-bottom-4" : "-bottom-3"))}/>- <div ref={shellRef} data-tour="composer" data-multiline={multiline ? "" : undefined} className={cn("@container/composer relative z-[1]", singleRow ? "flex items-end gap-2" : simpleDock ? cn(SIMPLE_COMPOSER, multiline ? "rounded-[18px]" : "rounded-[22px]") : "rounded-2xl bg-composer px-2 py-1.5 ring-1 ring-composer-ring")}>+ <div ref={shellRef} data-tour="composer" data-multiline={multiline ? "" : undefined} className={cn("@container/composer relative z-[1]", singleRow ? "flex items-end gap-2" : simpleDock ? cn(SIMPLE_COMPOSER, multiline ? "rounded-[18px]" : "rounded-[22px]") : cn("rounded-2xl px-2 py-1.5", ELEVATED_FLOAT))}>{singleRow && !locked && (<div className="flex shrink-0 items-center"><PhonePlus@@ -813,7 +813,7 @@ export function Composer({/></div>)}- <div className={singleRow ? cn("min-w-0 flex-1 rounded-[26px] px-3 py-1.5", advanced ? "bg-composer ring-1 ring-composer-ring" : ELEVATED_FLOAT) : "contents"}>+ <div className={singleRow ? cn("min-w-0 flex-1 rounded-[26px] px-3 py-1.5", ELEVATED_FLOAT) : "contents"}>{replyTo && <ComposerReplyStrip message={replyTo} fallbackName={bot?.name} onClear={onClearReply} />}<div data-composer-row className={cn("flex items-end", simpleDock ? "gap-1.5" : "gap-1", !singleRow && !simpleDock && "@max-[30rem]/composer:flex-wrap")}><input@@ -837,7 +837,7 @@ export function Composer({title={t("composer.attach")}className="flex size-8 shrink-0 items-center justify-center rounded-full text-ink-secondary hover:bg-control hover:text-ink">- <Paperclip size={17} />+ <Paperclip size={16} strokeWidth={1.75} absoluteStrokeWidth /></button>}{/* Simple mode shows a mode's chip only while it is on, so a choice made in the + menu or the bot panel stays in view. */}{goal && (advanced || goal.on) && <GoalToggle {...goal} compact={simpleDock} />}@@ -949,8 +949,7 @@ export function Composer({})}aria-label={t("composer.placeholder.bot", { name: group ? group.name : (bot?.name ?? "") })}className={cn(- "block max-h-[9rem] w-full resize-none overflow-y-auto bg-transparent focus:outline-none",- advanced ? "placeholder:text-ink-secondary" : "placeholder:text-ink-tertiary",+ "block max-h-[9rem] w-full resize-none overflow-y-auto bg-transparent placeholder:text-ink-tertiary focus:outline-none",!simpleDock && "px-1 text-[15px]",simpleDock ? "min-h-7 px-0.5 py-1 text-[14px] leading-5" : "min-h-6 py-1 leading-6",)}@@ -986,7 +985,7 @@ export function Composer({)}title={recording ? t("composer.dictation.stopHint") : t("composer.dictation.hint")}>- {simpleDock ? <Mic size={16} strokeWidth={1.75} absoluteStrokeWidth className="[&_rect]:fill-current" /> : <Mic size={18} />}+ <Mic size={16} strokeWidth={1.75} absoluteStrokeWidth className="[&_rect]:fill-current" /></button>)}{callShown && bot && !group && <CallButton bot={bot} placement="composer" fill={advanced || singleRow ? undefined : slot.fill} ink={slot.ink} inverse={singleRow} />}@@ -1006,7 +1005,7 @@ export function Composer({: simpleDock ? "hover:brightness-110" : "bg-accent hover:brightness-110",)}>- {busy && !canSteer ? <Clock size={simpleDock ? 14 : 15} /> : simpleDock ? <ArrowUp size={16} strokeWidth={1.75} absoluteStrokeWidth /> : <ArrowUp size={17} />}+ {busy && !canSteer ? <Clock size={simpleDock ? 14 : 15} /> : <ArrowUp size={16} strokeWidth={1.75} absoluteStrokeWidth />}</button>)}</div>diff --git a/src/components/ComputerPanel.tsx b/src/components/ComputerPanel.tsxindex d49d77dbcf..b8277f9090 100644--- a/src/components/ComputerPanel.tsx+++ b/src/components/ComputerPanel.tsx@@ -5,7 +5,7 @@ import { Switch } from "./SettingsPrimitives";import { lazy, Suspense, useCallback, useEffect, useRef, useState } from "react";import { z } from "zod";import { waitForLocalVmReady } from "@/lib/local-vm-readiness";-import { CalendarClock, Columns2, Box, Check, Cloud, Sparkles, Globe, Hand, Loader2, Maximize2, Monitor, Moon, Power, Settings, X } from "lucide-react";+import { CalendarClock, ChevronRight, Columns2, Box, Check, Cloud, Sparkles, Globe, Hand, Loader2, Maximize2, Monitor, Moon, Power, Settings, X } from "lucide-react";import { api, ApiError, currentTaskBot, useStore, type Bot, type ConfigStatus } from "@/state/store";import { setAdvancedMode, useAdvancedMode } from "@/lib/interface-mode";import { ComputerFilesPane } from "./ComputerFilesPane";@@ -1741,7 +1741,7 @@ export function ComputerPanel({<span className="block text-[14px] font-medium text-ink">{t("computer.tab.routines")} <span className="ml-1 text-[11px] text-ink-secondary">{botRoutines.length}</span></span><span className={cn("mt-1 block truncate text-[12px]", activeRoutineRun ? routineRunTone(activeRoutineRun) : "text-ink-secondary")}>{activeRoutineRun ? `${activeRoutineRun.routineName} · ${routineRunLabel(activeRoutineRun)}` : t("computer.routines.openTitle")}</span></span>- <span className="text-ink-secondary" aria-hidden="true">→</span>+ <ChevronRight size={14} className="shrink-0 text-ink-secondary rtl:-scale-x-100" aria-hidden="true" /></button></> : (<div className="mt-4 rounded-xl bg-card p-4" data-testid="where-works">diff --git a/src/components/EngineAccounts.tsx b/src/components/EngineAccounts.tsxindex deda487c75..ad0757d9be 100644--- a/src/components/EngineAccounts.tsx+++ b/src/components/EngineAccounts.tsx@@ -10,6 +10,7 @@ import { DeviceSignIn, deviceSignInProvider } from "./DeviceSignIn";import { ChatGptPlanStatus } from "./ChatGptPlanStatus";import { EngineCard, engineReady, providerName, type EngineCardSummary } from "./EngineLibrary";import { CommandRow, EngineSetup, EngineUpdateNotice, EngineWarningNotice } from "./EngineSetup";+import { MENU_SHEET } from "./menu-recipe";/** Providers whose accounts are listed together on one card, each signed in on its own. */export type AccountGroup = "claude" | "chatgpt";@@ -118,7 +119,7 @@ function AccountMenu({ group, instance, onRename }: { group: AccountGroup; insta{busy ? <Loader2 size={14} className="animate-spin" /> : <MoreHorizontal size={16} />}</button>{open && (- <div role="menu" className="popover-surface absolute right-0 top-full z-40 mt-1 w-[220px] overflow-hidden rounded-xl border border-hairline/50 bg-card py-1.5 text-[13px] shadow-2xl shadow-black/50">+ <div role="menu" className={cn("absolute right-0 top-full z-40 mt-1 w-[220px] overflow-hidden text-[13px]", MENU_SHEET)}><button type="button" role="menuitem" className={cn(item, "text-ink")} onClick={() => { setOpen(false); onRename(); }}>{t("accounts.rename")}</button>{canSignOut && <button type="button" role="menuitem" className={cn(item, "text-ink")} onClick={() => { setOpen(false); setConfirm("signOut"); }}>{t("accounts.signOut")}</button>}{canRemove && usedBy > 0 && <p className="px-3 pb-1 pt-0.5 text-[11px] leading-snug text-ink-secondary">{t("accounts.inUse", { count: String(usedBy) })}</p>}diff --git a/src/components/EngineSetup.tsx b/src/components/EngineSetup.tsxindex 277fb260e9..34a149c057 100644--- a/src/components/EngineSetup.tsx+++ b/src/components/EngineSetup.tsx@@ -192,7 +192,7 @@ function ServerEngineInstall({ instance, mode, command, quiet = false }: { instadisabled={busy}onClick={() => void run()}className={cn("flex w-full items-center justify-center gap-2 rounded-lg px-3 py-2 text-[13px] font-semibold disabled:cursor-wait disabled:opacity-70",- quiet ? "bg-control text-ink hover:bg-raised-hover" : "bg-accent text-white hover:brightness-110")}+ quiet ? "bg-control text-ink hover:bg-raised-hover" : "ui-button-primary bg-accent text-white hover:brightness-110")}>{busy ? <Loader2 size={14} className="animate-spin" /> : <Download size={14} />}{busydiff --git a/src/components/ExportTranscriptMenu.tsx b/src/components/ExportTranscriptMenu.tsxindex 474a6f37a6..001cefd356 100644--- a/src/components/ExportTranscriptMenu.tsx+++ b/src/components/ExportTranscriptMenu.tsx@@ -10,6 +10,7 @@ import {slugifyTranscriptFilename,} from "@/lib/export-transcript";import type { Message } from "@/state/store";+import { MENU_HEADING, MENU_SHEET } from "./menu-recipe";export interface ExportTranscriptMenuProps {title: string;@@ -101,7 +102,7 @@ export function ExportTranscriptMenu({aria-haspopup="menu"aria-expanded={open}className={cn(- "rounded-md p-1.5 transition-colors hover:bg-raised",+ "flex size-8 items-center justify-center rounded-full transition-colors hover:bg-ink/[0.06]",open ? "text-accent" : "text-ink-secondary hover:text-ink",className,)}@@ -114,14 +115,14 @@ export function ExportTranscriptMenu({<divrole="menu"aria-label="Export options"- className={cn("popover-surface absolute right-0 top-full z-40 mt-1 w-[220px] overflow-hidden rounded-xl border border-hairline/50 bg-card py-1.5 shadow-2xl shadow-black/50", motion.className)} {...motion.exitProps}+ className={cn("absolute right-0 top-full z-40 mt-1 w-[220px] overflow-hidden", MENU_SHEET, motion.className)} {...motion.exitProps}>- <div className="px-3 py-1 text-[11px] font-semibold uppercase tracking-wider text-ink-tertiary">+ <div className={MENU_HEADING}>Export Conversation</div>{!hasMessages ? (- <div className="px-3 py-2 text-[12px] text-ink-secondary">+ <div className="px-2 py-1.5 text-[12px] text-ink-secondary">No messages to export yet.</div>) : (@@ -133,9 +134,9 @@ export function ExportTranscriptMenu({className="ui-menu-row text-ink">{copied ? (- <Check size={14} className="shrink-0 text-success" />+ <Check size={16} className="shrink-0 text-success" />) : (- <Copy size={14} className="shrink-0 text-ink-secondary" />+ <Copy size={16} className="shrink-0 text-ink-secondary" />)}<span className="flex-1 truncate">{copied ? "Copied to clipboard!" : "Copy as Markdown"}@@ -143,7 +144,7 @@ export function ExportTranscriptMenu({</button>{copyFailed && (- <div role="status" className="px-3 py-2 text-[12px] text-ink-secondary">+ <div role="status" className="px-2 py-1.5 text-[12px] text-ink-secondary">Clipboard unavailable. Download the Markdown file instead.</div>)}@@ -154,7 +155,7 @@ export function ExportTranscriptMenu({onClick={handleDownload}className="ui-menu-row text-ink">- <Download size={14} className="shrink-0 text-ink-secondary" />+ <Download size={16} className="shrink-0 text-ink-secondary" /><span className="flex-1 truncate">Download as .md</span></button></>diff --git a/src/components/FilesView.tsx b/src/components/FilesView.tsxindex 86822cd355..f189bc47a9 100644--- a/src/components/FilesView.tsx+++ b/src/components/FilesView.tsx@@ -10,6 +10,7 @@ import { useStore } from "@/state/store";import { ConfirmDialog } from "./ConfirmDialog";import { useCaptionChrome } from "./DesktopCapabilities";import { Switch } from "./SettingsPrimitives";+import { MENU_SHEET } from "./menu-recipe";const REFUSAL: Record<string, LocaleKey> = {"too-broad": "files.refusal.tooBroad", "app-data": "files.refusal.appData", "already-shared": "files.refusal.alreadyShared",@@ -211,7 +212,7 @@ function FolderMenu({ name, busy, onOpen, onStop }: { name: string; busy: booleareturn <div ref={ref} className="relative shrink-0"><button type="button" aria-haspopup="menu" aria-expanded={open} aria-label={t("files.more", { name })}className="ui-icon-button hover:bg-control hover:text-ink" onClick={() => setOpen((value) => !value)}><MoreHorizontal size={16} /></button>- {open && <div role="menu" className="popover-surface absolute right-0 top-full z-40 mt-1 w-[220px] overflow-hidden rounded-xl border border-hairline/50 bg-card py-1.5 text-[13px] shadow-2xl shadow-black/50">+ {open && <div role="menu" className={cn("absolute right-0 top-full z-40 mt-1 w-[220px] overflow-hidden text-[13px]", MENU_SHEET)}>{item(t("files.openHere"), onOpen)}{item(t("files.stop"), onStop, true)}</div>}diff --git a/src/components/MessageActions.tsx b/src/components/MessageActions.tsxindex 672f43c0a1..45cd8e12c0 100644--- a/src/components/MessageActions.tsx+++ b/src/components/MessageActions.tsx@@ -4,6 +4,7 @@ import { popoverClosesOnKey, usePopoverDismiss } from "@/hooks/use-popover-dismiimport { cn } from "@/lib/cn";import { useCopyFeedback } from "@/lib/copy-text";import { t } from "@/lib/i18n";+import { MENU_ITEM, MENU_SHEET } from "./menu-recipe";export const ACTION_ICON = { size: 17, strokeWidth: 1.5 } as const;@@ -194,7 +195,7 @@ export function MessageActions({aria-label={t("chat.messageActions")}onKeyDown={moveFocus}className={cn(- "popover-surface absolute z-40 min-w-52 max-w-[calc(100vw-2rem)] overflow-hidden rounded-xl border border-hairline/50 bg-menu py-1.5 shadow-2xl shadow-black/50",+ "absolute z-40 min-w-52 max-w-[calc(100vw-2rem)] overflow-hidden", MENU_SHEET,menuAbove ? "bottom-full mb-1" : "top-full mt-1",mirrored !== menuFlipped ? "end-0" : "start-0",)}@@ -211,9 +212,9 @@ export function MessageActions({setMenuOpen(false);moreRef.current?.focus();}}- className="flex w-full items-center gap-3 px-3.5 py-2 text-start text-[14px] text-ink hover:bg-menu-hover focus-visible:bg-menu-hover focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-60"+ className={cn(MENU_ITEM, "text-start text-ink hover:bg-menu-hover focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-60")}>- <span className="flex size-5 shrink-0 items-center justify-center text-ink-secondary" aria-hidden="true">{item.icon}</span>+ <span className="flex size-4 shrink-0 items-center justify-center text-ink-secondary [&>svg]:size-4" aria-hidden="true">{item.icon}</span><span className="min-w-0 flex-1 truncate">{item.label}</span></button>))}diff --git a/src/components/ModelPicker.tsx b/src/components/ModelPicker.tsxindex 66e3616ba2..f721fc00dd 100644--- a/src/components/ModelPicker.tsx+++ b/src/components/ModelPicker.tsx@@ -722,11 +722,11 @@ export function ModelPicker({<button{...triggerProps}className={cn(- "flex items-center gap-1.5 rounded-full border-[0.5px] border-ink/10 py-1 pl-2 pr-2.5 text-[13px] text-ink hover:bg-ink/[0.06] aria-expanded:bg-ink/[0.08] disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent",+ "group flex items-center gap-1.5 rounded-full py-1 pl-2 pr-2.5 text-[13px] text-ink hover:bg-ink/[0.06] aria-expanded:bg-ink/[0.08] disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent",!contained && active && !showActiveAccount && COMPACT_SQUARE,)}>- {active && <InstanceProviderMark instance={active} size={14} />}+ {active && <InstanceProviderMark instance={active} size={14} subtle />}{!contained && active && showActiveAccount && (<span data-model-account-compact className="hidden max-w-20 truncate @max-4xl/chathead:inline">{active.displayName}</span>)}@@ -749,9 +749,9 @@ export function ModelPicker({)}</span><ChevronDown- size={14}+ size={12}className={cn(- "text-ink-secondary transition-transform",+ "text-ink-tertiary transition-transform",open && "rotate-180",!contained && active && "@max-4xl/chathead:hidden",)}diff --git a/src/components/ModelPickerFull.tsx b/src/components/ModelPickerFull.tsxindex b349327887..44c243f169 100644--- a/src/components/ModelPickerFull.tsx+++ b/src/components/ModelPickerFull.tsx@@ -142,12 +142,12 @@ export function ModelEngineRail({ instances, selectedInstance, claudeInstance, oaria-pressed={selected}title={`${label} · ${managedBy ?? engineStatus(target)}`}className={cn(- "relative flex size-9 shrink-0 items-center justify-center rounded-[8px]",+ "group relative flex size-9 shrink-0 items-center justify-center rounded-[8px]",selected ? "bg-ink/[0.08]" : "hover:bg-ink/[0.06]",managedBy && "opacity-40",)}>- <InstanceProviderMark instance={target} size={18} />+ <InstanceProviderMark instance={target} size={18} subtle={!selected} />{target.access === "api" && (<span data-rail-key-badge className="absolute bottom-0 left-0 flex size-3.5 items-center justify-center rounded-full bg-menu text-ink-secondary"><KeyRound size={9} aria-hidden="true" />diff --git a/src/components/PlaceChip.tsx b/src/components/PlaceChip.tsxindex 6919b9da15..6fa3bd7284 100644--- a/src/components/PlaceChip.tsx+++ b/src/components/PlaceChip.tsx@@ -2,6 +2,7 @@ import { Check } from "lucide-react";import { useEffect, useRef, useState } from "react";import { cn } from "@/lib/cn";import { useMenuMotion } from "./MenuMotion";+import { MENU_HEADING, MENU_SHEET } from "./menu-recipe";import { t } from "@/lib/i18n";import { instanceSupportsLocalComputer, localComputerDisabledReason, localComputerSelectable } from "@/lib/local-computer";import { effectivePlace, PLACES, placeLabelKey, placeOffered, type Place } from "@/lib/place";@@ -146,20 +147,20 @@ export function PlaceChip({ bot, task, live, disabled = false, onPin }: {{showLive && <span className="absolute right-1.5 top-1.5 size-1.5 animate-pulse rounded-full bg-success" aria-label={t("place.live")} />}</button>{motion.shown && (- <div role="menu" aria-label={t("place.chipTitle")} className={cn("absolute bottom-full left-0 z-40 mb-2 w-[300px] overflow-hidden rounded-2xl border border-hairline/40 bg-raised shadow-2xl", motion.className)} {...motion.exitProps}>- <div className="border-b border-hairline/20 px-4 py-3 text-[14px] font-medium text-ink">{t("place.chipTitle")}</div>- <div className="flex flex-col py-1.5">+ <div role="menu" aria-label={t("place.chipTitle")} className={cn("absolute bottom-full left-0 z-40 mb-2 w-[300px] overflow-hidden", MENU_SHEET, motion.className)} {...motion.exitProps}>+ <div className={MENU_HEADING}>{t("place.chipTitle")}</div>+ <div className="flex flex-col gap-1"><buttontype="button"role="menuitemradio"aria-checked={!pinned}onClick={() => choose(null)}- className={cn("flex items-start gap-3 px-4 py-2 text-left hover:bg-control/60", !pinned && "bg-control/40")}+ className={cn("flex items-start gap-2 rounded-md px-2 py-1.5 text-left", !pinned ? "bg-menu-active" : "hover:bg-menu-hover")}>- <PlaceIcon place={botDefault} size={14} className="mt-0.5 shrink-0 opacity-70" aria-hidden="true" />+ <PlaceIcon place={botDefault} size={16} className="mt-px shrink-0 text-ink-secondary" aria-hidden="true" /><span className="min-w-0 flex-1">- <span className="block text-[13px] text-ink">{followsAuto ? t("place.auto") : t("place.followBot")}</span>- <span className="block text-[11px] text-ink-secondary">+ <span className="block text-[14px] leading-[18px] text-ink">{followsAuto ? t("place.auto") : t("place.followBot")}</span>+ <span className="block text-[12px] leading-4 text-ink-secondary">{followsAuto ? t("place.autoDetail") : t("place.followBotDetail", { place: t(placeLabelKey(botDefault)) })}</span></span>@@ -178,12 +179,12 @@ export function PlaceChip({ bot, task, live, disabled = false, onPin }: {disabled={!reachable}title={!policy ? t("place.unavailable") : placeHasIssue(view) ? view.line : undefined}onClick={() => choose(place)}- className={cn("flex items-start gap-3 px-4 py-2 text-left", reachable ? "hover:bg-control/60" : "cursor-not-allowed opacity-45", selected && "bg-control/40")}+ className={cn("flex items-start gap-2 rounded-md px-2 py-1.5 text-left", selected ? "bg-menu-active" : reachable ? "hover:bg-menu-hover" : "cursor-not-allowed opacity-45")}>- <PlaceIcon place={place} size={14} className="mt-0.5 shrink-0 opacity-70" aria-hidden="true" />+ <PlaceIcon place={place} size={16} className="mt-px shrink-0 text-ink-secondary" aria-hidden="true" /><span className="min-w-0 flex-1">- <span className="block text-[13px] text-ink">{t(placeLabelKey(place))}</span>- <span className="block text-[11px] text-ink-secondary">{detail}</span>+ <span className="block text-[14px] leading-[18px] text-ink">{t(placeLabelKey(place))}</span>+ <span className="block text-[12px] leading-4 text-ink-secondary">{detail}</span></span>{selected && <Check size={14} className="mt-0.5 shrink-0 text-accent" aria-hidden="true" />}</button>diff --git a/src/components/RoomHeader.tsx b/src/components/RoomHeader.tsxindex 9ec87ee218..beaccc3e81 100644--- a/src/components/RoomHeader.tsx+++ b/src/components/RoomHeader.tsx@@ -226,7 +226,7 @@ export function RoomHeader({aria-label={t("chat.find")}aria-pressed={findOpen}className={cn(- "rounded-md p-1.5 hover:bg-raised",+ "flex size-8 items-center justify-center rounded-full transition-colors hover:bg-ink/[0.06]",findOpen ? "text-accent" : "text-ink-secondary hover:text-ink",)}title={t("chat.findShortcut")}diff --git a/src/components/SettingsModal.simple.test.ts b/src/components/SettingsModal.simple.test.tsindex 45dfdd9afb..3640da9453 100644--- a/src/components/SettingsModal.simple.test.ts+++ b/src/components/SettingsModal.simple.test.ts@@ -314,10 +314,10 @@ describe("Settings in Simple mode", () => {describe("Settings in Advanced mode", () => {beforeEach(() => { fixture.advancedMode = true; });- it("keeps the grouped rail, the glass pop-up and General as it was, Advanced mode switch first", () => {+ it("keeps the grouped rail and General, Advanced mode switch first, on the same Settings look as Simple", () => {const html = render();expect(html).toContain("glass-surface");- expect(html).not.toContain("data-settings-look");+ expect(html).toContain('data-settings-look="advanced"');expect(html).not.toContain("data-settings-page=");expect([...html.matchAll(/data-settings-group="([^"]+)"/g)].map((match) => match[1])).toEqual(["you", "ai", "computers", "account"]);expect(html.indexOf('aria-label="Advanced mode"')).toBeLessThan(html.indexOf("Language"));diff --git a/src/components/SettingsModal.tsx b/src/components/SettingsModal.tsxindex a2a14779cd..1a358afa58 100644--- a/src/components/SettingsModal.tsx+++ b/src/components/SettingsModal.tsx@@ -449,7 +449,7 @@ export function SettingsModal() {const close = () => dispatch({ type: "toggleAppSettings", open: false });const searchField = (className: string, inputClassName: string) => (<div className={className}>- <Search size={advanced ? 14 : 15} aria-hidden="true" className="shrink-0 text-ink-secondary" />+ <Search size={15} aria-hidden="true" className="shrink-0 text-ink-secondary" /><inputdata-settings-searchvalue={query}@@ -583,6 +583,7 @@ export function SettingsModal() {<divclassName="glass-popup-frame"data-settings-sheet+ data-settings-look="advanced"style={glassPopupFrameStyle()}onMouseDown={(e) => e.target === e.currentTarget && close()}>@@ -602,8 +603,8 @@ export function SettingsModal() {{t("settings.title")}</div>{searchField(- "mb-2 mt-1 flex min-h-8 shrink-0 items-center gap-2 rounded-lg border border-transparent bg-control/70 px-2.5 py-2 focus-within:border-focus",- "w-full bg-transparent text-[13px] text-ink placeholder:text-ink-secondary focus:outline-none",+ "mb-2 mt-1 flex h-8 shrink-0 items-center gap-2 rounded-lg bg-ink/[0.05] px-[9px] text-[13px] focus-within:ring-2 focus-within:ring-focus/60",+ "w-full min-w-0 bg-transparent text-[13px] text-ink placeholder:text-ink-tertiary focus:outline-none",)}{visibleSections.length === 0 && (<div className="px-2.5 py-4 text-[13px] leading-relaxed text-ink-secondary">@@ -615,7 +616,7 @@ export function SettingsModal() {if (entries.length === 0) return null;return (<div key={group.id} role="group" aria-labelledby={`settings-group-${group.id}`} data-settings-group={group.id} className="flex flex-col gap-0.5 pb-2">- <div id={`settings-group-${group.id}`} className="px-2.5 pb-1 pt-2 text-[11px] font-medium uppercase tracking-[0.08em] text-ink-tertiary">+ <div id={`settings-group-${group.id}`} className="px-[9px] pb-1 pt-2 text-[12px] font-medium leading-4 text-ink-tertiary">{t(group.labelKey)}</div>{entries.map(({ id, labelKey, icon: Icon }) => (@@ -625,8 +626,8 @@ export function SettingsModal() {onClick={() => openSection(id)}aria-current={section === id ? "page" : undefined}className={cn(- "cursor-pointer flex min-h-9 items-center gap-2.5 rounded-lg px-2.5 py-2 text-left text-[13px] transition-colors motion-reduce:transition-none",- section === id ? "bg-control text-ink" : "text-ink-secondary hover:bg-control/50 hover:text-ink",+ "flex h-8 shrink-0 cursor-pointer items-center gap-[9px] rounded-lg px-[9px] text-left text-[13px] text-ink transition-colors motion-reduce:transition-none",+ section === id ? "bg-ink/[0.08]" : "hover:bg-ink/[0.06]",)}><Icon size={15} className="shrink-0" />diff --git a/src/components/Sidebar.header.test.ts b/src/components/Sidebar.header.test.tsindex abca751492..ec675ca415 100644--- a/src/components/Sidebar.header.test.ts+++ b/src/components/Sidebar.header.test.ts@@ -242,9 +242,9 @@ describe("sidebar top row", () => {});});-describe("sidebar glass head and foot", () => {+describe("sidebar head and foot", () => {it.each(["comfortable", "compact", "icons"] as const)(- "puts the top row and search in the glass head, the places in the glass foot, and the list between at %s density",+ "puts the top row and search in the head, the places in the foot, and the fading list between at %s density",(density) => {fixture.density = density;const html = render();@@ -256,7 +256,7 @@ describe("sidebar glass head and foot", () => {const head = at('data-glass-bar="top"');const topRow = at("data-sidebar-top-row");const search = at('aria-label="Search bots and messages"');- const list = at('class="glass-scroller ');+ const list = at('data-scroll-fade-frame=""');const foot = at('data-glass-bar="bottom"');const automations = at('data-sidebar-nav="automations"');const places = at('data-sidebar-nav="team-map"');diff --git a/src/components/Sidebar.simple-layout.test.ts b/src/components/Sidebar.simple-layout.test.tsindex dacfa723bb..e7904a35bb 100644--- a/src/components/Sidebar.simple-layout.test.ts+++ b/src/components/Sidebar.simple-layout.test.ts@@ -130,7 +130,7 @@ describe("Simple-mode sidebar layout", () => {expect(headers(tree).map((header) => header.props.name)).toEqual(["Group chats", "Work"]);});- it("fades the list's edges, with the top buttons and the tiles fixed above it, and keeps Advanced's glass", () => {+ it("fades the list's edges in both modes, with the top buttons and the tiles fixed above it", () => {fixture.state = { ...fixture.state, bots: [bot("chief", { chiefOfStaff: true, pinned: true }), bot("atlas", { pinned: true }), bot("bea")] };const simple = render();expect(simple.tree.find((node) => node.type === GlassScrollFrame)!.props.fade).toBe(true);@@ -141,8 +141,8 @@ describe("Simple-mode sidebar layout", () => {expect(simple.root.props.className).toContain("max-md:[--scroll-fade-surface:var(--color-app)]");fixture.advanced = true;const advanced = render();- expect(advanced.tree.find((node) => node.type === GlassScrollFrame)!.props.fade).toBe(false);- expect(advanced.root.props.className).not.toContain("--scroll-fade-surface");+ expect(advanced.tree.find((node) => node.type === GlassScrollFrame)!.props.fade).toBe(true);+ expect(advanced.root.props.className).toContain("max-md:[--scroll-fade-surface:var(--color-app)]");});it("keeps Advanced's Pinned heading and rows, with the Chief as a row", () => {@@ -157,7 +157,7 @@ describe("Simple-mode sidebar layout", () => {expect(headers(tree).map((header) => header.props.name)).toContain("Pinned");});- it("draws a faint edge and the Simple footer in Simple mode, and keeps Advanced's divider and footer", () => {+ it("draws the same faint edge in both modes, with the Simple footer in Simple mode and Advanced's footer in Advanced", () => {const footer = (tree: ReactElement<Props>[]) => (tree.find((node) => node.type === SidebarFooter)!.props as Parameters<typeof SidebarFooter>[0]).simple;const simple = render();expect(simple.root.props.className).toContain("border-r border-ink/[0.04]");@@ -166,7 +166,7 @@ describe("Simple-mode sidebar layout", () => {fixture.values = [];fixture.advanced = true;const advanced = render();- expect(advanced.root.props.className).toContain("border-r border-hairline/40");+ expect(advanced.root.props.className).toContain("border-r border-ink/[0.04]");expect(footer(advanced.tree)).toBe(false);});diff --git a/src/components/Sidebar.simple-mode.test.ts b/src/components/Sidebar.simple-mode.test.tsindex a4ad593f76..9fb914ff35 100644--- a/src/components/Sidebar.simple-mode.test.ts+++ b/src/components/Sidebar.simple-mode.test.ts@@ -164,7 +164,7 @@ describe("bot-first sidebar", () => {expect(markup).toMatch(/data-bot-actions="atlas"[^>]*class="[^"]*\bright-2 top-1 translate-y-0\b/);});- it("fades the collapsed rail's engine badge in Simple mode and leaves Advanced's at full strength", () => {+ it("fades the collapsed rail's engine badge in both modes", () => {fixture.showThreads = false;fixture.state = { ...fixture.state, instances: [{ instanceId: "fake", driverKind: "claudeAgent", displayName: "Claude" }] as unknown as AppState["instances"] };const candidate = { ...bot, tasks: [], projects: [] };@@ -172,8 +172,7 @@ describe("bot-first sidebar", () => {expect(rail).toMatch(/<span data-testid="model-badge"[^>]*><span data-provider-mark="brand" class="[^"]*\bopacity-60\b/);fixture.advanced = true;const advanced = renderToStaticMarkup(createElement(BotListItem, rowProps("icons", candidate)));- expect(advanced).toContain('data-testid="model-badge"');- expect(advanced).not.toContain("data-provider-mark");+ expect(advanced).toMatch(/<span data-testid="model-badge"[^>]*><span data-provider-mark="brand" class="[^"]*\bopacity-60\b/);});it("shows a waiting Simple row as an amber dot and preview, and a working one as a ring-cut dot on the avatar, with no badge or live region", () => {@@ -191,14 +190,16 @@ describe("bot-first sidebar", () => {expect(working).toContain("[--row:var(--color-panel)]");});- it("rings a focused Simple row or group chat inside its edge, where Advanced keeps its accent ring", () => {+ it("rings a focused row or group chat inside its edge in both modes", () => {fixture.showThreads = false;const group: Group = { id: "room", threadId: "room-thread", name: "Launch", memberIds: [bot.id], messages: [], defaultResponder: { kind: "mentions" }, bulletin: "", unread: false, createdAt: 1 };const simple = renderToStaticMarkup(createElement(BotListItem, rowProps("comfortable", { ...bot, tasks: [], projects: [] }))) + renderToStaticMarkup(createElement(GroupListItem, { group, density: "comfortable", onMenu: vi.fn() }));expect(simple.match(/focus-visible:outline-2 focus-visible:-outline-offset-2! focus-visible:outline-focus/g)).toHaveLength(2);expect(simple).not.toContain("focus-visible:ring-accent/60");fixture.advanced = true;- expect(renderToStaticMarkup(createElement(BotListItem, rowProps("comfortable", { ...bot, tasks: [], projects: [] })))).toContain("outline-none focus-visible:ring-1 focus-visible:ring-accent/60");+ const advanced = renderToStaticMarkup(createElement(BotListItem, rowProps("comfortable", { ...bot, tasks: [], projects: [] })));+ expect(advanced).toContain("focus-visible:outline-2 focus-visible:-outline-offset-2! focus-visible:outline-focus");+ expect(advanced).not.toContain("focus-visible:ring-accent/60");});it("hides even the selected Simple row's actions until hover or focus, where Advanced keeps them shown", () => {@@ -222,7 +223,7 @@ describe("bot-first sidebar", () => {expect(markup).toContain('<span class="sr-only">Unread</span>');});- it("draws no engine mark for a bot with no AI yet, in a group chat, or in Advanced mode, where the full mark stays", () => {+ it("draws no engine mark for a bot with no AI yet or in a group chat, and a faded one in Advanced mode", () => {fixture.showThreads = false;fixture.state = { ...fixture.state, instances: [{ instanceId: "fake", driverKind: "claudeAgent", displayName: "Claude" }] as unknown as AppState["instances"] };const candidate = { ...bot, tasks: [], projects: [] };@@ -231,8 +232,7 @@ describe("bot-first sidebar", () => {expect(renderToStaticMarkup(createElement(GroupListItem, { group, density: "comfortable", onMenu: vi.fn() }))).not.toContain("data-provider-mark");fixture.advanced = true;const advanced = renderToStaticMarkup(createElement(BotListItem, rowProps("comfortable", candidate)));- expect(advanced).not.toContain("data-provider-mark");- expect(advanced).toContain('data-testid="model-badge"');+ expect(advanced).toMatch(/data-testid="model-badge"[^>]*><span data-provider-mark="brand" class="[^"]*\bopacity-60\b/);});it.each(["comfortable", "compact"] as const)("keeps a Simple row to its name, preview and one faded engine mark, naming role, Chief and engine in its tooltip, %s density", (density) => {diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsxindex 99c3f295e2..0cdc0772a6 100644--- a/src/components/Sidebar.tsx+++ b/src/components/Sidebar.tsx@@ -96,10 +96,12 @@ import { useCloudOwner } from "./CloudOwner";import { SidebarSectionHeader } from "./SidebarSectionHeader";import { NeedsYouButton, OwnerFace, OwnerPickerHost, pickOwnerOf } from "./TeamOwner"; import { SidebarPeople } from "./SidebarPeople";import { showWhoReportsToWhom, TeamMenuItems } from "./SidebarTeamMenu";+import { MENU_ITEM, MENU_SHEET } from "./menu-recipe";+import { ELEVATED_CONTROL } from "./elevated";import { departmentOwner, useTeamPeople } from "@/state/team-people";export { TeamMenuItems };import { SidebarResizeHandle, useSidebarWidth } from "./SidebarResizeHandle";-import { PHONE_TOP_BUTTON, SIMPLE_MENU, SIMPLE_MENU_ITEM, SIMPLE_ROW_FOCUS, SIMPLE_TOP_BUTTON, SidebarEdgeToggle, SidebarSearchPill, SidebarSearchToggle } from "./SidebarSimpleTop";+import { PHONE_TOP_BUTTON, SIMPLE_ROW_FOCUS, SIMPLE_TOP_BUTTON, SidebarEdgeToggle, SidebarSearchPill, SidebarSearchToggle } from "./SidebarSimpleTop";import { isSidebarToggle } from "@/lib/keyboard-shortcuts";import { SidebarRailSeparator, SimpleRailFooter } from "./SidebarSimpleRail";import { useShowThreads } from "@/lib/thread-preferences";@@ -205,10 +207,10 @@ export function GroupListItem({onMenu({ groupId: group.id, x: rect.left + rect.width / 2, y: rect.top + rect.height / 2 });}}className={cn(- "relative flex w-full items-center rounded-md text-left", advanced ? "outline-none focus-visible:ring-1 focus-visible:ring-accent/60" : SIMPLE_ROW_FOCUS,+ "relative flex w-full items-center rounded-md text-left", SIMPLE_ROW_FOCUS,density === "icons" ? (railTile ? "h-[54px] justify-center" : "justify-center px-1 py-1.5") : density === "compact" ? "gap-1.5 py-1 pl-6 pr-9" : simpleRow? cn("gap-2 rounded-[10px] py-2 pr-2 group-hover:pr-9 group-focus-within:pr-9 max-md:pr-9 touch:pr-9 md:h-[54px] md:py-0", !group.dm && hasThreadList ? "pl-6" : "pl-2") : "gap-2 py-1.5 pl-6 pr-9",- advanced ? selected && !expanded ? "bg-raised/70" : "hover:bg-raised/40" : selected && !expanded ? "bg-raised" : "hover:bg-raised/50",+ selected && !expanded ? "bg-raised" : "hover:bg-raised/50",)}title={density === "icons" ? group.name : undefined}aria-label={density === "icons" ? group.name : undefined}@@ -271,8 +273,6 @@ function RoomContextMenu({const shown = motion.value;const { state, dispatch } = useStore();const remoteClient = window.ogb?.remoteClient?.active === true;- const advanced = useAdvancedMode();- const roomRow = advanced ? "flex w-full items-center gap-3 px-3.5 py-2 text-left text-[14px]" : SIMPLE_MENU_ITEM;const group = shown ? state.groups.find((g) => g.id === shown.groupId) : undefined;const [renaming, setRenaming] = useState(false);const [describing, setDescribing] = useState(false);@@ -326,7 +326,7 @@ function RoomContextMenu({aria-label={t("sidebar.bot.actions", { name: group.name })}onKeyDown={navigateThreadMenu}style={{ top, left }}- className={cn(advanced ? "popover-surface fixed z-40 w-[228px] overflow-hidden rounded-xl border border-hairline/50 bg-menu py-1.5 shadow-2xl shadow-black/60" : cn("fixed z-40 w-[228px] overflow-hidden", SIMPLE_MENU), motion.className)} {...motion.exitProps}+ className={cn("fixed z-40 w-[228px] overflow-hidden", MENU_SHEET, motion.className)} {...motion.exitProps}>{!remoteClient && describing ? (<div className="flex items-center gap-1 px-2 py-1">@@ -416,7 +416,7 @@ function RoomContextMenu({setDraft(group.name);setRenaming(true);}}- className={cn(roomRow, "text-ink hover:bg-menu-hover")}+ className={cn(MENU_ITEM, "text-ink hover:bg-menu-hover")}><Pencil size={16} className="text-ink-secondary" />{isBotChat ? t("sidebar.room.renameChat") : t("sidebar.room.renameChannel")}@@ -429,7 +429,7 @@ function RoomContextMenu({setDescriptionDraft(group.description ?? "");setDescribing(true);}}- className={cn(roomRow, "text-ink hover:bg-menu-hover")}+ className={cn(MENU_ITEM, "text-ink hover:bg-menu-hover")}><TextQuote size={16} className="text-ink-secondary" />{t("sidebar.room.setDescription")}@@ -442,7 +442,7 @@ function RoomContextMenu({onClose();onMoveToSection(group.id);}}- className={cn(roomRow, "text-ink hover:bg-menu-hover")}+ className={cn(MENU_ITEM, "text-ink hover:bg-menu-hover")}><FolderPlus size={16} className="text-ink-secondary" />{t("sidebar.section.moveToContext")}@@ -454,7 +454,7 @@ function RoomContextMenu({void copyText(group.threadId);onClose();}}- className={cn(roomRow, "text-ink hover:bg-menu-hover")}+ className={cn(MENU_ITEM, "text-ink hover:bg-menu-hover")}><ClipboardCopy size={16} className="text-ink-secondary" />{t("sidebar.copyConversationId")}@@ -465,7 +465,7 @@ function RoomContextMenu({onClose();onDelete(group.id);}}- className={cn(roomRow, "text-danger hover:bg-menu-hover")}+ className={cn(MENU_ITEM, "text-danger hover:bg-menu-hover")}><Trash2 size={16} />{isBotChat ? t("sidebar.room.deleteChat") : t("sidebar.room.deleteChannel")}@@ -752,7 +752,7 @@ export const BotListItem = memo(function BotListItem(props: BotRowProps) {const title = bot.title.trim();const details = [title, bot.chiefOfStaff ? t("sidebar.bot.chiefOfStaff") : ""].filter(Boolean);const rowClass = cn(- "flex w-full items-center rounded-xl text-left transition-colors duration-150", advanced ? "outline-none focus-visible:ring-1 focus-visible:ring-accent/60" : SIMPLE_ROW_FOCUS,+ "flex w-full items-center rounded-xl text-left transition-colors duration-150", SIMPLE_ROW_FOCUS,iconOnly? railTile ? "h-[54px] justify-center" : "justify-center px-1 py-1.5": density === "compact"@@ -760,7 +760,7 @@ export const BotListItem = memo(function BotListItem(props: BotRowProps) {: simpleRow ? "gap-2 rounded-[10px] py-2 pl-2 pr-2 md:h-[54px] md:py-0": cn(showThreads ? "gap-2 py-2" : "gap-3 py-2", showThreads ? "pl-6 pr-9 group-hover:pr-[5.75rem] group-focus-within:pr-[5.75rem] max-md:pr-9 touch:pr-[5.75rem]" : "pl-2.5 pr-9"),!iconOnly && "max-md:rounded-2xl max-md:py-2.5",- selected ? advanced ? "bg-raised shadow-[0_1px_2px_rgb(0_0_0/0.10)]" : "bg-raised" : "hover:bg-raised/50",+ selected ? "bg-raised" : "hover:bg-raised/50",simpleRow && rowSurface(selected),);const { waiting, working, teammateWait, queued } = sidebarBotStatus(bot, pendingQueued);@@ -778,7 +778,7 @@ export const BotListItem = memo(function BotListItem(props: BotRowProps) {motionKey={mascotMotion?.nonce ?? 0}animated={working || unread || (mascotMotion?.kind ?? "none") !== "none"}/>- {iconOnly && <BotModelBadge bot={bot} instances={instances} avatarSize={avatarSize} subtle={railTile} />}+ {iconOnly && <BotModelBadge bot={bot} instances={instances} avatarSize={avatarSize} />}{simpleRow && <AvatarActivityDot activity={working ? "working" : teammateWait ? "teammate" : queued && !waiting ? "queued" : null} />}{!simpleRow && working && (<span@@ -1288,7 +1288,7 @@ export function Sidebar({ open, onClose, collapseToIcons = false }: {setSearchOpen(true);toggleCollapsed();};- const plusItem = advanced ? "flex w-full items-center gap-3 px-3.5 py-2 text-left text-[14px] text-ink hover:bg-menu-hover" : cn(SIMPLE_MENU_ITEM, "text-ink hover:bg-menu-hover");+ const plusItem = cn(MENU_ITEM, "text-ink hover:bg-menu-hover");const plusControl = (<div ref={plusMenuRef} className="contents"><button@@ -1296,17 +1296,17 @@ export function Sidebar({ open, onClose, collapseToIcons = false }: {onClick={() => setPlusOpen((o) => !o)}aria-label={remoteClient ? t("sidebar.new") : t("sidebar.newOrShare")}className={phone ? PHONE_TOP_BUTTON : rail || simple ? SIMPLE_TOP_BUTTON : cn(- "flex items-center justify-center text-ink-secondary hover:bg-raised hover:text-ink focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",- density === "icons" ? "size-[46px] shrink-0 rounded-xl" : "size-8 rounded-md",+ "flex items-center justify-center text-ink-secondary transition-colors hover:bg-ink/[0.06] hover:text-ink focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",+ density === "icons" ? "size-[46px] shrink-0 rounded-xl" : "size-8 rounded-full",)}title={remoteClient ? t("sidebar.new") : t("sidebar.newOrShare")}>- <Plus size={phone || simple || density === "icons" ? 20 : 17} strokeWidth={simpleDesk || rail ? 1.5 : 2} />+ <Plus size={phone || simple || density === "icons" ? 20 : 18} strokeWidth={phone ? 2 : 1.5} /></button>{plusMotion.shown && (<><div role="menu" aria-label={remoteClient ? t("sidebar.new") : t("sidebar.newOrShare")} onKeyDown={navigateThreadMenu} className={cn(- advanced ? "popover-surface absolute z-40 w-52 overflow-hidden rounded-xl border border-hairline/50 bg-menu py-1.5 shadow-2xl shadow-black/60" : cn("absolute z-40 w-max min-w-[200px] overflow-hidden", SIMPLE_MENU),+ "absolute z-40 w-max min-w-[200px] overflow-hidden", MENU_SHEET,rail ? "left-full top-0 ml-4" : cn("top-full", advanced ? "mt-1" : "mt-1.5", density === "icons" ? "left-0" : "right-0"),plusMotion.className,)} {...plusMotion.exitProps}>@@ -1393,7 +1393,7 @@ export function Sidebar({ open, onClose, collapseToIcons = false }: {onPointerLeave={() => showEdge(false)}style={{ "--sidebar-width": `${sizing.width}px` } as CSSProperties}className={cn(- advanced ? "relative flex h-full shrink-0 flex-col border-r border-hairline/40 bg-panel" : "relative flex h-full shrink-0 flex-col border-r border-ink/[0.04] bg-panel max-md:[--scroll-fade-surface:var(--color-app)]",+ "relative flex h-full shrink-0 flex-col border-r border-ink/[0.04] bg-panel max-md:[--scroll-fade-surface:var(--color-app)]",sizing.resizing ? "transition-none" : "transition-[width] duration-200",density === "icons" ? rail ? "w-[92px]" : "w-[80px]" : density === "compact" ? "w-[272px] md:w-[var(--sidebar-width)]" : advanced ? "w-[320px] md:w-[var(--sidebar-width)]" : "w-[280px] md:w-[var(--sidebar-width)]",sidePanelOpen ? density === "compact" ? "md:max-w-[272px]" : advanced ? "md:max-w-[320px]" : "md:max-w-[280px]" : "md:max-w-[calc(100vw-320px)]",@@ -1404,7 +1404,7 @@ export function Sidebar({ open, onClose, collapseToIcons = false }: {open ? "max-md:translate-x-0" : "max-md:-translate-x-full",)}>- <GlassScrollFrame className="flex-1" fade={!advanced}>+ <GlassScrollFrame className="flex-1" fade><GlassBar edge="top"><divdata-sidebar-top-row@@ -1452,12 +1452,12 @@ export function Sidebar({ open, onClose, collapseToIcons = false }: {onClick={toggleCollapsed}aria-label={density === "icons" ? t("sidebar.density.expand") : t("sidebar.density.collapseAria")}className={cn(- "flex items-center justify-center text-ink-secondary hover:bg-raised hover:text-ink focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",- density === "icons" ? "size-[46px] shrink-0 rounded-xl" : "size-8 rounded-md",+ "flex items-center justify-center text-ink-secondary transition-colors hover:bg-ink/[0.06] hover:text-ink focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",+ density === "icons" ? "size-[46px] shrink-0 rounded-xl" : "size-8 rounded-full",)}title={density === "icons" ? t("sidebar.density.expand") : t("sidebar.density.collapse")}>- {density === "icons" ? <PanelLeftOpen size={20} /> : <PanelLeftClose size={17} />}+ {density === "icons" ? <PanelLeftOpen size={20} strokeWidth={1.5} /> : <PanelLeftClose size={18} strokeWidth={1.5} />}</button>}{density === "icons" && <buttontype="button"@@ -1466,7 +1466,7 @@ export function Sidebar({ open, onClose, collapseToIcons = false }: {title={t("sidebar.searchAria")}className="flex size-[46px] shrink-0 items-center justify-center rounded-xl text-ink-secondary hover:bg-raised hover:text-ink focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus">- <Search size={20} strokeWidth={2} />+ <Search size={20} strokeWidth={1.5} /></button>}{advanced && <div ref={attentionMenuRef} className={density === "icons" ? "relative" : "contents"}><button@@ -1475,11 +1475,11 @@ export function Sidebar({ open, onClose, collapseToIcons = false }: {aria-label={attentionTriggerLabel(attention.length)}title={attentionTriggerLabel(attention.length)}className={cn(- "relative flex items-center justify-center text-ink-secondary hover:bg-raised hover:text-ink focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",- density === "icons" ? "size-[46px] shrink-0 rounded-xl" : phone ? "size-10 shrink-0 rounded-full border border-hairline bg-card text-ink" : "size-8 rounded-md",+ "relative flex items-center justify-center text-ink-secondary transition-colors hover:bg-ink/[0.06] hover:text-ink focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",+ density === "icons" ? "size-[46px] shrink-0 rounded-xl" : phone ? "size-10 shrink-0 rounded-full border border-hairline bg-card text-ink" : "size-8 rounded-full",)}>- <Activity size={density === "icons" ? 20 : 17} strokeWidth={2} />+ <Activity size={density === "icons" ? 20 : 18} strokeWidth={1.5} />{attention.length > 0 && (<span className="absolute -right-0.5 -top-0.5 flex min-w-4 items-center justify-center rounded-full bg-accent px-0.5 text-[10px] font-semibold leading-4 text-ink">{attention.length > 9 ? "9+" : attention.length}</span>)}@@ -1490,27 +1490,27 @@ export function Sidebar({ open, onClose, collapseToIcons = false }: {{attentionMotion.shown && (<><div className={cn(- "popover-surface absolute top-full z-40 mt-1 overflow-hidden rounded-xl border border-hairline/50 bg-menu py-1.5 shadow-2xl shadow-black/60",+ "absolute top-full z-40 mt-1 overflow-hidden", MENU_SHEET,density === "icons" ? "left-0" : "right-0",density === "icons" ? "w-72" : density === "compact" ? "w-60 md:w-[min(240px,calc(var(--sidebar-width)_-_32px))]" : "w-72 md:w-[min(288px,calc(var(--sidebar-width)_-_32px))]",attentionMotion.className,)} {...attentionMotion.exitProps}>- <div className="flex items-center gap-1 pb-1 pl-3.5 pr-2 pt-1.5">+ <div className="flex items-center gap-1 py-0.5 pl-2"><span className="flex-1 text-[13px] font-medium text-ink">{t("attention.title")}</span><buttontype="button"onClick={() => setAttentionPinned(!attentionPinned)}aria-label={t(attentionPinned ? "attention.unpin" : "attention.pin")}title={t(attentionPinned ? "attention.unpin" : "attention.pin")}- className="flex size-6 items-center justify-center rounded text-ink-secondary hover:bg-raised hover:text-ink focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus"+ className="flex size-6 items-center justify-center rounded-md text-ink-secondary hover:bg-menu-hover hover:text-ink focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus">{attentionPinned ? <PinOff size={14} /> : <Pin size={14} />}</button></div>{attention.length === 0 ? (- <div className="px-3.5 py-2.5 text-[13px] text-ink-secondary">{t("attention.empty")}</div>+ <div className="px-2 py-1.5 text-[13px] text-ink-secondary">{t("attention.empty")}</div>) : (- <AttentionThreadRows entries={attention} onJump={(entry) => { setAttentionOpen(false); dispatch(attentionJumpAction(entry)); }} />+ <AttentionThreadRows inset entries={attention} onJump={(entry) => { setAttentionOpen(false); dispatch(attentionJumpAction(entry)); }} />)}</div></>@@ -1523,15 +1523,15 @@ export function Sidebar({ open, onClose, collapseToIcons = false }: {{density === "icons" && !rail && <DesktopWorkspaceSwitcher compact cloudHome={state.config?.cloudHome === true} owner={cloudOwner} howTo={state.cloudHowTo} onMenuClosed={endHowTo} />}<OrganizationIdentity compact={density === "icons"} />{phone ? null : simple ? searchShown && <SidebarSearchPill query={query} onQuery={setQuery} onClose={closeSearch} /> : <div className={cn("pt-1 pb-3", density === "icons" ? "hidden" : "px-3")}>- <div className="flex items-center gap-2 rounded-md border border-hairline/40 bg-inset/40 px-2.5 py-1.5 focus-within:border-focus">- <Search size={14} className="text-ink-secondary" />+ <div className={cn("flex h-8 items-center gap-2 rounded-full px-3 focus-within:ring-focus", ELEVATED_CONTROL)}>+ <Search size={15} className="shrink-0 text-ink-secondary" /><inputvalue={query}onChange={(e) => setQuery(e.target.value)}onKeyDown={(e) => e.key === "Escape" && setQuery("")}placeholder={t("sidebar.search")}aria-label={t("sidebar.searchAria")}- className="w-full bg-transparent text-[13px] text-ink placeholder:text-ink-secondary focus:outline-none"+ className="w-full bg-transparent text-[13px] text-ink placeholder:text-ink-tertiary focus:outline-none"/></div></div>}@@ -1781,7 +1781,7 @@ export function Sidebar({ open, onClose, collapseToIcons = false }: {{renameTeam && <TeamDialog section={renameTeam} rename onRenamed={renamedTeam} onClose={() => setRenameTeam(null)} />}{teamMotion.shown && teamMotion.value && createPortal(<div className={cn("fixed inset-0 z-40", teamMotion.closing && "pointer-events-none")} onMouseDown={closeTeamMenu}><div role="menu" aria-label={teamMotion.value.name} style={{ left: teamMotion.value.x, top: teamMotion.value.y }}- className={cn("absolute w-[256px] rounded-xl border border-hairline/50 bg-menu p-1.5 text-ink shadow-xl", teamMotion.className)} {...teamMotion.exitProps}+ className={cn("absolute w-[256px] text-ink", MENU_SHEET, teamMotion.className)} {...teamMotion.exitProps}onMouseDown={event => event.stopPropagation()} onKeyDown={event => {if (event.key === "Escape" || event.key === "Tab") { event.preventDefault(); event.stopPropagation(); closeTeamMenu(); return; }navigateThreadMenu(event);diff --git a/src/components/SidebarBotActivity.tsx b/src/components/SidebarBotActivity.tsxindex 528c191be2..ab467554af 100644--- a/src/components/SidebarBotActivity.tsx+++ b/src/components/SidebarBotActivity.tsx@@ -140,7 +140,7 @@ export function crossBotPinnedThreads(bots: Bot[], groups: Group[], queued: Reco: { kind: "bot", botId: botId!, botName: botName!, task });}-export function AttentionThreadRows({ entries, onJump }: { entries: AttentionThread[]; onJump: (entry: AttentionThread) => void }) {+export function AttentionThreadRows({ entries, onJump, inset = false }: { entries: AttentionThread[]; onJump: (entry: AttentionThread) => void; inset?: boolean }) {return <>{entries.map((entry) => {const { Icon, colorClass, label: status } = attentionRowStatus(entry.task);@@ -148,8 +148,8 @@ export function AttentionThreadRows({ entries, onJump }: { entries: AttentionThrconst label = t("attention.item", { title: entry.task.title, name, status });return <button key={`${entry.kind}-${entry.kind === "bot" ? entry.botId : entry.groupId}-${entry.task.threadId}`} type="button" aria-label={label} title={label}onClick={() => onJump(entry)}- className="flex w-full items-center gap-2.5 px-3.5 py-2 text-left text-[13px] text-ink hover:bg-menu-hover">- <Icon size={15} aria-hidden="true" className={cn("shrink-0", colorClass)} />+ className={cn("flex w-full items-center gap-2.5 text-left text-[13px] text-ink hover:bg-menu-hover", inset ? "rounded-md px-2 py-1.5" : "px-3.5 py-2")}>+ <Icon size={inset ? 16 : 15} aria-hidden="true" className={cn("shrink-0", colorClass)} /><span className="min-w-0 flex-1"><span className="block truncate">{entry.task.title}</span><span className="block truncate text-[11px] text-ink-secondary">{name} · {status}</span>diff --git a/src/components/SidebarBotMenu.tsx b/src/components/SidebarBotMenu.tsxindex a7c30cc387..53e110c91e 100644--- a/src/components/SidebarBotMenu.tsx+++ b/src/components/SidebarBotMenu.tsx@@ -1,6 +1,6 @@import { useEffect, useLayoutEffect, useRef, useState } from "react";import { createPortal } from "react-dom";-import { Archive, BellDot, CheckCheck, ChevronRight, ClipboardCopy, Copy, Crown, FolderOpen, FolderPlus, Loader2, MoreHorizontal, Pencil, Pin, PinOff, Plus, SquarePen, Trash2, Users } from "lucide-react";+import { Archive, BellDot, CheckCheck, ChevronRight, ClipboardCopy, Copy, Crown, FolderOpen, FolderPlus, Loader2, MoreHorizontal, Pencil, Pin, PinOff, SquarePen, Trash2, Users } from "lucide-react";import { api, useStore, openBot, type Bot } from "@/state/store";import { cn } from "@/lib/cn";import { useHeldMenuMotion } from "./MenuMotion";@@ -13,7 +13,7 @@ import { useOwnerOrAdmin } from "@/lib/use-owner-or-admin";import { botUnreadThreadIds, markBotRead } from "@/lib/folder-read";import { ownerMenuLabel, pickOwnerOf } from "./TeamOwner";import { mayChangeOwner, useTeamPeople } from "@/state/team-people";-import { SIMPLE_MENU, SIMPLE_MENU_ITEM, SIMPLE_MENU_SEPARATOR } from "./SidebarSimpleTop";+import { MENU_ITEM, MENU_ITEM_SEPARATOR, MENU_SHEET } from "./menu-recipe";import { useShowThreads } from "@/lib/thread-preferences";import { submenuPosition } from "./SidebarPopoverMenu";import { submenuIntent, type SubmenuIntent } from "@/lib/submenu-intent";@@ -168,7 +168,7 @@ export function BotContextMenu({}}title={opts?.hint}className={cn(- simpleMenu ? SIMPLE_MENU_ITEM : "flex w-full items-center gap-3 px-3.5 py-2 text-left text-[14px]",+ MENU_ITEM,opts?.danger ? "text-danger" : "text-ink",opts?.disabled ? "cursor-default opacity-40" : "hover:bg-menu-hover",)}@@ -177,9 +177,7 @@ export function BotContextMenu({{label}</button>);- const divider = (key: string) => simpleMenu- ? <div key={key} role="separator" className={SIMPLE_MENU_SEPARATOR} />- : <div key={key} className="mx-2 my-1 border-t border-hairline/40" />;+ const divider = (key: string) => <div key={key} role="separator" className={MENU_ITEM_SEPARATOR} />;if (simpleMenu) {const showMore = (focus: boolean) => {@@ -231,16 +229,16 @@ export function BotContextMenu({event.preventDefault();showMore(true);}}- className={cn(SIMPLE_MENU_ITEM, "text-ink hover:bg-menu-hover", moreOpen && moreEngaged && "bg-menu-active")}+ className={cn(MENU_ITEM, "text-ink hover:bg-menu-hover", moreOpen && moreEngaged && "bg-menu-active")}><MoreHorizontal size={16} className="text-ink-secondary" /><span className="flex-1">{t("sidebar.bot.more")}</span><ChevronRight size={15} aria-hidden="true" className="text-ink-secondary rtl:-scale-x-100" /></button>);- const leave = bot.defaultBot ? [<HideDefaultBotItem key="hide" bot={bot} onDone={onClose} className={SIMPLE_MENU_ITEM} />] : [+ const leave = bot.defaultBot ? [<HideDefaultBotItem key="hide" bot={bot} onDone={onClose} className={MENU_ITEM} />] : [item(<Archive size={16} className="text-ink-secondary" />, t("sidebar.bot.archive"), () => onArchive(bot), { disabled: archiveBlocked, hint: archiveHint }),- <BotDeleteMenuItem key="delete" deleting={deleting} className={SIMPLE_MENU_ITEM} onClick={() => { onClose(); onDelete(bot); }} />,+ <BotDeleteMenuItem key="delete" deleting={deleting} className={MENU_ITEM} onClick={() => { onClose(); onDelete(bot); }} />,];return <>{clearThreads.dialog}{moveToTeam.dialog}{createPortal(<div@@ -265,7 +263,7 @@ export function BotContextMenu({more.leaveMenu();}}style={{ top: shown.y, left: shown.x }}- className={cn("fixed z-40 max-h-[calc(100dvh-16px)] w-max min-w-[198px] max-w-[calc(100vw-16px)] overflow-y-auto overscroll-contain", SIMPLE_MENU, motion.className)} {...motion.exitProps}+ className={cn("fixed z-40 max-h-[calc(100dvh-16px)] w-max min-w-[198px] max-w-[calc(100vw-16px)] overflow-y-auto overscroll-contain", MENU_SHEET, motion.className)} {...motion.exitProps}>{remoteClient ? [moveToSection, ...(rename ? [divider("rename"), rename] : []), divider("copy"), copyId, moreRow] : [item(@@ -307,7 +305,7 @@ export function BotContextMenu({navigateThreadMenu(event);}}style={{ top: shown.y, left: shown.x }}- className={cn("fixed z-40 max-h-[calc(100dvh-16px)] w-max min-w-[180px] max-w-[calc(100vw-16px)] animate-pop-in overflow-y-auto overscroll-contain", SIMPLE_MENU)}+ className={cn("fixed z-40 max-h-[calc(100dvh-16px)] w-max min-w-[180px] max-w-[calc(100vw-16px)] animate-pop-in overflow-y-auto overscroll-contain", MENU_SHEET)}>{moreItems}</div>,@@ -324,10 +322,10 @@ export function BotContextMenu({aria-label={t("sidebar.bot.actions", { name: bot.name })}onKeyDown={navigateThreadMenu}style={{ top: shown.y, left: shown.x }}- className={cn("popover-surface fixed z-40 max-h-[calc(100dvh-16px)] w-[228px] max-w-[calc(100vw-16px)] overflow-y-auto overscroll-contain rounded-xl border border-hairline/50 bg-menu py-1.5 shadow-2xl shadow-black/60", motion.className)} {...motion.exitProps}+ className={cn("fixed z-40 max-h-[calc(100dvh-16px)] w-max min-w-[198px] max-w-[calc(100vw-16px)] overflow-y-auto overscroll-contain", MENU_SHEET, motion.className)} {...motion.exitProps}>{showThreads && <>- {item(<Plus size={16} className="text-ink-secondary" />, t("task.newShort"), () => dispatch({ type: "newTask", botId: bot.id }))}+ {item(<SquarePen size={16} className="text-ink-secondary" />, t("task.newShort"), () => dispatch({ type: "newTask", botId: bot.id }))}{canChooseFolder && item(<FolderOpen size={16} className="shrink-0 text-ink-secondary" />, t("task.folder.new"), () => onNewTaskFolder(bot.id))}{item(<FolderPlus size={16} className="text-ink-secondary" />, t("folder.new"), () => onNewFolder(bot.id))}</>}@@ -387,12 +385,12 @@ export function BotContextMenu({void copyText(bot.threadId);}),divider("d3"), ...moveToTeam.items(bot, item),- ...(bot.defaultBot ? [<HideDefaultBotItem key="hide" bot={bot} onDone={onClose} />] : [+ ...(bot.defaultBot ? [<HideDefaultBotItem key="hide" bot={bot} onDone={onClose} className={MENU_ITEM} />] : [item(<Archive size={16} className="text-ink-secondary" />, t("sidebar.bot.archive"), () => onArchive(bot), { disabled: archiveBlocked, hint: archiveHint }),- <BotDeleteMenuItem key="delete" deleting={deleting} onClick={() => { onClose(); onDelete(bot); }} />,+ <BotDeleteMenuItem key="delete" deleting={deleting} className={MENU_ITEM} onClick={() => { onClose(); onDelete(bot); }} />,]),]}- {readError?.botId === bot.id && <p role="alert" className="px-3.5 py-2 text-[12px] text-danger">{readError.message}</p>}+ {readError?.botId === bot.id && <p role="alert" className="px-2 py-1.5 text-[12px] text-danger">{readError.message}</p>}</div>,document.body,)}</>;diff --git a/src/components/SidebarPopoverMenu.anchored.test.ts b/src/components/SidebarPopoverMenu.anchored.test.tsindex 235162c9b6..05fd1c3536 100644--- a/src/components/SidebarPopoverMenu.anchored.test.ts+++ b/src/components/SidebarPopoverMenu.anchored.test.ts@@ -4,7 +4,7 @@ import { createRoot, type Root } from "react-dom/client";import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";import {- ANCHORED_MENU_WIDTH,+ MENU_MIN_WIDTH,SidebarPopoverMenu,anchoredMenuPosition,nextMenuIndex,@@ -13,7 +13,7 @@ import {} from "./SidebarPopoverMenu";const viewport = { width: 1280, height: 800 };-const menu = { width: ANCHORED_MENU_WIDTH, height: 300 };+const menu = { width: 280, height: 300 };const wideRow = { left: 12, right: 288, top: 740, bottom: 784 };const avatar = { left: 14, right: 58, top: 740, bottom: 784 };@@ -102,19 +102,19 @@ describe("the anchored menu in a document", () => {host.remove();});- it("portals one 280px sheet to the body, with the group divider and the trailing value and chevron", async () => {+ it("portals one sheet, at least 237px wide, to the body, with the group divider and the trailing value and chevron", async () => {await act(async () => trigger().click());const menu = sheet()!;expect(menu.parentElement).toBe(document.body);expect(menu.style.position).toBe("fixed");- expect(menu.style.width).toBe(`${ANCHORED_MENU_WIDTH}px`);+ expect(menu.style.minWidth).toBe(`${MENU_MIN_WIDTH}px`);expect(menu.getAttribute("role")).toBe("menu");expect(menu.querySelectorAll('[role="separator"]')).toHaveLength(1);expect(menu.textContent).toContain("Pro");const support = [...menu.querySelectorAll('[role="menuitem"]')].find((node) => node.textContent?.includes("Help and support"))!;expect(support.getAttribute("aria-haspopup")).toBe("menu");expect(support.querySelector("svg")).not.toBeNull();- expect(menu.querySelector('[role="menuitem"]')!.className).toContain("text-[15px]");+ expect(menu.querySelector('[role="menuitem"]')!.className).toContain("text-[14px]");});it("opens from the keyboard on the first item and walks the items", async () => {diff --git a/src/components/SidebarPopoverMenu.tsx b/src/components/SidebarPopoverMenu.tsxindex 0936a861c1..c668510fde 100644--- a/src/components/SidebarPopoverMenu.tsx+++ b/src/components/SidebarPopoverMenu.tsx@@ -5,6 +5,7 @@ import { cn } from "@/lib/cn";import { useMenuMotion } from "./MenuMotion";import { popoverClosesOnKey, usePopoverDismiss } from "@/hooks/use-popover-dismiss";import { submenuIntent, type Point, type SubmenuIntent } from "@/lib/submenu-intent";+import { MENU_HEADING, MENU_ITEM_SEPARATOR, MENU_SHEET } from "./menu-recipe";export interface SidebarMenuItem {key: string;@@ -29,9 +30,8 @@ export interface SidebarMenuItem {const OPEN_DELAY_MS = 80;const CLOSE_DELAY_MS = 250;-export const ANCHORED_MENU_WIDTH = 280;-export const COMPACT_MENU_WIDTH = 237;-const COMPACT_SEPARATOR = "mx-1.5 h-px shrink-0 bg-hairline/50";+export const MENU_MIN_WIDTH = 237;+const MENU_MAX_WIDTH = 320;const EDGE_MARGIN = 8;const ANCHOR_GAP = 6;@@ -78,11 +78,8 @@ export function nextMenuIndex(key: string, current: number, count: number): numb}}-type MenuLook = "roomy" | "compact" | "plain";-function MenuRows({items,- look,openSubmenu,engaged = false,onItem,@@ -90,7 +87,6 @@ function MenuRows({onRowLeave,}: {items: SidebarMenuItem[];- look: MenuLook;openSubmenu?: string | null;engaged?: boolean;onItem: (item: SidebarMenuItem, element: HTMLElement, keyboard: boolean) => void;@@ -100,9 +96,9 @@ function MenuRows({return (<>{items.map((item) => (- <div key={item.key} className={look === "compact" ? "flex flex-col gap-1" : undefined}>- {item.separatorBefore && <div role="separator" className={look === "compact" ? COMPACT_SEPARATOR : cn("h-px bg-hairline/50", look === "roomy" ? "mx-3 my-1.5" : "my-1.5")} />}- {item.heading && <div className={look === "compact" ? "px-2 pb-1 pt-2 text-[12px] font-medium leading-4 text-ink-secondary" : "px-3 pb-0.5 pt-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-ink-secondary"}>{item.heading}</div>}+ <div key={item.key} className="flex flex-col gap-1">+ {item.separatorBefore && <div role="separator" className={MENU_ITEM_SEPARATOR} />}+ {item.heading && <div className={MENU_HEADING}>{item.heading}</div>}<buttontype="button"role="menuitem"@@ -115,22 +111,13 @@ function MenuRows({onPointerEnter={(event) => onRowEnter?.(item, event.currentTarget, { x: event.clientX, y: event.clientY })}onPointerLeave={() => onRowLeave?.(item)}className={cn(- "flex w-full items-center text-start disabled:opacity-60 focus-visible:outline-none",- look === "roomy"- ? "min-h-10 gap-3 rounded-lg px-3 py-2 text-[15px] font-medium leading-5 focus-visible:bg-menu-hover"- : look === "compact"- ? "min-h-[30px] gap-2 rounded-md px-2 py-1.5 text-[14px] leading-[18px] focus-visible:bg-menu-hover"- : "gap-3 px-3.5 py-2 text-[14px] focus-visible:bg-menu-hover",- item.active ? "bg-menu-active text-ink" : item.submenu && openSubmenu === item.key && engaged ? cn(look === "compact" ? "bg-menu-active" : "bg-menu-hover", "text-ink") : "text-ink hover:bg-menu-hover",+ "flex min-h-[30px] w-full items-center gap-2 rounded-md px-2 py-1.5 text-start text-[14px] leading-[18px] disabled:opacity-60 focus-visible:bg-menu-hover focus-visible:outline-none",+ item.active || (item.submenu && openSubmenu === item.key && engaged) ? "bg-menu-active text-ink" : "text-ink hover:bg-menu-hover",)}>{item.icon && (<span- className={cn(- "flex shrink-0 items-center justify-center",- look === "compact" ? "size-4 [&>svg]:size-4" : "size-5",- item.active ? "text-accent" : look === "roomy" ? "text-ink" : "text-ink-secondary",- )}+ className={cn("flex size-4 shrink-0 items-center justify-center [&>svg]:size-4", item.active ? "text-accent" : "text-ink-secondary")}>{item.icon}</span>@@ -144,7 +131,7 @@ function MenuRows({) : (<span className="flex-1 truncate">{item.label}</span>)}- {item.value && <span className={cn("shrink-0 font-normal tabular-nums text-ink-secondary", look === "compact" ? "text-[13px] leading-[18px]" : "text-[14px] leading-5")}>{item.value}</span>}+ {item.value && <span className="shrink-0 text-[13px] font-normal leading-[18px] tabular-nums text-ink-secondary">{item.value}</span>}{item.trailing}{item.attention && (<span@@ -154,7 +141,7 @@ function MenuRows({)}/>)}- {(item.submenu || item.chevron) && <ChevronRight size={look === "compact" ? 14 : 16} strokeWidth={look === "compact" ? 1.75 : 2} aria-hidden className="-me-0.5 shrink-0 text-ink-secondary rtl:-scale-x-100" />}+ {(item.submenu || item.chevron) && <ChevronRight size={14} aria-hidden className="-me-0.5 shrink-0 text-ink-secondary rtl:-scale-x-100" />}</button></div>))}@@ -170,7 +157,6 @@ export function SidebarPopoverMenu({ariaLabel,openOnHover = false,placement = "above",- compact = false,triggerClassName = "w-full",triggerTitle,triggerLabel,@@ -179,7 +165,6 @@ export function SidebarPopoverMenu({renderTrigger,}: {placement?: "above" | "below";- compact?: boolean;items: SidebarMenuItem[];ariaLabel: string;openOnHover?: boolean;@@ -342,11 +327,7 @@ export function SidebarPopoverMenu({};const openItem = submenu ? items.find((item) => item.key === submenu) : undefined;- const look: MenuLook = !anchored ? "plain" : compact ? "compact" : "roomy";- const width = compact ? COMPACT_MENU_WIDTH : ANCHORED_MENU_WIDTH;- const sheetClass = look === "compact"- ? "popover-surface flex flex-col gap-1 overflow-hidden rounded-[var(--radius-menu)] border border-hairline/50 bg-menu p-1.5 shadow-lg [&_svg.lucide]:stroke-[1.5]"- : cn("popover-surface overflow-hidden border border-hairline/50 bg-menu shadow-2xl shadow-black/50", look === "roomy" ? "rounded-2xl p-1.5" : "rounded-xl py-1.5");+ const sheetClass = cn(MENU_SHEET, "overflow-hidden");const sheet = motion.shown && (<div@@ -359,7 +340,7 @@ export function SidebarPopoverMenu({onKeyDown={(event) => onMenuKey(event, false)}onPointerMove={(event) => intent.move({ x: event.clientX, y: event.clientY }, Boolean(submenu && subRowRef.current?.contains(event.target as Node)))}onPointerLeave={() => intent.leaveMenu()}- style={anchored ? { position: "fixed", left: position?.left ?? 0, top: position?.top ?? 0, width, maxWidth: `calc(100vw - ${EDGE_MARGIN * 2}px)`, maxHeight: `calc(100vh - ${EDGE_MARGIN * 2}px)`, visibility: position ? undefined : "hidden" } : undefined}+ style={anchored ? { position: "fixed", left: position?.left ?? 0, top: position?.top ?? 0, minWidth: MENU_MIN_WIDTH, width: "max-content", maxWidth: `min(${MENU_MAX_WIDTH}px, calc(100vw - ${EDGE_MARGIN * 2}px))`, maxHeight: `calc(100vh - ${EDGE_MARGIN * 2}px)`, visibility: position ? undefined : "hidden" } : undefined}className={cn(sheetClass,anchored ? "z-[60] overflow-y-auto" : "absolute z-40",@@ -369,7 +350,6 @@ export function SidebarPopoverMenu({><MenuRowsitems={items}- look={look}openSubmenu={submenu}engaged={engaged}onItem={selectItem}@@ -393,12 +373,11 @@ export function SidebarPopoverMenu({onPointerLeave={() => setEngaged(false)}onFocus={() => setEngaged(true)}onBlur={(event) => { if (!(event.relatedTarget instanceof Node && event.currentTarget.contains(event.relatedTarget))) setEngaged(false); }}- style={{ position: "fixed", left: subPosition?.left ?? 0, top: subPosition?.top ?? 0, minWidth: compact ? 200 : 220, width: "max-content", maxWidth: `min(${ANCHORED_MENU_WIDTH + 40}px, calc(100vw - ${EDGE_MARGIN * 2}px))`, maxHeight: `calc(100vh - ${EDGE_MARGIN * 2}px)`, visibility: subPosition ? undefined : "hidden" }}+ style={{ position: "fixed", left: subPosition?.left ?? 0, top: subPosition?.top ?? 0, minWidth: 200, width: "max-content", maxWidth: `min(${MENU_MAX_WIDTH}px, calc(100vw - ${EDGE_MARGIN * 2}px))`, maxHeight: `calc(100vh - ${EDGE_MARGIN * 2}px)`, visibility: subPosition ? undefined : "hidden" }}className={cn(sheetClass, "z-[61] animate-pop-in overflow-y-auto")}><MenuRowsitems={openItem.submenu}- look={look}onItem={(item) => {item.onSelect();if (!item.keepOpen) close(true);diff --git a/src/components/SidebarProfileMenu.tsx b/src/components/SidebarProfileMenu.tsxindex f5ded0490e..a97fd0183e 100644--- a/src/components/SidebarProfileMenu.tsx+++ b/src/components/SidebarProfileMenu.tsx@@ -599,7 +599,6 @@ export function SidebarProfileMenu({ iconOnly = false, rail = false, circle = fa<SidebarPopoverMenuitems={items}ariaLabel={name}- compact={simple}onOpenChange={simple ? setMenuOpen : undefined}triggerClassName={iconOnly || simple ? cn("shrink-0", circle || simple ? "rounded-full" : "rounded-xl") : "w-full"}triggerTitle={iconOnly || simple ? label : undefined}diff --git a/src/components/SidebarSectionPicker.tsx b/src/components/SidebarSectionPicker.tsxindex c71f9cd450..56ff8816c9 100644--- a/src/components/SidebarSectionPicker.tsx+++ b/src/components/SidebarSectionPicker.tsx@@ -4,6 +4,7 @@ import { useStore } from "@/state/store";import { cn } from "@/lib/cn";import { t } from "@/lib/i18n";import { useHeldMenuMotion } from "./MenuMotion";+import { MENU_HEADING, MENU_ITEM, MENU_ITEM_SEPARATOR, MENU_SHEET } from "./menu-recipe";/** "Move to context": the sidebar sections in use, a field for a new one, and "remove from context". */export function SectionPicker({@@ -63,19 +64,19 @@ export function SectionPicker({<divdata-section-pickerstyle={{ top, left }}- className={cn("popover-surface fixed z-40 w-[236px] overflow-hidden rounded-xl border border-hairline/50 bg-menu py-2 shadow-2xl shadow-black/60", motion.className)} {...motion.exitProps}+ className={cn("fixed z-40 w-[236px] overflow-hidden", MENU_SHEET, motion.className)} {...motion.exitProps}>- <div className="px-3.5 pb-1 text-[10px] font-medium uppercase tracking-[0.08em] text-ink-secondary">+ <div className={MENU_HEADING}>{t("sidebar.section.moveToContext")}</div>{sections.length > 0 && (- <div className="flex flex-col gap-0.5 px-1.5 py-1">+ <div className="flex flex-col gap-1">{sections.map((section) => (<buttonkey={section}onClick={() => assign(section)}className={cn(- "flex w-full items-center justify-between gap-2 rounded-lg px-2.5 py-1.5 text-left text-[13px]",+ MENU_ITEM, "justify-between",section === sectionCurrent ? "bg-menu-active text-ink" : "text-ink hover:bg-menu-hover",)}>@@ -86,7 +87,7 @@ export function SectionPicker({</div>)}<form- className="flex items-center gap-1.5 px-2.5 py-1"+ className="flex items-center gap-1.5 p-0.5"onSubmit={(e) => {e.preventDefault();if (!trimmed || trimmed.length > 60) return;@@ -100,27 +101,24 @@ export function SectionPicker({onChange={(e) => setName(e.target.value)}placeholder={t("sidebar.section.newContext")}aria-label={t("sidebar.section.newContextAria")}- className="w-full rounded-lg bg-raised/70 px-2.5 py-1.5 text-[13px] text-ink placeholder:text-ink-secondary focus:outline-none"+ className="w-full rounded-md bg-ink/[0.05] px-2 py-1.5 text-[13px] text-ink placeholder:text-ink-tertiary focus:outline-none"/><buttontype="submit"disabled={!trimmed || trimmed.length > 60}- className={cn(- "shrink-0 rounded-lg px-2.5 py-1.5 text-[12px] font-medium",- trimmed ? "bg-accent text-panel" : "bg-raised/70 text-ink-secondary",- )}+ className="ui-button ui-button-md ui-button-primary shrink-0">{t("common.add")}</button></form>{sectionCurrent && (<>- <div className="mx-2 my-1 border-t border-hairline/40" />+ <div role="separator" className={MENU_ITEM_SEPARATOR} /><buttononClick={() => assign("")}- className="flex w-full items-center gap-3 px-3.5 py-2 text-left text-[13px] text-danger hover:bg-menu-hover"+ className={cn(MENU_ITEM, "text-danger hover:bg-menu-hover")}>- <FolderMinus size={15} />+ <FolderMinus size={16} />{t("sidebar.section.removeFromContext")}</button></>diff --git a/src/components/SidebarSimpleTop.tsx b/src/components/SidebarSimpleTop.tsxindex 5ff126536a..10c3340932 100644--- a/src/components/SidebarSimpleTop.tsx+++ b/src/components/SidebarSimpleTop.tsx@@ -6,9 +6,6 @@ import { cn } from "@/lib/cn";import { t } from "@/lib/i18n";import { ELEVATED_CONTROL, ELEVATED_HOVER } from "./elevated";-export const SIMPLE_MENU = "popover-surface flex flex-col gap-1 rounded-[var(--radius-menu)] border border-hairline/50 bg-menu p-1.5 shadow-lg [&_svg.lucide]:stroke-[1.5]";-export const SIMPLE_MENU_ITEM = "flex min-h-[30px] w-full shrink-0 items-center gap-2 whitespace-nowrap rounded-md px-2 py-1.5 text-left text-[14px] leading-[18px] focus-visible:bg-menu-hover";-export const SIMPLE_MENU_SEPARATOR = "mx-1.5 h-px shrink-0 bg-hairline/50";/** Keyboard focus on a Simple row or tile: the focus ring drawn inside its edge. */export const SIMPLE_ROW_FOCUS = "focus-visible:outline-2 focus-visible:-outline-offset-2! focus-visible:outline-focus";diff --git a/src/components/SidebarTeamMenu.tsx b/src/components/SidebarTeamMenu.tsxindex 767ba99bd2..6743ac5ff3 100644--- a/src/components/SidebarTeamMenu.tsx+++ b/src/components/SidebarTeamMenu.tsx@@ -1,6 +1,7 @@-import { Network, Pencil, Share2, SlidersHorizontal, Trash2, UserRound, Users } from "lucide-react";+import { Network, Share2, SlidersHorizontal, SquarePen, Trash2, UserRound, Users } from "lucide-react";import { cn } from "@/lib/cn";import { t } from "@/lib/i18n";+import { MENU_ITEM } from "./menu-recipe";export { showWhoReportsToWhom } from "./TeamOrgChart";@@ -14,16 +15,16 @@ export function TeamMenuItems({ onAddBots, onRename, onShare, onDelete, onSetForonSetOwner?: () => void;onSeeReports?: () => void;}) {- const item = "flex w-full items-center gap-2 rounded-lg px-3 py-2 text-left text-[13px] hover:bg-raised";+ const item = cn(MENU_ITEM, "hover:bg-menu-hover [&>svg]:text-ink-secondary");return (<>- <button type="button" role="menuitem" autoFocus className={item} onClick={onAddBots}><Users size={14} />{t("team.addBots")}</button>- {onSetOwner && <button type="button" role="menuitem" className={item} onClick={onSetOwner}><UserRound size={14} />{t("owner.setForAll")}</button>}- {onSeeReports && <button type="button" role="menuitem" className={item} onClick={onSeeReports}><Network size={14} />{t("orgChart.seeWho")}</button>}- {onSetForAll && <button type="button" role="menuitem" className={item} onClick={onSetForAll}><SlidersHorizontal size={14} />{t("teamSettings.menu")}</button>}- <button type="button" role="menuitem" className={item} onClick={onRename}><Pencil size={14} />{t("team.rename")}</button>- <button type="button" role="menuitem" className={item} onClick={onShare}><Share2 size={14} />{t("team.share")}</button>- <button type="button" role="menuitem" className={cn(item, "text-danger")} onClick={onDelete}><Trash2 size={14} />{t("team.delete")}</button>+ <button type="button" role="menuitem" autoFocus className={item} onClick={onAddBots}><Users size={16} />{t("team.addBots")}</button>+ {onSetOwner && <button type="button" role="menuitem" className={item} onClick={onSetOwner}><UserRound size={16} />{t("owner.setForAll")}</button>}+ {onSeeReports && <button type="button" role="menuitem" className={item} onClick={onSeeReports}><Network size={16} />{t("orgChart.seeWho")}</button>}+ {onSetForAll && <button type="button" role="menuitem" className={item} onClick={onSetForAll}><SlidersHorizontal size={16} />{t("teamSettings.menu")}</button>}+ <button type="button" role="menuitem" className={item} onClick={onRename}><SquarePen size={16} />{t("team.rename")}</button>+ <button type="button" role="menuitem" className={item} onClick={onShare}><Share2 size={16} />{t("team.share")}</button>+ <button type="button" role="menuitem" className={cn(item, "text-danger [&>svg]:text-danger")} onClick={onDelete}><Trash2 size={16} />{t("team.delete")}</button></>);}diff --git a/src/components/SidebarThreadRow.tsx b/src/components/SidebarThreadRow.tsxindex 8af3ae6991..61fb9b99ba 100644--- a/src/components/SidebarThreadRow.tsx+++ b/src/components/SidebarThreadRow.tsx@@ -3,6 +3,7 @@ import { createPortal } from "react-dom";import { Archive, ArchiveRestore, BellOff, Check, ChevronRight, Clock, Clock3, FolderInput, Link2, Link2Off, Loader2, MoreHorizontal, Pencil, Pin, PinOff, RefreshCw, Trash2 } from "lucide-react";import type { Action, AppState, BotProject, Task } from "@/state/store";import { cn } from "@/lib/cn";+import { MENU_SHEET } from "./menu-recipe";import { useHeldMenuMotion } from "./MenuMotion";import { t } from "@/lib/i18n";import { nextRename } from "@/lib/rename";@@ -351,31 +352,31 @@ export const SidebarThreadRow = memo(function SidebarThreadRow({ task, ownerId,</button>}</div>{menuMotion.shown && menuMotion.value && createPortal(<div ref={menuRef} data-thread-overlay role="group" aria-label={t("task.actions", { title: displayTitle })} style={menuMotion.value}- className={cn("fixed z-50 max-h-[calc(100vh-16px)] w-[220px] overflow-y-auto rounded-lg border border-hairline/50 bg-card p-1 shadow-xl", menuMotion.className)} {...menuMotion.exitProps}+ className={cn("fixed z-50 max-h-[calc(100vh-16px)] w-[220px] overflow-y-auto", MENU_SHEET, menuMotion.className)} {...menuMotion.exitProps}onKeyDown={(event) => { if (event.key === "Escape") { event.preventDefault(); event.stopPropagation(); setMenu(null); actionRef.current?.focus(); } }}>- <button type="button" onClick={copyLink} className="flex w-full items-center gap-2 rounded px-2.5 py-2 text-left text-[12px] text-ink hover:bg-raised"><Link2 size={12} />{t("task.copyLink")}</button>- <button type="button" onClick={startRename} className="flex w-full items-center gap-2 rounded px-2.5 py-2 text-left text-[12px] text-ink hover:bg-raised"><Pencil size={12} />{t("task.renameAria")}</button>- {onRegenerateTitle && <button type="button" disabled={regenerating} aria-busy={regenerating} onClick={regenerateTitle} className="flex w-full items-center gap-2 rounded px-2.5 py-2 text-left text-[12px] text-ink hover:bg-raised disabled:opacity-40">{regenerating ? <Loader2 size={12} className="animate-spin" /> : <RefreshCw size={12} />}{regenerating ? t("task.regeneratingTitle") : t("task.regenerateTitle")}</button>}- {onMove && Boolean(folders?.length) && <label className="block rounded px-2.5 py-2 text-[12px] text-ink"><span className="mb-1 flex items-center gap-2 text-ink-secondary"><FolderInput size={12} />{t("folder.move")}</span>+ <button type="button" onClick={copyLink} className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[14px] leading-[18px] text-ink hover:bg-menu-hover"><Link2 size={16} />{t("task.copyLink")}</button>+ <button type="button" onClick={startRename} className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[14px] leading-[18px] text-ink hover:bg-menu-hover"><Pencil size={16} />{t("task.renameAria")}</button>+ {onRegenerateTitle && <button type="button" disabled={regenerating} aria-busy={regenerating} onClick={regenerateTitle} className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[14px] leading-[18px] text-ink hover:bg-menu-hover disabled:opacity-40">{regenerating ? <Loader2 size={16} className="animate-spin" /> : <RefreshCw size={16} />}{regenerating ? t("task.regeneratingTitle") : t("task.regenerateTitle")}</button>}+ {onMove && Boolean(folders?.length) && <label className="block rounded-md px-2 py-1.5 text-[13px] text-ink"><span className="mb-1 flex items-center gap-2 text-ink-secondary"><FolderInput size={16} />{t("folder.move")}</span><Select size="sm" className="w-full" aria-label={t("folder.moveNamed", { title: task.title })} value={folders?.some((folder) => folder.id === task.projectId) ? task.projectId : ""}onChange={(event) => { onMove(task, event.target.value || null); setMenu(null); }}><option value="">{t("folder.none")}</option>{folders?.map((folder) => <option key={folder.id} value={folder.id}>{folder.emoji ? `${folder.emoji} ` : ""}{folder.name}</option>)}</Select></label>}- {onPin && <button type="button" onClick={() => { setMenu(null); onPin(task, task.pinned !== true); }} className="flex w-full items-center gap-2 rounded px-2.5 py-2 text-left text-[12px] text-ink hover:bg-raised">{task.pinned === true ? <PinOff size={12} /> : <Pin size={12} />}{task.pinned === true ? t("sidebar.bot.unpin") : t("sidebar.bot.pin")}</button>}- {onLink && task.link && <button type="button" onClick={() => { setMenu(null); onLink(task, null); }} className="flex w-full items-center gap-2 rounded px-2.5 py-2 text-left text-[12px] text-ink hover:bg-raised"><Link2Off size={12} />{t("task.removeLink")}</button>}- {onArchive && <button type="button" disabled={isWorking(task)} onClick={() => { setMenu(null); onArchive(task, isArchived(task) ? null : Date.now()); }} className="flex w-full items-center gap-2 rounded px-2.5 py-2 text-left text-[12px] text-ink hover:bg-raised disabled:opacity-40">{archived ? <ArchiveRestore size={12} /> : <Archive size={12} />}{archived ? t("task.unarchive") : t("task.archive")}</button>}- {onSnooze && <div className="px-2.5 pt-1">- <span className="flex items-center gap-2 text-[11px] text-ink-secondary"><Clock size={12} />{t("task.snooze")}</span>+ {onPin && <button type="button" onClick={() => { setMenu(null); onPin(task, task.pinned !== true); }} className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[14px] leading-[18px] text-ink hover:bg-menu-hover">{task.pinned === true ? <PinOff size={16} /> : <Pin size={16} />}{task.pinned === true ? t("sidebar.bot.unpin") : t("sidebar.bot.pin")}</button>}+ {onLink && task.link && <button type="button" onClick={() => { setMenu(null); onLink(task, null); }} className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[14px] leading-[18px] text-ink hover:bg-menu-hover"><Link2Off size={16} />{t("task.removeLink")}</button>}+ {onArchive && <button type="button" disabled={isWorking(task)} onClick={() => { setMenu(null); onArchive(task, isArchived(task) ? null : Date.now()); }} className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[14px] leading-[18px] text-ink hover:bg-menu-hover disabled:opacity-40">{archived ? <ArchiveRestore size={16} /> : <Archive size={16} />}{archived ? t("task.unarchive") : t("task.archive")}</button>}+ {onSnooze && <div className="px-2 pt-1">+ <span className="flex items-center gap-2 text-[12px] font-medium text-ink-secondary"><Clock size={16} />{t("task.snooze")}</span><div className="mt-0.5 flex flex-col">{[{ label: t("task.snoozeUntilActivity"), at: 0 }, { label: t("task.snoozeTonight"), at: nextSixPm() }, { label: t("task.snoozeTomorrow"), at: tomorrowNineAm() }].map((preset) => (- <button key={preset.label} type="button" disabled={isWorking(task)} onClick={() => { setMenu(null); onSnooze(task, preset.at); }} className="flex w-full items-center rounded px-2.5 py-1.5 text-left text-[12px] text-ink hover:bg-raised disabled:opacity-40">{preset.label}</button>+ <button key={preset.label} type="button" disabled={isWorking(task)} onClick={() => { setMenu(null); onSnooze(task, preset.at); }} className="flex w-full items-center rounded-md px-2 py-1.5 text-left text-[14px] leading-[18px] text-ink hover:bg-menu-hover disabled:opacity-40">{preset.label}</button>))}</div></div>}- {onSnooze && snoozed && <button type="button" onClick={() => { setMenu(null); onSnooze(task, null); }} className="flex w-full items-center gap-2 rounded px-2.5 py-2 text-left text-[12px] text-ink hover:bg-raised"><BellOff size={12} />{t("task.stopSnoozing")}</button>}- {onRefreshPermissions && <button type="button" disabled={isWorking(task)} title={t("task.refreshPermissionsHint")} onClick={() => { setMenu(null); onRefreshPermissions(task); }} className="flex w-full items-center gap-2 rounded px-2.5 py-2 text-left text-[12px] text-ink hover:bg-raised disabled:opacity-40"><RefreshCw size={12} />{t("task.refreshPermissions")}</button>}- <button type="button" disabled={isWorking(task)} onClick={() => { setMenu(null); setDeleting(true); }} className="flex w-full items-center gap-2 rounded px-2.5 py-2 text-left text-[12px] text-danger hover:bg-raised disabled:opacity-40"><Trash2 size={12} />{t("task.deleteAria")}</button>+ {onSnooze && snoozed && <button type="button" onClick={() => { setMenu(null); onSnooze(task, null); }} className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[14px] leading-[18px] text-ink hover:bg-menu-hover"><BellOff size={16} />{t("task.stopSnoozing")}</button>}+ {onRefreshPermissions && <button type="button" disabled={isWorking(task)} title={t("task.refreshPermissionsHint")} onClick={() => { setMenu(null); onRefreshPermissions(task); }} className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[14px] leading-[18px] text-ink hover:bg-menu-hover disabled:opacity-40"><RefreshCw size={16} />{t("task.refreshPermissions")}</button>}+ <button type="button" disabled={isWorking(task)} onClick={() => { setMenu(null); setDeleting(true); }} className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[14px] leading-[18px] text-danger hover:bg-menu-hover disabled:opacity-40"><Trash2 size={16} />{t("task.deleteAria")}</button></div>, document.body)}<ConfirmDialog open={deleting} title={t("task.deleteConfirm")} body={t("task.deleteBody", { title: task.title })} confirmLabel={t("task.deleteAria")}onCancel={() => setDeleting(false)} onConfirm={() => { if (!isWorking(task)) onDelete(task); setDeleting(false); }} returnFocusRef={actionRef} />diff --git a/src/components/TaskPicker.tsx b/src/components/TaskPicker.tsxindex a41d777264..caad303d47 100644--- a/src/components/TaskPicker.tsx+++ b/src/components/TaskPicker.tsx@@ -1,7 +1,8 @@import { Fragment, useEffect, useMemo, useRef, useState } from "react";-import { Activity, Check, ChevronDown, FolderInput, Pencil, Pin, PinOff, Plus, Search, Trash2 } from "lucide-react";+import { Activity, Check, ChevronDown, FolderInput, Pin, PinOff, Search, SquarePen, Trash2 } from "lucide-react";import { useStore, type Bot, type BotProject, type Group, type Task } from "@/state/store";import { cn } from "@/lib/cn";+import { MENU_ITEM_SEPARATOR, MENU_SHEET } from "./menu-recipe";import { roomThreadsWorkingElsewhere } from "@/lib/room-threads";import { useMenuMotion } from "./MenuMotion";import { t } from "@/lib/i18n";@@ -245,10 +246,10 @@ function ConversationTaskPicker({</button>{motion.shown && (- <div className={cn("popover-surface absolute right-0 top-full z-40 mt-1 w-[300px] overflow-hidden rounded-xl border border-hairline/50 bg-card py-1 shadow-2xl shadow-black/50", motion.className)} {...motion.exitProps}>- <div className="px-2 pb-1 pt-1.5">- <div className="flex items-center gap-2 rounded-lg border border-hairline/40 bg-inset px-2.5 py-1.5 focus-within:border-focus">- <Search size={13} className="shrink-0 text-ink-secondary" />+ <div className={cn("absolute right-0 top-full z-40 mt-1 w-[300px] overflow-hidden", MENU_SHEET, motion.className)} {...motion.exitProps}>+ <div>+ <div className="flex items-center gap-2 rounded-md bg-ink/[0.05] px-2 py-1.5 focus-within:ring-2 focus-within:ring-focus/60">+ <Search size={14} className="shrink-0 text-ink-secondary" /><inputautoFocusvalue={query}@@ -274,17 +275,17 @@ function ConversationTaskPicker({}}placeholder={t("task.search")}aria-label={t("task.search")}- className="w-full bg-transparent text-[13px] text-ink placeholder:text-ink-secondary focus:outline-none"+ className="w-full bg-transparent text-[13px] text-ink placeholder:text-ink-tertiary focus:outline-none"/></div></div><div className="max-h-[320px] overflow-y-auto" role="group" aria-label={looking ? t("task.matching", { count: results.length }) : t("task.list")}>{attentionRows.length > 0 && <div className="pb-1">- <div className="flex items-center gap-1.5 px-3 pb-1 pt-1.5 text-[11px] font-medium text-ink-secondary"><Activity size={12} />{t("attention.title")}</div>- <AttentionThreadRows entries={attentionRows} onJump={(entry) => { onAttentionJump?.(entry); closeMenu(); }} />+ <div className="flex items-center gap-1.5 px-2 pb-1 pt-1.5 text-[12px] font-medium text-ink-secondary"><Activity size={14} />{t("attention.title")}</div>+ <AttentionThreadRows inset entries={attentionRows} onJump={(entry) => { onAttentionJump?.(entry); closeMenu(); }} /></div>}{results.length === 0 ? (- <div className="px-3 py-6 text-center text-[13px] text-ink-secondary">+ <div className="px-2 py-6 text-center text-[13px] text-ink-secondary">{t("task.noMatch", { query: looking })}</div>) : visible.map((task, index) => {@@ -293,11 +294,11 @@ function ConversationTaskPicker({const heading = grouped?.find((group) => group.tasks[0]?.threadId === task.threadId)?.project;return (<Fragment key={task.threadId}>- {bot?.projects?.length && heading ? <div className={cn("flex items-center gap-1.5 px-3 pb-1 pt-2 text-[11px] font-medium text-ink-secondary", index > 0 && "border-t border-hairline/30")}>{heading.id && <FolderIcon emoji={heading.emoji} size={12} />}{heading.name}</div> : null}+ {bot?.projects?.length && heading ? <div className={cn("flex items-center gap-1.5 px-2 pb-1 pt-2 text-[12px] font-medium text-ink-secondary", index > 0 && "border-t border-hairline/30")}>{heading.id && <FolderIcon emoji={heading.emoji} size={12} />}{heading.name}</div> : null}<div- className={cn("group flex items-center gap-2 px-2.5 py-2", active ? "bg-raised/60" : "hover:bg-raised/40")}+ className={cn("group flex items-center gap-2 rounded-md px-2 py-1.5", active ? "bg-menu-active" : "hover:bg-menu-hover")}>- <Check size={13} className={cn("shrink-0", active ? "text-accent" : "opacity-0")} />+ <Check size={14} className={cn("shrink-0", active ? "text-accent" : "opacity-0")} />{renaming === task.threadId ? (<inputautoFocus@@ -344,7 +345,7 @@ function ConversationTaskPicker({className="min-w-0 flex-1 text-left"title={t("task.renameHint")}>- <div dir="auto" className="truncate text-[13px] text-ink">{localizedTaskTitle(task.title)}</div>+ <div dir="auto" className="truncate text-[14px] leading-[18px] text-ink">{localizedTaskTitle(task.title)}</div><div className="text-[11px] text-ink-secondary">{task.activity === "waiting-on-you" ? `${t("task.waiting")} · ` : task.waitingForTeammates ? `${t("task.waitingOnTeammate")} · ` : task.busy ? `${t("chat.activity.working")} · ` : task.unread ? `${t("task.unread")} · ` : ""}<TaskUpdatedTime task={task} now={now} />@@ -359,9 +360,9 @@ function ConversationTaskPicker({onClick={() => onPin(task.threadId, task.pinned !== true)}aria-label={task.pinned === true ? t("sidebar.bot.unpin") : t("sidebar.bot.pin")}title={task.pinned === true ? t("sidebar.bot.unpin") : t("sidebar.bot.pin")}- className="rounded p-1 text-ink-secondary opacity-0 hover:bg-raised hover:text-ink focus-visible:opacity-100 group-hover:opacity-100 touch:opacity-70"+ className="rounded-md p-1 text-ink-secondary opacity-0 hover:bg-menu-hover hover:text-ink focus-visible:opacity-100 group-hover:opacity-100 touch:opacity-70">- {task.pinned === true ? <PinOff size={13} /> : <Pin size={13} />}+ {task.pinned === true ? <PinOff size={14} /> : <Pin size={14} />}</button>)}{renaming !== task.threadId && (@@ -370,13 +371,13 @@ function ConversationTaskPicker({onClick={() => startRename(task)}aria-label={t("task.renameNamed", { title: task.title })}title={t("task.renameTitle")}- className="rounded p-1 text-ink-secondary opacity-0 hover:bg-raised hover:text-ink focus-visible:opacity-100 group-hover:opacity-100 touch:opacity-70"+ className="rounded-md p-1 text-ink-secondary opacity-0 hover:bg-menu-hover hover:text-ink focus-visible:opacity-100 group-hover:opacity-100 touch:opacity-70">- <Pencil size={13} />+ <SquarePen size={14} /></button>)}- {bot && onMove && (bot.projects?.length ?? 0) > 0 && <label title={t("folder.move")} className="relative rounded p-1 text-ink-secondary opacity-0 hover:bg-raised hover:text-ink focus-within:opacity-100 group-hover:opacity-100 touch:opacity-70">- <FolderInput size={13} />+ {bot && onMove && (bot.projects?.length ?? 0) > 0 && <label title={t("folder.move")} className="relative rounded-md p-1 text-ink-secondary opacity-0 hover:bg-menu-hover hover:text-ink focus-within:opacity-100 group-hover:opacity-100 touch:opacity-70">+ <FolderInput size={14} /><select aria-label={t("folder.moveNamed", { title: task.title })} value={bot.projects?.some((project) => project.id === task.projectId) ? task.projectId : ""}onFocus={clearDismiss} onChange={(event) => { clearDismiss(); onMove(task.threadId, event.target.value || null); }}className="absolute inset-0 w-full cursor-pointer opacity-0">@@ -390,25 +391,26 @@ function ConversationTaskPicker({disabled={Boolean(task.busy) || busy && active}aria-label={t("task.deleteAria")}title={t("task.deleteTitle")}- className="rounded p-1 text-ink-secondary opacity-0 hover:bg-raised hover:text-danger focus-visible:opacity-100 group-hover:opacity-100 disabled:opacity-20 touch:opacity-70 touch:disabled:opacity-20"+ className="rounded-md p-1 text-ink-secondary opacity-0 hover:bg-menu-hover hover:text-danger focus-visible:opacity-100 group-hover:opacity-100 disabled:opacity-20 touch:opacity-70 touch:disabled:opacity-20">- <Trash2 size={13} />+ <Trash2 size={14} /></button></div></Fragment>);})}</div>- {bot ? <NewThreadButton bot={bot} onCreated={closeMenu} className="mt-1 w-full rounded-none border-t border-hairline/40" /> : <button+ <div role="separator" className={MENU_ITEM_SEPARATOR} />+ {bot ? <NewThreadButton bot={bot} onCreated={closeMenu} className="min-h-[30px] w-full rounded-md px-2 text-[14px] text-ink hover:bg-menu-hover" /> : <buttontype="button"onClick={() => {onNew();closeMenu();}}disabled={busy}- className="mt-1 flex w-full items-center gap-2 border-t border-hairline/40 px-3 py-2 text-left text-[13px] text-ink hover:bg-raised/50 disabled:opacity-40"+ className="flex min-h-[30px] w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[14px] text-ink hover:bg-menu-hover disabled:opacity-40">- <Plus size={13} className="text-ink-secondary" /> {t("task.newShort")}+ <SquarePen size={16} className="text-ink-secondary" /> {t("task.newShort")}</button>}</div>)}diff --git a/src/components/TeamOwner.tsx b/src/components/TeamOwner.tsxindex 67452f1475..9d4d6aa883 100644--- a/src/components/TeamOwner.tsx+++ b/src/components/TeamOwner.tsx@@ -10,6 +10,7 @@ import { useShowThreads } from "@/lib/thread-preferences";import { askingWhom, departmentOwner, mayChangeOwner, ownerChanged, ownerOf, pictureOf, refreshNeedsYou, useTeamPeople, type TeamPeople, type TeamPerson } from "@/state/team-people";import type { NeedsYouItem } from "../../shared/today";import { useHeldMenuMotion } from "./MenuMotion";+import { MENU_HEADING, MENU_SHEET } from "./menu-recipe";export type OwnerPickerTarget = { botIds: string[]; title: string; current: string | null; x: number; y: number };@@ -100,13 +101,13 @@ export function OwnerPicker({ target, onClose }: { target: OwnerPickerTarget | nconst left = Math.max(8, Math.min(shown.x, window.innerWidth - 260));return createPortal(<div data-owner-picker role="menu" aria-label={shown.title} style={{ top, left }}- className={cn("popover-surface fixed z-50 w-[248px] overflow-hidden rounded-xl border border-hairline/50 bg-menu py-2 shadow-2xl shadow-black/60", motion.className)} {...motion.exitProps}>- <div className="px-3.5 pb-1 text-[10px] font-medium uppercase tracking-[0.08em] text-ink-secondary">{shown.title}</div>- <div className="flex max-h-[260px] flex-col gap-0.5 overflow-y-auto px-1.5 py-1">+ className={cn("fixed z-50 w-[248px] overflow-hidden", MENU_SHEET, motion.className)} {...motion.exitProps}>+ <div className={MENU_HEADING}>{shown.title}</div>+ <div className="flex max-h-[260px] flex-col gap-1 overflow-y-auto">{team.people.map((person) => (<button key={person.email} type="button" role="menuitemradio" aria-checked={person.email === shown.current} disabled={busy}onClick={() => void pick(person)}- className={cn("flex w-full items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-left text-[13px] text-ink", person.email === shown.current ? "bg-menu-active" : "hover:bg-menu-hover")}>+ className={cn("flex w-full items-center gap-2.5 rounded-md px-2 py-1.5 text-left text-[14px] leading-[18px] text-ink", person.email === shown.current ? "bg-menu-active" : "hover:bg-menu-hover")}><PersonFace person={person} size={20} /><span className="min-w-0 flex-1"><span className="block truncate">{person.you ? t("owner.you", { name: person.name }) : person.name}</span>@@ -116,7 +117,7 @@ export function OwnerPicker({ target, onClose }: { target: OwnerPickerTarget | n</button>))}</div>- <div className="px-3.5 pt-1 text-[11px] leading-snug text-ink-secondary">{t("owner.pickHint")}</div>+ <div className="px-2 pb-1 text-[12px] leading-4 text-ink-tertiary">{t("owner.pickHint")}</div></div>,document.body,);@@ -175,7 +176,7 @@ export function NeedsYouButton({ compact = false }: { compact?: boolean }) {<span className="rounded-full bg-warning px-1.5 text-[11px] font-semibold tabular-nums text-panel">{items.length}</span></button>{open && (- <div role="menu" aria-label={t("needsYou.title")} className="popover-surface absolute left-2 right-2 top-full z-40 mt-1 max-h-[340px] overflow-y-auto rounded-xl border border-hairline/50 bg-menu py-1.5 shadow-2xl shadow-black/60">+ <div role="menu" aria-label={t("needsYou.title")} className={cn("absolute left-2 right-2 top-full z-40 mt-1 max-h-[340px] overflow-y-auto", MENU_SHEET)}>{items.map((item) => {const botId = "botId" in item ? item.botId : item.botIds[0]!;const title = item.kind === "message" ? t("needsYou.message", { name: item.from })@@ -188,7 +189,7 @@ export function NeedsYouButton({ compact = false }: { compact?: boolean }) {openThread(dispatch, { botId, threadId: item.threadId }, state, showThreads);if (item.kind === "message") readConversation(state.groups, botId, item.threadId);}}- className="flex w-full flex-col items-start px-3.5 py-2 text-left hover:bg-menu-hover">+ className="flex w-full flex-col items-start rounded-md px-2 py-1.5 text-left hover:bg-menu-hover"><NeedsYouTitle item={item} title={title} />{text && <span className="w-full truncate text-[12px] text-ink-secondary">{text}</span>}</button>;diff --git a/src/components/ThreadLinkMenu.tsx b/src/components/ThreadLinkMenu.tsxindex e43d9a453b..a0c737d660 100644--- a/src/components/ThreadLinkMenu.tsx+++ b/src/components/ThreadLinkMenu.tsx@@ -4,10 +4,12 @@ import { Link2, Link2Off, Pin } from "lucide-react";import { t } from "@/lib/i18n";import { copyText } from "@/lib/copy-text";import { threadLinkUrl } from "../../shared/thread-link";+import { MENU_ITEM, MENU_SHEET } from "./menu-recipe";+import { cn } from "@/lib/cn";export const ThreadLinkContext = createContext<{ link?: string; assign: (link: string | null) => void } | null>(null);-const ITEM_CLASS = "flex w-full items-center gap-2 rounded px-2.5 py-2 text-left text-[12px] text-ink hover:bg-raised";+const ITEM_CLASS = `${MENU_ITEM} text-ink hover:bg-menu-hover [&>svg]:text-ink-secondary`;export function useThreadLinkMenu(href: string | undefined) {const thread = useContext(ThreadLinkContext);@@ -31,12 +33,12 @@ export function useThreadLinkMenu(href: string | undefined) {setAt({ left: Math.max(8, Math.min(event.clientX, window.innerWidth - 228)), top: Math.max(8, Math.min(event.clientY, window.innerHeight - 100)) });},menu: at && createPortal(<div ref={menuRef} role="group" aria-label={url} style={at}- className="fixed z-50 w-[220px] rounded-lg border border-hairline/50 bg-card p-1 shadow-xl"+ className={cn("fixed z-50 w-[220px]", MENU_SHEET)}onKeyDown={(event) => { if (event.key === "Escape") { event.preventDefault(); event.stopPropagation(); setAt(null); } }}><button type="button" onClick={run(() => thread.assign(assigned ? null : url))} className={ITEM_CLASS}>- {assigned ? <Link2Off size={12} /> : <Pin size={12} />}{t(assigned ? "task.unassignLink" : "task.assignLink")}+ {assigned ? <Link2Off size={16} /> : <Pin size={16} />}{t(assigned ? "task.unassignLink" : "task.assignLink")}</button>- <button type="button" onClick={run(() => void copyText(url))} className={ITEM_CLASS}><Link2 size={12} />{t("task.copyLink")}</button>+ <button type="button" onClick={run(() => void copyText(url))} className={ITEM_CLASS}><Link2 size={16} />{t("task.copyLink")}</button></div>, document.body),};}diff --git a/src/components/bot-panel/rows.tsx b/src/components/bot-panel/rows.tsxindex dd02a92af2..b960f70bed 100644--- a/src/components/bot-panel/rows.tsx+++ b/src/components/bot-panel/rows.tsx@@ -8,7 +8,7 @@ import { ELEVATED_CONTROL, ELEVATED_HOVER } from "../elevated";import { Switch } from "../SettingsPrimitives";export const rowCls = "flex min-h-[46px] items-center gap-2.5 px-3.5 py-[11px]";-export const roundButtonCls = `flex size-[34px] shrink-0 items-center justify-center rounded-full text-ink ${ELEVATED_CONTROL} ${ELEVATED_HOVER} [:root[data-interface=simple][data-skin=daylight]_&]:shadow-[0_1px_3px_rgb(28_28_28/0.12)]`;+export const roundButtonCls = `flex size-[34px] shrink-0 items-center justify-center rounded-full text-ink ${ELEVATED_CONTROL} ${ELEVATED_HOVER} [:root[data-skin=daylight]_&]:shadow-[0_1px_3px_rgb(28_28_28/0.12)]`;const titleCls = "text-[14px] font-medium text-ink";const hintCls = "mt-px text-[13px] leading-[1.35] text-ink-secondary";export const buttonCls =diff --git a/src/components/bot-settings/OverviewSection.tsx b/src/components/bot-settings/OverviewSection.tsxindex bb6dd75091..af6bb62c22 100644--- a/src/components/bot-settings/OverviewSection.tsx+++ b/src/components/bot-settings/OverviewSection.tsx@@ -1,5 +1,5 @@import { useState } from "react";-import { Circle, Sparkles } from "lucide-react";+import { ChevronRight, Circle, Sparkles } from "lucide-react";import type { BotOverview } from "@/lib/bot-overview-types";import { t } from "@/lib/i18n";@@ -78,7 +78,7 @@ export function OverviewSection({><Circle aria-hidden="true" size={14} className="shrink-0 text-ink-secondary" /><span className="flex-1">{setupLabel(step.id, step.label)}</span>- <span className="text-[12px] text-ink-secondary">→</span>+ <ChevronRight size={14} aria-hidden="true" className="shrink-0 text-ink-secondary rtl:-scale-x-100" /></button>)}</li>@@ -167,7 +167,7 @@ export function OverviewSection({onClick={() => onOpen("history")}className="shrink-0 text-[12px] text-ink-secondary hover:text-ink">- {t("botOverview.viewAll")} →+ {t("botOverview.viewAll")} <ChevronRight size={14} aria-hidden="true" className="inline align-[-2px] rtl:-scale-x-100" /></button></div>{overview.recent.length === 0 ? (diff --git a/src/components/bot-settings/RoutinesSection.tsx b/src/components/bot-settings/RoutinesSection.tsxindex 1dfa30cbb7..d113d90fc0 100644--- a/src/components/bot-settings/RoutinesSection.tsx+++ b/src/components/bot-settings/RoutinesSection.tsx@@ -1,4 +1,4 @@-import { CalendarClock, FileText, Plus } from "lucide-react";+import { CalendarClock, ChevronRight, FileText, Plus } from "lucide-react";import { useState } from "react";import { useStore, type Bot } from "@/state/store";import type { Routine, RoutineRun, RoutineRunOn } from "@/lib/routines";@@ -18,7 +18,7 @@ export function RoutinesSection({ bot, routines, runs, defaultRunOn }: { bot: Bo</div></div><RoutineList routines={routines} runs={runs} loading={state.routinesLoadState === "loading" && routines.length === 0} error={state.routinesLoadState === "error"} onOpen={setEditing} onLogs={(routine) => dispatch({ type: "showRoutines", section: "logs", botId: bot.id, routineId: routine.id })} onToggle={(routine) => dispatch({ type: "updateRoutine", routineId: routine.id, patch: { enabled: !routine.enabled } })} />- <button type="button" onClick={() => dispatch({ type: "showRoutines", section: "schedule", view: "list", botId: bot.id })} className="self-start text-[12px] text-accent hover:underline">{t("computer.routines.openTitle")} →</button>+ <button type="button" onClick={() => dispatch({ type: "showRoutines", section: "schedule", view: "list", botId: bot.id })} className="self-start text-[12px] text-accent hover:underline">{t("computer.routines.openTitle")} <ChevronRight size={14} aria-hidden="true" className="inline align-[-2px] rtl:-scale-x-100" /></button>{editing && <RoutineEditor key={bot.id} routine={editing === "new" ? undefined : editing} bots={[bot]} lockedBotId={bot.id} defaultRunOn={defaultRunOn} onClose={() => setEditing(null)} />}</div>;}diff --git a/src/components/bot-settings/UsageSection.tsx b/src/components/bot-settings/UsageSection.tsxindex 97595d866c..1ebd1ffbd8 100644--- a/src/components/bot-settings/UsageSection.tsx+++ b/src/components/bot-settings/UsageSection.tsx@@ -1,3 +1,4 @@+import { ChevronRight } from "lucide-react";import { cn } from "@/lib/cn";import { useStore, type Bot } from "@/state/store";import { t } from "@/lib/i18n";@@ -24,7 +25,7 @@ export function UsageSection({ bot, bare = false }: { bot: Bot; bare?: boolean }onClick={() => dispatch({ type: "toggleAppSettings", open: true, section: "usage" })}className="text-[12px] text-ink-secondary hover:text-ink">- {t("usage.allBots")} →+ {t("usage.allBots")} <ChevronRight size={14} aria-hidden="true" className="inline align-[-2px] rtl:-scale-x-100" /></button></div>}<div className={cn("grid grid-cols-3 gap-3 text-[13px]", !bare && "mt-3")}>diff --git a/src/components/menu-recipe.ts b/src/components/menu-recipe.tsindex ca60e75b08..467673922d 100644--- a/src/components/menu-recipe.ts+++ b/src/components/menu-recipe.ts@@ -1,3 +1,11 @@+export const MENU_SHEET = "popover-surface flex flex-col gap-1 rounded-[var(--radius-menu)] border border-hairline/50 bg-menu p-1.5 shadow-lg [&_svg.lucide]:stroke-[1.5]";++export const MENU_ITEM = "flex min-h-[30px] w-full shrink-0 items-center gap-2 whitespace-nowrap rounded-md px-2 py-1.5 text-left text-[14px] leading-[18px] focus-visible:bg-menu-hover";++export const MENU_ITEM_SEPARATOR = "mx-1.5 h-px shrink-0 bg-hairline/50";++export const MENU_HEADING = "px-2 pb-1 pt-2 text-[12px] font-medium leading-4 text-ink-secondary";+export const MENU_ROW ="group flex h-[30px] w-full min-w-0 shrink-0 items-center gap-2 rounded-md px-2 text-left text-[13px] leading-[18px] text-ink hover:bg-ink/[0.06] focus:bg-ink/[0.06] active:bg-ink/[0.08] disabled:cursor-default disabled:opacity-50 disabled:hover:bg-transparent touch:h-10";diff --git a/src/lib/control-scale.test.ts b/src/lib/control-scale.test.tsindex f1086ff816..01ed52f996 100644--- a/src/lib/control-scale.test.ts+++ b/src/lib/control-scale.test.ts@@ -34,7 +34,7 @@ describe("control scale", () => {expect(rule(".ui-pill")).toMatchObject({ "min-height": "1.75rem", "border-radius": "9999px", "font-size": "13px", "font-weight": "500", "line-height": "1.25rem", "align-items": "center" });expect(rule(".ui-chip")).toMatchObject({ "min-height": "1.375rem", "border-radius": "9999px", "font-size": "12px", "font-weight": "500", "line-height": "1rem" });expect(rule(".ui-code-chip")).toMatchObject({ "box-decoration-break": "clone", "font-family": "var(--font-mono)", "font-size": "0.86em", "line-height": "1" });- expect(rule(".ui-menu-row")).toMatchObject({ "min-height": "2.25rem", "font-size": "14px", "line-height": "1.25rem", gap: "0.75rem" });+ expect(rule(".ui-menu-row")).toMatchObject({ "min-height": "30px", "border-radius": "0.375rem", "font-size": "14px", "line-height": "18px", gap: "0.5rem" });});it("keeps every step on skin tokens", () => {diff --git a/src/lib/glass-surface.test.ts b/src/lib/glass-surface.test.tsindex 4716ae45ca..e0bed1ab98 100644--- a/src/lib/glass-surface.test.ts+++ b/src/lib/glass-surface.test.ts@@ -35,12 +35,12 @@ describe("glass surface", () => {}});- it("is an opaque sheet only for Simple Settings in Midnight and Daylight, 900 by 700 with radius 12", () => {- const sheet = rule(':root:is([data-skin="midnight"], [data-skin="daylight"]) [data-settings-look="simple"] .glass-surface');+ it("is an opaque sheet for Settings in Midnight and Daylight in both modes, 900 by 700 with radius 12 in Simple", () => {+ const sheet = rule(':root:is([data-skin="midnight"], [data-skin="daylight"]) [data-settings-look] .glass-surface');expect(sheet).toContain("background: var(--color-app)");expect(sheet).toContain("backdrop-filter: none");expect(sheet).toContain("box-shadow: none");- expect(css.indexOf('[data-settings-look="simple"] .glass-surface {')).toBeGreaterThan(css.indexOf(".glass-surface {"));+ expect(css.indexOf("[data-settings-look] .glass-surface {")).toBeGreaterThan(css.indexOf(".glass-surface {"));const size = rule('.glass-popup-frame[data-settings-sheet][data-settings-look="simple"] > .glass-popup');expect(size).toContain("width: min(900px, 100%)");expect(size).toContain("height: min(700px, 100%)");diff --git a/src/lib/interface-mode.test.ts b/src/lib/interface-mode.test.tsindex bc6678266e..3dd007a328 100644--- a/src/lib/interface-mode.test.ts+++ b/src/lib/interface-mode.test.ts@@ -20,18 +20,13 @@ async function fresh() {return import("./interface-mode");}-const root = { dataset: {} as Record<string, string> };-beforeEach(() => {local = memoryStorage();- root.dataset = {};vi.stubGlobal("localStorage", local);vi.stubGlobal("window", new EventTarget());- vi.stubGlobal("document", { documentElement: root });});afterEach(() => {- vi.doUnmock("react");vi.unstubAllGlobals();});@@ -68,46 +63,6 @@ describe("interface mode", () => {expect(readAdvancedMode()).toBe(true);});- it("marks the page with the mode it boots in", async () => {- const simple = await fresh();- simple.settleAdvancedModeDefault();- simple.applyInterfaceMode();- expect(root.dataset.interface).toBe("simple");-- root.dataset = {};- local.setItem(simple.ADVANCED_MODE_KEY, "1");- const advanced = await fresh();- advanced.settleAdvancedModeDefault();- advanced.applyInterfaceMode();- expect(root.dataset.interface).toBe("advanced");- });-- it("moves the page mark when the mode is switched", async () => {- const { setAdvancedMode } = await fresh();- setAdvancedMode(true);- expect(root.dataset.interface).toBe("advanced");- setAdvancedMode(false);- expect(root.dataset.interface).toBe("simple");- });-- it("marks the page once the app reads the mode, and moves the mark when another window switches it", async () => {- // Stands in for React subscribing a component, which is what attaches the storage listener.- vi.doMock("react", () => ({- useSyncExternalStore: (subscribe: (listener: () => void) => void, read: () => boolean) => {- subscribe(() => {});- return read();- },- }));- const { useAdvancedMode, setAdvancedMode, ADVANCED_MODE_KEY } = await fresh();- setAdvancedMode(false);- root.dataset = {};- expect(useAdvancedMode()).toBe(false);- expect(root.dataset.interface).toBe("simple");- local.setItem(ADVANCED_MODE_KEY, "1");- window.dispatchEvent(Object.assign(new Event("storage"), { key: ADVANCED_MODE_KEY, storageArea: local }));- expect(root.dataset.interface).toBe("advanced");- });-it("falls back to Simple when storage cannot be read at all", async () => {local.getItem.mockImplementation(() => {throw new Error("blocked");diff --git a/src/lib/interface-mode.ts b/src/lib/interface-mode.tsindex 95edf78b93..e655aa93d3 100644--- a/src/lib/interface-mode.ts+++ b/src/lib/interface-mode.ts@@ -35,13 +35,7 @@ export function settleAdvancedModeDefault(): void {}}-export function applyInterfaceMode(): void {- if (typeof document === "undefined") return;- document.documentElement.dataset.interface = readAdvancedMode() ? "advanced" : "simple";-}-function notify() {- applyInterfaceMode();for (const listener of listeners) listener();}@@ -54,9 +48,8 @@ function onStorage(event: StorageEvent) {function subscribe(listener: () => void): () => void {listeners.add(listener);- if (listeners.size === 1) {- applyInterfaceMode();- if (typeof window !== "undefined") window.addEventListener("storage", onStorage);+ if (listeners.size === 1 && typeof window !== "undefined") {+ window.addEventListener("storage", onStorage);}return () => {listeners.delete(listener);diff --git a/src/lib/skins.test.ts b/src/lib/skins.test.tsindex 908e415f04..9ea5987f52 100644--- a/src/lib/skins.test.ts+++ b/src/lib/skins.test.ts@@ -46,14 +46,6 @@ describe("skins", () => {}});- it("puts Advanced mode's Midnight and Daylight menu rows back on raised", () => {- for (const id of ["midnight", "daylight"]) {- const body = css.match(new RegExp(`\\[data-skin="${id}"\\]:where\\(:root\\[data-interface="advanced"\\][^{]*\\{([^}]*)\\}`))?.[1] ?? "";- expect(body, id).toContain("--color-menu-hover: color-mix(in srgb, var(--color-raised) 70%, transparent);");- expect(body, id).toContain("--color-menu-active: var(--color-raised);");- }- });-it("selects a code-only light or dark palette in every nearest skin", () => {for (const id of SKIN_IDS) {const body = css.match(new RegExp(`\\[data-skin="${id}"\\]\\s*\\{([^}]*)\\}`))?.[1] ?? "";diff --git a/src/main.tsx b/src/main.tsxindex fa5897a70a..5d2bb29da3 100644--- a/src/main.tsx+++ b/src/main.tsx@@ -8,7 +8,7 @@ import { bootstrapBrand } from "./lib/brand";import { applySkinChoice, readSkinChoice } from "./lib/skins";import { applyChatWidth, readChatWidth } from "./lib/chat-width";import { applyFont, readFont } from "./lib/fonts";-import { applyInterfaceMode, settleAdvancedModeDefault } from "./lib/interface-mode";+import { settleAdvancedModeDefault } from "./lib/interface-mode";import { BrowserSignInPage } from "./pair/BrowserSignInPage";import { PairPage } from "./pair/PairPage";import { HomeScreen, SignedOutAtHome } from "./components/HomeScreen";@@ -16,7 +16,6 @@ import "./styles.css";// Before first paint; settleAdvancedModeDefault must run before applySkin writes omb-skin.settleAdvancedModeDefault();-applyInterfaceMode();applySkinChoice(readSkinChoice());applyFont(readFont());applyChatWidth(readChatWidth());diff --git a/src/styles.css b/src/styles.cssindex e8c29870bc..203fdf6a54 100644--- a/src/styles.css+++ b/src/styles.css@@ -211,7 +211,7 @@--chat-prose-max: 44rem;/* .chat-column: fills a narrow pane, then stops at this width and centers, so wider windows only grow the gutters. */--chat-column-max: 60rem;- /* Simple mode's menus; a phone rounds them like its sheets. */+ /* Menus; a phone rounds them like its sheets. */--radius-menu: 14px;}:root[data-chat-width="wide"] {@@ -949,60 +949,36 @@--identity-chrome: #B3BAC4;}-/* Advanced mode keeps Midnight's and Daylight's brighter inks, firmer fields and raised menu rows. :where() holds- these at a skin block's specificity, so the phone and wide-gamut blocks below still win. */-[data-skin="midnight"]:where(:root[data-interface="advanced"], :root[data-interface="advanced"] *) {- --color-raised-hover: #2e2e2e;- --color-composer-ring: #2e2e2e;- --color-inset: #171717;- --color-ink: #fcfcfc;- --color-ink-secondary: #fcfcfcbf;- --color-ink-tertiary: #fcfcfc90;- --color-bubble-user-ink: #fcfcfc;- --color-maus-line: #fcfcfc;- --color-menu-hover: color-mix(in srgb, var(--color-raised) 70%, transparent);- --color-menu-active: var(--color-raised);-}-[data-skin="daylight"]:where(:root[data-interface="advanced"], :root[data-interface="advanced"] *) {- --color-inset: #e6e6e6;- --color-control: #dedede;- --color-composer-ring: #e4e4e4;- --color-ink: #0d0d0d;- --color-ink-secondary: #444444;- --color-menu-hover: color-mix(in srgb, var(--color-raised) 70%, transparent);- --color-menu-active: var(--color-raised);-}--/* Simple mode: every popover and menu in the menu tone, flat in Midnight and on a soft lift in Daylight. A- popover's rim is its border, never a ring, so clearing box-shadow leaves the rim. */-:root[data-interface="simple"] .popover-surface {+/* Every popover and menu in the menu tone, flat in Midnight and on a soft lift in Daylight. A popover's rim is its+ border, never a ring, so clearing box-shadow leaves the rim. */+.popover-surface {background-color: var(--color-menu);}-:root[data-interface="simple"][data-skin="midnight"] .popover-surface {+:root[data-skin="midnight"] .popover-surface {box-shadow: none;}-:root[data-interface="simple"][data-skin="daylight"] .popover-surface {+:root[data-skin="daylight"] .popover-surface {box-shadow: 0 10px 20px -3px rgb(28 28 28 / 0.1), 0 4px 6px -4px rgb(28 28 28 / 0.1);}-/* Simple mode's primary action in Midnight and Daylight is a neutral pill: white on dark, black on light. Unlayered,- so it wins over the accent fill a call site may still carry. */-:root[data-interface="simple"]:is([data-skin="midnight"], [data-skin="daylight"]) .ui-button-primary {+/* In Midnight and Daylight a primary action is a neutral pill: white on dark, black on light. Unlayered, so it wins+ over the accent fill a call site may still carry. */+:root:is([data-skin="midnight"], [data-skin="daylight"]) .ui-button-primary {border-color: transparent;background: var(--color-ink);color: var(--color-app);}-:root[data-interface="simple"]:is([data-skin="midnight"], [data-skin="daylight"]) .ui-button-primary:not(:disabled):is(:hover, :active) {+:root:is([data-skin="midnight"], [data-skin="daylight"]) .ui-button-primary:not(:disabled):is(:hover, :active) {background: color-mix(in srgb, var(--color-ink) 88.5%, var(--color-app));color: var(--color-app);filter: none;}-:root[data-interface="simple"]:is([data-skin="midnight"], [data-skin="daylight"]) .ui-button-primary:disabled {+:root:is([data-skin="midnight"], [data-skin="daylight"]) .ui-button-primary:disabled {opacity: 1;background: color-mix(in srgb, var(--color-ink) 13%, transparent);color: color-mix(in srgb, var(--color-ink) 30%, transparent);}-:root[data-interface="simple"][data-skin="daylight"] .ui-button-primary:disabled {+:root[data-skin="daylight"] .ui-button-primary:disabled {background: color-mix(in srgb, var(--color-ink) 15%, transparent);}@@ -1284,18 +1260,19 @@ body {-webkit-box-decoration-break: clone;box-decoration-break: clone;}- /* One row of a popover menu: 36px, 14px, icon then label. */+ /* One row of a popover menu: 30px, 14px, icon then label. */.ui-menu-row {display: flex;width: 100%;align-items: center;- gap: 0.75rem;- min-height: 2.25rem;- padding: 0.5rem 0.875rem;+ gap: 0.5rem;+ min-height: 30px;+ padding: 0.375rem 0.5rem;+ border-radius: 0.375rem;text-align: left;font-size: 14px;font-weight: 400;- line-height: 1.25rem;+ line-height: 18px;}.ui-menu-row:enabled:hover { background: var(--color-menu-hover); }.ui-menu-row:disabled { opacity: 0.6; }@@ -1313,20 +1290,20 @@ body {cursor: not-allowed;opacity: 0.45;}- /* Simple mode's secondary action in Midnight and Daylight: a faint ink wash with a hairline of ink. Layered, so a+ /* A secondary action in Midnight and Daylight: a faint ink wash with a hairline of ink. Layered, so acall site's own fill (an ink pill, a danger outline) still wins. */- :root[data-interface="simple"][data-skin="midnight"] .ui-button {+ :root[data-skin="midnight"] .ui-button {border-color: color-mix(in srgb, var(--color-ink) 10%, transparent);background: color-mix(in srgb, var(--color-ink) 4%, transparent);}- :root[data-interface="simple"][data-skin="midnight"] .ui-button:enabled:is(:hover, :active) {+ :root[data-skin="midnight"] .ui-button:enabled:is(:hover, :active) {background: color-mix(in srgb, var(--color-ink) 8%, transparent);}- :root[data-interface="simple"][data-skin="daylight"] .ui-button {+ :root[data-skin="daylight"] .ui-button {border-color: color-mix(in srgb, var(--color-ink) 12%, transparent);background: color-mix(in srgb, var(--color-ink) 6%, transparent);}- :root[data-interface="simple"][data-skin="daylight"] .ui-button:enabled:is(:hover, :active) {+ :root[data-skin="daylight"] .ui-button:enabled:is(:hover, :active) {background: color-mix(in srgb, var(--color-ink) 10%, transparent);}/* A dialog for the first-run surfaces: the menu tone on a hairline of ink, lifted only in Daylight. */@@ -1452,36 +1429,36 @@ body {}}-/* Simple Settings: cards and fields edge in one faint ink line. In Midnight and Daylight the sheet is opaque, in the- page colour, with no shadow; every other skin keeps its glass. */-[data-settings-look="simple"] {+/* Settings: cards and fields edge in one faint ink line. In Midnight and Daylight the sheet is opaque, in the page+ colour, with no shadow; every other skin keeps its glass. */+[data-settings-look] {--settings-edge: color-mix(in srgb, var(--color-ink) 8%, transparent);}-:root[data-skin="midnight"] [data-settings-look="simple"] {+:root[data-skin="midnight"] [data-settings-look] {--settings-edge: color-mix(in srgb, var(--color-ink) 6%, transparent);}-:root:is([data-skin="midnight"], [data-skin="daylight"]) [data-settings-look="simple"] .glass-surface {+:root:is([data-skin="midnight"], [data-skin="daylight"]) [data-settings-look] .glass-surface {background: var(--color-app);-webkit-backdrop-filter: none;backdrop-filter: none;border: 1px solid color-mix(in srgb, var(--color-ink) 12%, transparent);box-shadow: none;}-:root:is([data-skin="midnight"], [data-skin="daylight"]) [data-settings-look="simple"] .glass-rail {+:root:is([data-skin="midnight"], [data-skin="daylight"]) [data-settings-look] .glass-rail {background: transparent;border-right: 0.5px solid var(--settings-edge);}-:root:is([data-skin="midnight"], [data-skin="daylight"]) [data-settings-look="simple"] .glass-surface .bg-card {+:root:is([data-skin="midnight"], [data-skin="daylight"]) [data-settings-look] .glass-surface .bg-card {background-color: var(--color-menu);}-:root:is([data-skin="midnight"], [data-skin="daylight"]) [data-settings-look="simple"] .bg-inset {+:root:is([data-skin="midnight"], [data-skin="daylight"]) [data-settings-look] .bg-inset {background-color: transparent;border-color: var(--settings-edge);}-:root[data-skin="midnight"] [data-settings-look="simple"] > .glass-scrim {+:root[data-skin="midnight"] [data-settings-look] > .glass-scrim {background: rgb(0 0 0 / 0.7);}-:root[data-skin="daylight"] [data-settings-look="simple"] > .glass-scrim {+:root[data-skin="daylight"] [data-settings-look] > .glass-scrim {background: rgb(0 0 0 / 0.5);}@media (min-width: 768px) {@@ -1595,8 +1572,8 @@ body {outline: 2px solid var(--color-focus);outline-offset: 2px;}-/* Simple mode shows keyboard focus on a menu row as the row's hover fill. */-:root[data-interface="simple"] [role="menu"] :is(button, [role^="menuitem"]):focus-visible {+/* A menu row shows keyboard focus as its hover fill. */+[role="menu"] :is(button, [role^="menuitem"]):focus-visible {outline: none;background-color: var(--color-menu-hover);}