Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active
TypeScript aianthropicartifactsawsazurechatgptchatgpt-cloneclaudeclonedeepseekgeminigooglegpt-5librechatmcpo1openairesponses-apivisionwebui
♿ a11y: Ring Content Rows in a Themeable Focus Role (#16740)
Marco Beretta2b25f69ea0b3
diff --git a/client/src/components/Artifacts/Artifacts.tsx b/client/src/components/Artifacts/Artifacts.tsxindex db9e901852..ecd828b702 100644--- a/client/src/components/Artifacts/Artifacts.tsx+++ b/client/src/components/Artifacts/Artifacts.tsx@@ -502,7 +502,7 @@ export default function Artifacts() {aria-valuemin={10}aria-valuemax={100}aria-valuenow={Math.round(height)}- className="bg-surface-primary-alt focus-visible:ring-border-heavy flex shrink-0 cursor-grab items-center justify-center pt-2.5 pb-1.5 focus-visible:ring-2 focus-visible:outline-hidden focus-visible:ring-inset active:cursor-grabbing"+ className="bg-surface-primary-alt focus-visible:ring-focus-subtle flex shrink-0 cursor-grab items-center justify-center pt-2.5 pb-1.5 focus-visible:ring-2 focus-visible:outline-hidden focus-visible:ring-inset active:cursor-grabbing"onPointerDown={handleDragStart}onPointerMove={handleDragMove}onPointerUp={handleDragEnd}diff --git a/client/src/components/Chat/Messages/Content/ActivityPhaseGroup.tsx b/client/src/components/Chat/Messages/Content/ActivityPhaseGroup.tsxindex c183f17432..b0a761bc8f 100644--- a/client/src/components/Chat/Messages/Content/ActivityPhaseGroup.tsx+++ b/client/src/components/Chat/Messages/Content/ActivityPhaseGroup.tsx@@ -500,7 +500,7 @@ function FailedPeek({type="button"className={cn(TOOL_ROW_CLASSES,- 'text-text-secondary hover:text-text-primary focus-visible:ring-border-heavy w-full pl-6 text-left focus-visible:ring-2 focus-visible:outline-none focus-visible:ring-inset',+ 'text-text-secondary hover:text-text-primary focus-visible:ring-focus-subtle w-full pl-6 text-left focus-visible:ring-2 focus-visible:outline-none focus-visible:ring-inset',)}onClick={onReveal}data-testid="activity-phase-failed-peek"@@ -846,7 +846,7 @@ export default function ActivityPhaseGroup({* supplies it today; stating it here keeps the requirement with* the element that depends on it. */className={cn(- 'text-text-secondary hover:text-text-primary focus-visible:ring-border-heavy flex h-auto min-h-7 min-w-0 flex-1 items-center justify-start gap-2 rounded-none bg-transparent p-0 py-1 text-left font-medium hover:bg-transparent focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:outline-none focus-visible:ring-inset',+ 'text-text-secondary hover:text-text-primary focus-visible:ring-focus-subtle flex h-auto min-h-7 min-w-0 flex-1 items-center justify-start gap-2 rounded-none bg-transparent p-0 py-1 text-left font-medium hover:bg-transparent focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:outline-none focus-visible:ring-inset',/** The open card's title: the one semibold, primary-colour line* in the fold, so the rows under it read as its contents. */isExpanded && 'text-text-primary font-semibold',diff --git a/client/src/components/Chat/Messages/Content/FilePreviewDialog.tsx b/client/src/components/Chat/Messages/Content/FilePreviewDialog.tsxindex 075c75d68e..71c5d52c88 100644--- a/client/src/components/Chat/Messages/Content/FilePreviewDialog.tsx+++ b/client/src/components/Chat/Messages/Content/FilePreviewDialog.tsx@@ -276,7 +276,7 @@ export default function FilePreviewDialog({<buttontype="button"onClick={handleDownload}- className="text-text-secondary hover:text-text-primary focus-visible:ring-border-heavy inline-flex shrink-0 items-center gap-1 text-xs transition-colors focus-visible:ring-2 focus-visible:outline-hidden"+ className="text-text-secondary hover:text-text-primary focus-visible:ring-focus-subtle inline-flex shrink-0 items-center gap-1 text-xs transition-colors focus-visible:ring-2 focus-visible:outline-hidden"aria-label={`${localize('com_ui_download')} ${fileName}`}><Download className="size-3" aria-hidden="true" />diff --git a/client/src/components/Chat/Messages/Content/Parts/Attachment.tsx b/client/src/components/Chat/Messages/Content/Parts/Attachment.tsxindex efe3216244..3636c37d35 100644--- a/client/src/components/Chat/Messages/Content/Parts/Attachment.tsx+++ b/client/src/components/Chat/Messages/Content/Parts/Attachment.tsx@@ -239,7 +239,7 @@ const FileAttachmentGroup = memo(({ attachments }: { attachments: TAttachment[]className={cn('inline-flex w-full max-w-full items-center gap-2 rounded-lg py-1 pr-2 text-sm','text-text-secondary hover:text-text-primary transition-colors',- 'focus-visible:ring-border-heavy focus-visible:ring-2 focus-visible:outline-hidden',+ 'focus-visible:ring-focus-subtle focus-visible:ring-2 focus-visible:outline-hidden',)}><FilesIcon className="size-4 shrink-0" aria-hidden="true" />@@ -365,7 +365,7 @@ const TextAttachment = memo(onClick={handleDownload}aria-label={`${localize('com_ui_download')} ${visibleFilename}`}title={localize('com_ui_download')}- className="text-text-secondary hover:bg-surface-hover hover:text-text-primary focus-visible:ring-border-heavy flex size-7 shrink-0 items-center justify-center rounded-md transition-colors focus-visible:ring-2 focus-visible:outline-hidden"+ className="text-text-secondary hover:bg-surface-hover hover:text-text-primary focus-visible:ring-focus-subtle flex size-7 shrink-0 items-center justify-center rounded-md transition-colors focus-visible:ring-2 focus-visible:outline-hidden"><Download className="size-4" aria-hidden="true" /></button>@@ -390,7 +390,7 @@ const TextAttachment = memo(onClick={() => setExpanded((prev) => !prev)}aria-expanded={expanded}aria-controls={preId}- className="text-text-secondary hover:text-text-primary focus-visible:ring-border-heavy mt-2 text-xs transition-colors focus-visible:ring-2 focus-visible:outline-hidden"+ className="text-text-secondary hover:text-text-primary focus-visible:ring-focus-subtle mt-2 text-xs transition-colors focus-visible:ring-2 focus-visible:outline-hidden">{expanded ? localize('com_ui_collapse') : localize('com_ui_show_all')}</button>diff --git a/client/src/components/Chat/Messages/Content/Parts/BackgroundTaskCall.tsx b/client/src/components/Chat/Messages/Content/Parts/BackgroundTaskCall.tsxindex 405bfffacd..618de0d061 100644--- a/client/src/components/Chat/Messages/Content/Parts/BackgroundTaskCall.tsx+++ b/client/src/components/Chat/Messages/Content/Parts/BackgroundTaskCall.tsx@@ -167,7 +167,7 @@ export default function BackgroundTaskCall({<ultabIndex={0}aria-label={localize('com_ui_background_tasks')}- className="focus-visible:ring-border-heavy flex max-h-96 flex-col gap-2 overflow-y-auto pr-1 focus-visible:ring-2 focus-visible:outline-none"+ className="focus-visible:ring-focus-subtle flex max-h-96 flex-col gap-2 overflow-y-auto pr-1 focus-visible:ring-2 focus-visible:outline-none">{display.tasks.map((task) => (<li key={task.taskId}>@@ -218,7 +218,7 @@ export default function BackgroundTaskCall({className="border-border-light border-t px-3 py-2"onToggle={(event) => setShowRaw(event.currentTarget.open)}>- <summary className="text-text-secondary hover:text-text-primary focus-visible:ring-border-heavy cursor-pointer rounded text-xs focus-visible:ring-2 focus-visible:outline-none">+ <summary className="text-text-secondary hover:text-text-primary focus-visible:ring-focus-subtle cursor-pointer rounded text-xs focus-visible:ring-2 focus-visible:outline-none">{localize('com_ui_background_tasks_raw_details')}</summary>{showRaw && (diff --git a/client/src/components/Chat/Messages/Content/Parts/Summary.tsx b/client/src/components/Chat/Messages/Content/Parts/Summary.tsxindex 3d62a266ba..0ac7a96c8b 100644--- a/client/src/components/Chat/Messages/Content/Parts/Summary.tsx+++ b/client/src/components/Chat/Messages/Content/Parts/Summary.tsx@@ -171,7 +171,7 @@ const FloatingSummaryBar = memo(className={cn('bg-surface-secondary text-text-secondary-alt flex items-center justify-center rounded-lg p-1.5 shadow-xs','hover:bg-surface-hover hover:text-text-primary',- 'focus-visible:ring-border-heavy focus-visible:ring-2 focus-visible:outline-hidden',+ 'focus-visible:ring-focus-subtle focus-visible:ring-2 focus-visible:outline-hidden',)}><ChevronUp className="h-[1.125rem] w-[1.125rem]" aria-hidden="true" />@@ -190,7 +190,7 @@ const FloatingSummaryBar = memo(className={cn('bg-surface-secondary text-text-secondary-alt flex items-center justify-center rounded-lg p-1.5 shadow-xs','hover:bg-surface-hover hover:text-text-primary',- 'focus-visible:ring-border-heavy focus-visible:ring-2 focus-visible:outline-hidden',+ 'focus-visible:ring-focus-subtle focus-visible:ring-2 focus-visible:outline-hidden',)}><MorphIcon icon={isCopied ? Check : Copy} className="h-[1.125rem] w-[1.125rem]" />diff --git a/client/src/components/Chat/Messages/Content/Parts/ToolMermaidArtifact.tsx b/client/src/components/Chat/Messages/Content/Parts/ToolMermaidArtifact.tsxindex 8158f141ef..32ee614644 100644--- a/client/src/components/Chat/Messages/Content/Parts/ToolMermaidArtifact.tsx+++ b/client/src/components/Chat/Messages/Content/Parts/ToolMermaidArtifact.tsx@@ -81,7 +81,7 @@ const ToolMermaidArtifact = memo(({ attachment, text }: ToolMermaidArtifactPropsclassName={cn('inline-flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-xs','text-text-secondary hover:bg-surface-hover hover:text-text-primary transition-colors',- 'focus-visible:ring-border-heavy focus-visible:ring-2 focus-visible:outline-hidden',+ 'focus-visible:ring-focus-subtle focus-visible:ring-2 focus-visible:outline-hidden',)}><Download className="size-3" aria-hidden="true" />diff --git a/client/src/components/Chat/Messages/Content/RetrievalCall.tsx b/client/src/components/Chat/Messages/Content/RetrievalCall.tsxindex 4be8d24b88..884429cd15 100644--- a/client/src/components/Chat/Messages/Content/RetrievalCall.tsx+++ b/client/src/components/Chat/Messages/Content/RetrievalCall.tsx@@ -299,7 +299,7 @@ function FileHeader({<buttontype="button"onClick={onOpenPreview}- className="text-text-primary decoration-border-medium hover:text-text-secondary focus-visible:ring-border-heavy min-w-0 truncate text-left text-xs font-medium underline underline-offset-2 transition-colors focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:outline-hidden"+ className="text-text-primary decoration-border-medium hover:text-text-secondary focus-visible:ring-focus-subtle min-w-0 truncate text-left text-xs font-medium underline underline-offset-2 transition-colors focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:outline-hidden"aria-label={`${localize('com_ui_preview')}: ${fileName}`}>{fileName}diff --git a/client/src/components/Chat/Messages/Content/SubagentProgress.tsx b/client/src/components/Chat/Messages/Content/SubagentProgress.tsxindex f7b261e729..a5b6b31ab0 100644--- a/client/src/components/Chat/Messages/Content/SubagentProgress.tsx+++ b/client/src/components/Chat/Messages/Content/SubagentProgress.tsx@@ -161,7 +161,7 @@ function DigestBranch({return (<li className="min-w-0"><details open={isOnPath(entry.node.path, active)} className="group">- <summary className="focus-visible:ring-border-heavy flex min-w-0 cursor-pointer items-center rounded py-0.5 focus-visible:ring-2 focus-visible:outline-none">+ <summary className="focus-visible:ring-focus-subtle flex min-w-0 cursor-pointer items-center rounded py-0.5 focus-visible:ring-2 focus-visible:outline-none"><NodeRow node={entry.node} serverNames={serverNames} /></summary><ul className="border-border-light ms-1.5 border-s ps-2">diff --git a/client/src/components/Chat/Messages/Content/ToolCallGroup.tsx b/client/src/components/Chat/Messages/Content/ToolCallGroup.tsxindex 3af780ebf5..b7f5bfe548 100644--- a/client/src/components/Chat/Messages/Content/ToolCallGroup.tsx+++ b/client/src/components/Chat/Messages/Content/ToolCallGroup.tsx@@ -633,7 +633,7 @@ export default function ToolCallGroup({<buttontype="button"className={cn(- 'text-text-secondary hover:text-text-secondary focus-visible:ring-border-heavy inline-flex h-auto min-w-0 flex-1 items-center justify-start gap-2 rounded-none bg-transparent p-0 py-1 hover:bg-transparent focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:outline-none',+ 'text-text-secondary hover:text-text-secondary focus-visible:ring-focus-subtle inline-flex h-auto min-w-0 flex-1 items-center justify-start gap-2 rounded-none bg-transparent p-0 py-1 hover:bg-transparent focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:outline-none',/** An open header is the title of the rows under it, so it is the* one line in the fold set in the primary colour. */isExpanded && 'text-text-primary hover:text-text-primary',diff --git a/client/src/components/Chat/Messages/Content/ToolCallInfo.tsx b/client/src/components/Chat/Messages/Content/ToolCallInfo.tsxindex 25f44df226..94b04838d7 100644--- a/client/src/components/Chat/Messages/Content/ToolCallInfo.tsx+++ b/client/src/components/Chat/Messages/Content/ToolCallInfo.tsx@@ -105,7 +105,7 @@ export default function ToolCallInfo({ input, output }: { input: string; output?type="button"className={cn('text-text-secondary inline-flex items-center gap-1 text-xs',- 'focus-visible:ring-border-heavy focus-visible:ring-2 focus-visible:outline-hidden',+ 'focus-visible:ring-focus-subtle focus-visible:ring-2 focus-visible:outline-hidden',)}onClick={() => setShowParams((prev) => !prev)}aria-expanded={showParams}diff --git a/client/src/components/Chat/Messages/Content/verticals.tsx b/client/src/components/Chat/Messages/Content/verticals.tsxindex a405d27531..670ae171c1 100644--- a/client/src/components/Chat/Messages/Content/verticals.tsx+++ b/client/src/components/Chat/Messages/Content/verticals.tsx@@ -128,7 +128,7 @@ function ImageStrip({ images, label }: { images: ImageResult[]; label: string })target="_blank"rel="noopener noreferrer"aria-label={image.title || image.domain || label}- className="border-border-light focus-visible:ring-border-heavy block h-28 overflow-hidden rounded-xl border no-underline focus-visible:ring-2 focus-visible:outline-hidden"+ className="border-border-light focus-visible:ring-focus-subtle block h-28 overflow-hidden rounded-xl border no-underline focus-visible:ring-2 focus-visible:outline-hidden"style={{ aspectRatio: ratio }}><img@@ -157,7 +157,7 @@ function ShoppingStrip({ items, label }: { items: ShoppingResult[]; label: strinhref={safeUrl(item.link)}target="_blank"rel="noopener noreferrer"- className="border-border-light hover:bg-surface-hover focus-visible:ring-border-heavy flex w-full flex-col rounded-xl border p-2 no-underline transition-colors focus-visible:ring-2 focus-visible:outline-hidden"+ className="border-border-light hover:bg-surface-hover focus-visible:ring-focus-subtle flex w-full flex-col rounded-xl border p-2 no-underline transition-colors focus-visible:ring-2 focus-visible:outline-hidden">{safeUrl(item.imageUrl) && (<div className="bg-surface-tertiary mb-2 aspect-square w-full shrink-0 overflow-hidden rounded-lg">@@ -209,7 +209,7 @@ function PlaceList({ places, label }: { places: PlaceResult[]; label: string })href={mapLink(place)}target="_blank"rel="noopener noreferrer"- className="hover:bg-surface-hover focus-visible:ring-border-heavy flex items-center gap-2.5 px-3 py-2 no-underline transition-colors focus-visible:ring-2 focus-visible:outline-hidden"+ className="hover:bg-surface-hover focus-visible:ring-focus-subtle flex items-center gap-2.5 px-3 py-2 no-underline transition-colors focus-visible:ring-2 focus-visible:outline-hidden"><MapPin className="text-text-secondary size-4 shrink-0" aria-hidden="true" /><span className="min-w-0 flex-1">diff --git a/client/src/components/Chat/Messages/ui/SystemEvent.tsx b/client/src/components/Chat/Messages/ui/SystemEvent.tsxindex 51300f4f03..7b92d53870 100644--- a/client/src/components/Chat/Messages/ui/SystemEvent.tsx+++ b/client/src/components/Chat/Messages/ui/SystemEvent.tsx@@ -69,4 +69,4 @@ export default function SystemEventHeader({}export const systemEventHeaderClasses =- 'inline-flex h-auto w-full items-center justify-start gap-2 rounded-none bg-transparent p-0 py-1 text-sm text-text-secondary hover:bg-transparent hover:text-text-secondary focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-border-heavy focus-visible:ring-offset-0';+ 'inline-flex h-auto w-full items-center justify-start gap-2 rounded-none bg-transparent p-0 py-1 text-sm text-text-secondary hover:bg-transparent hover:text-text-secondary focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-focus-subtle focus-visible:ring-offset-0';diff --git a/client/src/components/Messages/Content/ActionButton.tsx b/client/src/components/Messages/Content/ActionButton.tsxindex 452e5f4b32..c43846e30b 100644--- a/client/src/components/Messages/Content/ActionButton.tsx+++ b/client/src/components/Messages/Content/ActionButton.tsx@@ -47,7 +47,7 @@ const ActionButton = React.forwardRef<HTMLButtonElement, ActionButtonProps>('text-text-secondary inline-flex items-center justify-center transition-all duration-200 ease-out select-none','hover:bg-surface-hover hover:text-text-primary','disabled:pointer-events-none disabled:opacity-50',- 'focus-visible:outline-border-heavy focus-visible:outline focus-visible:outline-2',+ 'focus-visible:outline-focus-subtle focus-visible:outline focus-visible:outline-2',iconOnly ? 'rounded-lg p-1.5' : 'ml-auto gap-2 rounded-md px-2 py-1',className,)}diff --git a/client/src/components/Messages/Content/Mermaid/Export.tsx b/client/src/components/Messages/Content/Mermaid/Export.tsxindex 427c5b1bef..3bbf22c56b 100644--- a/client/src/components/Messages/Content/Mermaid/Export.tsx+++ b/client/src/components/Messages/Content/Mermaid/Export.tsx@@ -242,7 +242,7 @@ const MermaidExport = memo(function MermaidExport({aria-busy={isBusy || undefined}className={cn('text-text-secondary flex items-center justify-center rounded-lg p-1.5 transition-colors motion-reduce:transition-none',- 'hover:bg-surface-hover hover:text-text-primary focus-visible:outline-border-heavy focus-visible:outline focus-visible:outline-2',+ 'hover:bg-surface-hover hover:text-text-primary focus-visible:outline-focus-subtle focus-visible:outline focus-visible:outline-2',buttonClassName,)}>diff --git a/client/src/components/Messages/Content/Mermaid/MermaidHeader.tsx b/client/src/components/Messages/Content/Mermaid/MermaidHeader.tsxindex 6291eb8f35..e987f4508b 100644--- a/client/src/components/Messages/Content/Mermaid/MermaidHeader.tsx+++ b/client/src/components/Messages/Content/Mermaid/MermaidHeader.tsx@@ -25,7 +25,7 @@ interface MermaidHeaderProps {}const iconBtnClass =- 'flex items-center justify-center rounded-lg p-1.5 text-text-secondary transition-colors hover:bg-surface-hover hover:text-text-primary focus-visible:outline focus-visible:outline-2 focus-visible:outline-border-heavy';+ 'flex items-center justify-center rounded-lg p-1.5 text-text-secondary transition-colors hover:bg-surface-hover hover:text-text-primary focus-visible:outline focus-visible:outline-2 focus-visible:outline-focus-subtle';const MermaidHeader: React.FC<MermaidHeaderProps> = memo(({@@ -69,7 +69,7 @@ const MermaidHeader: React.FC<MermaidHeaderProps> = memo(return (<div className={cn('flex items-center justify-between gap-1 px-2 py-1', className)}>- <span className="rounded text-xs font-medium text-text-secondary">+ <span className="text-text-secondary rounded text-xs font-medium">{localize('com_ui_mermaid')}</span><div className={cn('flex items-center gap-1', actionsClassName)}>diff --git a/client/src/components/Messages/Content/ResultSwitcher.tsx b/client/src/components/Messages/Content/ResultSwitcher.tsxindex 9e64b06624..7ecf81b414 100644--- a/client/src/components/Messages/Content/ResultSwitcher.tsx+++ b/client/src/components/Messages/Content/ResultSwitcher.tsx@@ -33,7 +33,7 @@ export default function ResultSwitcher({onClick={onPrevious}disabled={atFirst}aria-label={localize('com_ui_prev_result')}- className="text-text-tertiary hover:bg-surface-hover hover:text-text-primary focus:outline-border-heavy rounded p-0.5 transition-colors focus:outline focus:outline-2 disabled:pointer-events-none disabled:opacity-30"+ className="text-text-tertiary hover:bg-surface-hover hover:text-text-primary focus:outline-focus-subtle rounded p-0.5 transition-colors focus:outline focus:outline-2 disabled:pointer-events-none disabled:opacity-30"><ChevronLeft className="size-3.5" aria-hidden="true" /></button>@@ -45,7 +45,7 @@ export default function ResultSwitcher({onClick={onNext}disabled={atLast}aria-label={localize('com_ui_next_result')}- className="text-text-tertiary hover:bg-surface-hover hover:text-text-primary focus:outline-border-heavy rounded p-0.5 transition-colors focus:outline focus:outline-2 disabled:pointer-events-none disabled:opacity-30"+ className="text-text-tertiary hover:bg-surface-hover hover:text-text-primary focus:outline-focus-subtle rounded p-0.5 transition-colors focus:outline focus:outline-2 disabled:pointer-events-none disabled:opacity-30"><ChevronRight className="size-3.5" aria-hidden="true" /></button>diff --git a/client/src/components/Messages/Content/RunCode.tsx b/client/src/components/Messages/Content/RunCode.tsxindex acccef7c53..347baa5601 100644--- a/client/src/components/Messages/Content/RunCode.tsx+++ b/client/src/components/Messages/Content/RunCode.tsx@@ -108,7 +108,7 @@ const RunCode: React.FC<CodeBarProps & { iconOnly?: boolean }> = React.memo(className={cn('text-text-secondary inline-flex items-center justify-center transition-all duration-200 ease-out select-none','hover:bg-surface-hover hover:text-text-primary',- 'focus-visible:outline-border-heavy focus-visible:outline focus-visible:outline-2',+ 'focus-visible:outline-focus-subtle focus-visible:outline focus-visible:outline-2','disabled:pointer-events-none disabled:opacity-50',isError && 'text-text-destructive hover:text-text-destructive',iconOnlydiff --git a/client/src/components/SidePanel/Memories/MemoryUsageBadge.tsx b/client/src/components/SidePanel/Memories/MemoryUsageBadge.tsxindex 03e23993c8..c7a1811f5b 100644--- a/client/src/components/SidePanel/Memories/MemoryUsageBadge.tsx+++ b/client/src/components/SidePanel/Memories/MemoryUsageBadge.tsx@@ -71,7 +71,7 @@ export default function MemoryUsageBadge({className={cn('inline-flex shrink-0 items-center gap-1.5 rounded-full px-2.5 py-1','text-xs font-medium hover:underline',- 'focus-visible:ring-border-heavy focus-visible:ring-2 focus-visible:outline-hidden',+ 'focus-visible:ring-focus-subtle focus-visible:ring-2 focus-visible:outline-hidden',getStatusColor(percentage),)}>diff --git a/e2e/specs/mock/scenarios/focus-subtle.spec.ts b/e2e/specs/mock/scenarios/focus-subtle.spec.tsnew file mode 100644index 0000000000..caed7f21f5--- /dev/null+++ b/e2e/specs/mock/scenarios/focus-subtle.spec.ts@@ -0,0 +1,134 @@+import { expect, test } from '@playwright/test';+import type { Page } from '@playwright/test';+import { clickHouseTheme } from '../../../../packages/client/src/theme/themes/clickhouse';+import { NEW_CHAT_PATH } from '../helpers';++/**+ * The subtle focus role. Rows and controls inside content (tool rows, attachments, summaries,+ * message navigation) ring their keyboard focus in `focus-subtle`, which follows `border-heavy`+ * unless a theme names it, so the bundled palettes keep the ring they had. ClickHouse takes Click+ * UI's outline color, and a theme that only repaints `border-heavy` keeps its rows on it.+ */++type Mode = 'light' | 'dark';++const HEAVY_ONLY_THEME = {+ version: 1,+ name: 'e2e-focus-subtle-heavy',+ modes: {+ light: { colors: { 'rgb-border-heavy': '10 20 30' } },+ dark: { colors: { 'rgb-border-heavy': '10 20 30' } },+ },+} as const;++const NAMED_THEME = {+ version: 1,+ name: 'e2e-focus-subtle-named',+ modes: {+ light: { colors: { 'rgb-border-heavy': '10 20 30', 'rgb-focus-subtle': '200 30 90' } },+ dark: { colors: { 'rgb-border-heavy': '10 20 30', 'rgb-focus-subtle': '200 30 90' } },+ },+} as const;++async function openChat(page: Page, mode: Mode, definition?: { name: string }) {+ await page.addInitScript(+ ([appearance, stored]) => {+ localStorage.setItem('color-theme', appearance as string);+ localStorage.removeItem('theme-colors');+ localStorage.removeItem('theme-name');+ if (stored) {+ localStorage.setItem('theme-definition', JSON.stringify(stored));+ localStorage.setItem('theme-source', 'definition');+ } else {+ localStorage.removeItem('theme-definition');+ localStorage.removeItem('theme-source');+ }+ },+ [mode, definition ?? null] as [string, unknown],+ );+ await page.goto(NEW_CHAT_PATH, { timeout: 15000 });+ await expect(page.getByRole('textbox', { name: 'Message input' })).toBeVisible({+ timeout: 30000,+ });+ const root = page.locator('html');+ if (definition) {+ await expect(root).toHaveAttribute('data-theme', definition.name);+ } else {+ await expect(root).not.toHaveAttribute('data-theme');+ }+ await expect(root).toHaveClass(mode === 'dark' ? /\bdark\b/ : /\blight\b/);+}++/**+ * The ring the utility paints on focus. The ring colour is read from the utility's own custom+ * property, because the dark stylesheet's `.dark :focus-visible` outline rule outranks any outline+ * utility and would hide the role.+ */+function subtleFocus(page: Page): Promise<string> {+ return page.evaluate(() => {+ const node = document.createElement('div');+ node.className = 'focus-visible:ring-focus-subtle';+ node.tabIndex = -1;+ document.body.append(node);+ node.focus();+ const ring = getComputedStyle(node).getPropertyValue('--tw-ring-color');+ node.remove();+ const channels = ring.match(/\d+/g) ?? [];+ return `rgb(${channels.slice(0, 3).join(', ')})`;+ });+}++/** Each tag is written out whole: the runner finds a scenario by its literal tag. */+const CASES: Array<{ title: string; mode: Mode; definition?: { name: string }; expected: string }> =+ [+ {+ title:+ 'the default light theme keeps the heavy border as its subtle focus ring @scenario:focus-subtle-default-light-unchanged',+ mode: 'light',+ expected: 'rgb(153, 150, 150)',+ },+ {+ title:+ 'the default dark theme keeps the heavy border as its subtle focus ring @scenario:focus-subtle-default-dark-unchanged',+ mode: 'dark',+ expected: 'rgb(89, 89, 89)',+ },+ {+ title:+ 'the ClickHouse light theme rings subtle focus in the Click UI outline @scenario:focus-subtle-clickhouse-light',+ mode: 'light',+ definition: clickHouseTheme,+ expected: 'rgb(67, 126, 239)',+ },+ {+ title:+ 'the ClickHouse dark theme rings subtle focus in the Click UI outline @scenario:focus-subtle-clickhouse-dark',+ mode: 'dark',+ definition: clickHouseTheme,+ expected: 'rgb(250, 255, 105)',+ },+ {+ title:+ 'a theme that repaints only the heavy border keeps its subtle focus on it @scenario:focus-subtle-follows-heavy-border',+ mode: 'light',+ definition: HEAVY_ONLY_THEME,+ expected: 'rgb(10, 20, 30)',+ },+ {+ title:+ 'a theme that names the subtle focus role rings in it whatever the heavy border is @scenario:focus-subtle-follow-reference-theme',+ mode: 'light',+ definition: NAMED_THEME,+ expected: 'rgb(200, 30, 90)',+ },+ ];++test.describe('subtle focus role', () => {+ for (const { title, mode, definition, expected } of CASES) {+ test(title, async ({ page }) => {+ await openChat(page, mode, definition);++ expect(await subtleFocus(page)).toBe(expected);+ });+ }+});diff --git a/packages/client/src/components/Button.tsx b/packages/client/src/components/Button.tsxindex 3f979e6ea8..09538055bd 100644--- a/packages/client/src/components/Button.tsx+++ b/packages/client/src/components/Button.tsx@@ -157,7 +157,7 @@ const buttonVariantRecipe = cva(* is inset because the row sits flush against the panel it opens.*/disclosure:- 'w-full justify-start focus-visible:ring-border-heavy focus-visible:ring-offset-0 disabled:opacity-100',+ 'w-full justify-start focus-visible:ring-focus-subtle focus-visible:ring-offset-0 disabled:opacity-100',/*** A full-width answer row in an option list, such as the choices of an* `ask_user_question`. The fill follows the pointer instantly rather thandiff --git a/packages/client/src/theme/README.md b/packages/client/src/theme/README.mdindex 7d2e343697..c9a15673de 100644--- a/packages/client/src/theme/README.md+++ b/packages/client/src/theme/README.md@@ -433,6 +433,10 @@ Each status family has a foreground, a `-subtle` background, a `-border`, and aand Dialog scrims: `surface-overlay` at the `scrimOpacity`,`alertScrimOpacity` and `modalScrimOpacity` appearance roles (80%, 90% and65% by default). A bundled scrim dims the page and never lifts it.+- `ring-focus-subtle` / `outline-focus-subtle` - The keyboard ring of a row or+ control inside content (tool rows, attachments, summaries, message+ navigation). Defaults to `border-heavy`, so a theme that names neither keeps+ the ring it had.- `ring-focus-control` - The keyboard focus ring of the shared primitives(`Checkbox`, `Switch`, `Field`, `IconButton` and their siblings). Defaults tothe primary text ink; a theme that names only `rgb-text-primary` rings itsdiff --git a/packages/client/src/theme/defaults.css b/packages/client/src/theme/defaults.cssindex b6d58f7d78..c7451190a4 100644--- a/packages/client/src/theme/defaults.css+++ b/packages/client/src/theme/defaults.css@@ -156,6 +156,7 @@ html {--border-destructive: var(--red-600);--border-control: var(--gray-200);--border-field-focus: var(--focus-control);+ --focus-subtle: var(--border-heavy);--field-fill: var(--surface-primary);--field-text: var(--text-primary);--surface-tooltip: var(--surface-primary);diff --git a/packages/client/src/theme/defaults.spec.ts b/packages/client/src/theme/defaults.spec.tsindex ba086d05dc..af49e1620c 100644--- a/packages/client/src/theme/defaults.spec.ts+++ b/packages/client/src/theme/defaults.spec.ts@@ -68,7 +68,7 @@ describe.each([const tokens = Object.keys(theme) as Array<keyof IThemeRGB>;it('covers every registry color', () => {- expect(tokens).toHaveLength(147);+ expect(tokens).toHaveLength(148);});it('resolves every registry color to the runtime theme value', () => {@@ -103,6 +103,7 @@ const colorAliases: Array<[string, string]> = [['--dialog-title', '--text-primary'],['--badge-label', '--text-primary'],['--border-field-focus', '--focus-control'],+ ['--focus-subtle', '--border-heavy'],['--field-fill', '--surface-primary'],['--field-text', '--text-primary'],];diff --git a/packages/client/src/theme/registry.spec.ts b/packages/client/src/theme/registry.spec.tsindex f83c2b6d55..6a0d75c5ac 100644--- a/packages/client/src/theme/registry.spec.ts+++ b/packages/client/src/theme/registry.spec.ts@@ -304,6 +304,21 @@ describe('theme registry', () => {expect(resolved.colors['rgb-chart-widget-stroke']).toBe('50 51 52');});+ it('rings subtle focus in the heavy border for a theme that predates the role', () => {+ const resolved = resolveTheme(+ {+ version: 1,+ name: 'heavy-border-reference',+ modes: { light: { colors: { 'rgb-border-heavy': '10 20 30' } } },+ },+ 'light',+ );++ expect(resolved.colors['rgb-focus-subtle']).toBe('10 20 30');+ expect(defaultTheme['rgb-focus-subtle']).toBe(defaultTheme['rgb-border-heavy']);+ expect(darkTheme['rgb-focus-subtle']).toBe(darkTheme['rgb-border-heavy']);+ });+it('accepts table lengths in px or rem, zero included, and rejects other units', () => {const withTable = (tableCellSpaceY: string, tableRowStroke: string) =>({diff --git a/packages/client/src/theme/registry.ts b/packages/client/src/theme/registry.tsindex e2bf86ff33..d7e9d5a273 100644--- a/packages/client/src/theme/registry.ts+++ b/packages/client/src/theme/registry.ts@@ -715,6 +715,11 @@ export function resolveTheme(theme: ThemeDefinition, mode: ThemeMode): ResolvedTcustomColors?.['rgb-border-light'] !== undefined? { 'rgb-chart-widget-stroke': customColors['rgb-border-light'] }: {};+ const focusSubtleFallback: IThemeRGB =+ customColors?.['rgb-focus-subtle'] === undefined &&+ customColors?.['rgb-border-heavy'] !== undefined+ ? { 'rgb-focus-subtle': customColors['rgb-border-heavy'] }+ : {};const borderControlSource =customColors != null ? controlBorderFallback(customColors) : undefined;const borderControlFallback: IThemeRGB =@@ -789,6 +794,7 @@ export function resolveTheme(theme: ThemeDefinition, mode: ThemeMode): ResolvedT...drawerEdgeFallback,...chartWidgetSurfaceFallback,...chartWidgetStrokeFallback,+ ...focusSubtleFallback,...switchThumbFallback,...fieldFillFallback,...overlayFallback,diff --git a/packages/client/src/theme/themes/clickhouse.spec.tsx b/packages/client/src/theme/themes/clickhouse.spec.tsxindex db34a3129a..74934c6651 100644--- a/packages/client/src/theme/themes/clickhouse.spec.tsx+++ b/packages/client/src/theme/themes/clickhouse.spec.tsx@@ -403,6 +403,12 @@ describe('clickhouse theme definition', () => {).toEqual([]);});+ /** Click UI's keyboard outline is the focus ring, on rows inside content as on controls. */+ it.each<ThemeMode>(['light', 'dark'])('rings subtle focus in the outline in %s', (mode) => {+ const { colors } = resolveTheme(clickHouseTheme, mode);+ expect(colors['rgb-focus-subtle']).toBe(colors['rgb-focus-outline']);+ });+/** Click UI's control height, button padding and gap, `transition.default`, and the two steps of* its `spaces` scale the shared spacing takes. */it('sizes theme controls and the shared spacing from Click UI', () => {diff --git a/packages/client/src/theme/themes/clickhouse.ts b/packages/client/src/theme/themes/clickhouse.tsindex 3c4b792d3a..0c5f4dc24f 100644--- a/packages/client/src/theme/themes/clickhouse.ts+++ b/packages/client/src/theme/themes/clickhouse.ts@@ -110,6 +110,7 @@ export const clickHouseLightTheme: IThemeRGB = {'rgb-border-destructive': '193 0 0', // #c10000 (palette.danger.600)'rgb-border-control': '128 134 145', // #808691 (palette.slate.500, 3.42:1 on background.muted)'rgb-border-field-focus': '22 21 23', // #161517 (field.color.stroke.active)+ 'rgb-focus-subtle': '67 126 239', // #437eef (outline.default, 3.84:1 on white)'rgb-field-fill': '251 252 255', // #fbfcff (field.color.background.default)'rgb-field-text': '48 46 50', // #302e32 (field.color.text.default)'rgb-surface-tooltip': '29 29 29', // #1d1d1d (tooltip.color.background.default, lch(10.767 0 0 / 0.85) taken opaque)@@ -289,6 +290,7 @@ export const clickHouseDarkTheme: IThemeRGB = {'rgb-border-destructive': '255 117 117', // #ff7575 (palette.danger.300)'rgb-border-control': '128 128 128', // #808080 (palette.neutral.500, 3.73:1 on background.muted)'rgb-border-field-focus': '250 255 105', // #faff69 (field.color.stroke.active)+ 'rgb-focus-subtle': '250 255 105', // #faff69 (outline.default)'rgb-field-fill': '45 45 45', // rgb(17.794% 17.794% 17.794%) (field.color.background.default)'rgb-field-text': '230 231 233', // #e6e7e9 (field.color.text.default)'rgb-surface-tooltip': '50 50 50', // #323232 (palette.neutral.712; tooltip.color.background.default #282828 would vanish on the #282828 canvas)diff --git a/packages/client/src/theme/themes/clickui.spec.ts b/packages/client/src/theme/themes/clickui.spec.tsindex fc33402762..fbf705a4f7 100644--- a/packages/client/src/theme/themes/clickui.spec.ts+++ b/packages/client/src/theme/themes/clickui.spec.ts@@ -74,6 +74,7 @@ const colorSources: Record<ThemeMode, Partial<Record<keyof IThemeRGB, string>>>'rgb-ring-primary': 'global.color.outline.default','rgb-focus-outline': 'global.color.outline.default','rgb-focus-control': 'global.color.outline.default',+ 'rgb-focus-subtle': 'global.color.outline.default','rgb-header-primary': 'global.color.background.default','rgb-header-hover': 'global.color.background.muted','rgb-header-button-hover': 'global.color.background.muted',@@ -218,6 +219,7 @@ const colorSources: Record<ThemeMode, Partial<Record<keyof IThemeRGB, string>>>'rgb-ring-primary': 'global.color.outline.default','rgb-focus-outline': 'global.color.outline.default','rgb-focus-control': 'global.color.outline.default',+ 'rgb-focus-subtle': 'global.color.outline.default','rgb-header-primary': 'global.color.background.default','rgb-header-hover': 'global.color.background.muted','rgb-header-button-hover': 'global.color.background.muted',diff --git a/packages/client/src/theme/themes/dark.ts b/packages/client/src/theme/themes/dark.tsindex d5fb5c31da..2e35d9d82d 100644--- a/packages/client/src/theme/themes/dark.ts+++ b/packages/client/src/theme/themes/dark.ts@@ -84,6 +84,7 @@ export const darkTheme: IThemeRGB = {'rgb-border-destructive': '239 68 68', // #ef4444 (red-500)'rgb-border-control': '33 33 33', // #212121 (gray-800), the stock field edge'rgb-border-field-focus': '236 236 236', // #ececec (gray-100, matching focus-control)+ 'rgb-focus-subtle': '89 89 89', // #595959 (gray-500, matching border-heavy)'rgb-field-fill': '13 13 13', // #0d0d0d (gray-900, matching surface-primary)'rgb-field-text': '236 236 236', // #ececec (gray-100, matching text-primary)'rgb-surface-tooltip': '13 13 13', // matching surface-primarydiff --git a/packages/client/src/theme/themes/default.ts b/packages/client/src/theme/themes/default.tsindex ae88181a3e..0f65bbc802 100644--- a/packages/client/src/theme/themes/default.ts+++ b/packages/client/src/theme/themes/default.ts@@ -84,6 +84,7 @@ export const defaultTheme: IThemeRGB = {'rgb-border-destructive': '220 38 38', // #dc2626 (red-600)'rgb-border-control': '227 227 227', // #e3e3e3 (gray-200), the stock field edge'rgb-border-field-focus': '33 33 33', // #212121 (gray-800, matching focus-control)+ 'rgb-focus-subtle': '153 150 150', // #999696 (gray-400, matching border-heavy)'rgb-field-fill': '255 255 255', // #fff (white, matching surface-primary)'rgb-field-text': '33 33 33', // #212121 (gray-800, matching text-primary)'rgb-surface-tooltip': '255 255 255', // matching surface-primarydiff --git a/packages/client/src/theme/themes/highContrast.ts b/packages/client/src/theme/themes/highContrast.tsindex 43d85146a8..0421c073e6 100644--- a/packages/client/src/theme/themes/highContrast.ts+++ b/packages/client/src/theme/themes/highContrast.ts@@ -120,6 +120,7 @@ export const highContrastLightTheme: IThemeRGB = {'rgb-border-destructive': '161 0 0', // #a10000'rgb-border-control': '0 0 0', // #000000'rgb-border-field-focus': '0 0 0', // #000000 (matching focus-control)+ 'rgb-focus-subtle': '0 0 0', // #000000 (matching border-heavy)'rgb-field-fill': '255 255 255', // #ffffff (matching surface-primary)'rgb-field-text': '0 0 0', // #000000 (matching text-primary)'rgb-surface-tooltip': '255 255 255', // matching surface-primary@@ -316,6 +317,7 @@ export const highContrastDarkTheme: IThemeRGB = {'rgb-border-destructive': '255 143 143', // #ff8f8f'rgb-border-control': '255 255 255', // #ffffff'rgb-border-field-focus': '255 255 255', // #ffffff (matching focus-control)+ 'rgb-focus-subtle': '255 255 255', // #ffffff (matching border-heavy)'rgb-field-fill': '0 0 0', // #000000 (matching surface-primary)'rgb-field-text': '255 255 255', // #ffffff (matching text-primary)'rgb-surface-tooltip': '0 0 0', // matching surface-primarydiff --git a/packages/client/src/theme/tokens.css b/packages/client/src/theme/tokens.cssindex 900dd66c61..a08cb523e1 100644--- a/packages/client/src/theme/tokens.css+++ b/packages/client/src/theme/tokens.css@@ -43,6 +43,8 @@--color-ring-primary: rgb(var(--ring-primary));--color-focus-outline: rgb(var(--focus-outline));--color-focus-control: rgb(var(--focus-control));+ /* Follows the heavy border it replaced, for a stylesheet that predates it. */+ --color-focus-subtle: rgb(var(--focus-subtle, var(--border-heavy)));--color-header-primary: rgb(var(--header-primary));--color-header-hover: rgb(var(--header-hover));--color-header-button-hover: rgb(var(--header-button-hover));diff --git a/packages/client/src/theme/types/index.ts b/packages/client/src/theme/types/index.tsindex bd8232e3cd..a6ceb4201e 100644--- a/packages/client/src/theme/types/index.ts+++ b/packages/client/src/theme/types/index.ts@@ -33,6 +33,9 @@ export interface IThemeRGB {'rgb-ring-primary'?: string;'rgb-focus-outline'?: string;'rgb-focus-control'?: string;+ /** The keyboard ring of a row or control inside content (tool rows, attachments, summaries,+ * message navigation); `rgb-border-heavy` when a theme omits it. */+ 'rgb-focus-subtle'?: string;// Header colors'rgb-header-primary'?: string;@@ -265,6 +268,7 @@ export interface IThemeVariables {'--ring-primary': string;'--focus-outline': string;'--focus-control': string;+ '--focus-subtle': string;'--header-primary': string;'--header-hover': string;'--header-button-hover': string;@@ -424,6 +428,7 @@ export interface IThemeColors {'ring-primary'?: string;'focus-outline'?: string;'focus-control'?: string;+ 'focus-subtle'?: string;'header-primary'?: string;'header-hover'?: string;'header-button-hover'?: string;diff --git a/packages/client/src/theme/utils/applyTheme.ts b/packages/client/src/theme/utils/applyTheme.tsindex 4803fb2d27..527529ccf2 100644--- a/packages/client/src/theme/utils/applyTheme.ts+++ b/packages/client/src/theme/utils/applyTheme.ts@@ -99,6 +99,10 @@ function mapColors(colors: IThemeRGB, base?: IThemeRGB): Array<[string, string]>variables.push(['--chart-widget-stroke', colors['rgb-border-light']]);}+ if (colors['rgb-focus-subtle'] === undefined && colors['rgb-border-heavy'] !== undefined) {+ variables.push(['--focus-subtle', colors['rgb-border-heavy']]);+ }+const legacyControlBorder = controlBorderFallback(colors);if (legacyControlBorder !== undefined) {variables.push(['--border-control', legacyControlBorder]);diff --git a/packages/data-provider/src/theme.ts b/packages/data-provider/src/theme.tsindex 2002116875..6229ebbdf5 100644--- a/packages/data-provider/src/theme.ts+++ b/packages/data-provider/src/theme.ts@@ -82,6 +82,7 @@ export const themeColorTokens = Object.freeze(['rgb-border-destructive','rgb-border-control','rgb-border-field-focus',+ 'rgb-focus-subtle','rgb-field-fill','rgb-field-text','rgb-surface-tooltip',