Merge pull request #504 from chriswritescode-dev/om-242-define-missing-tailwind-theme-tokens-and

feat: Define missing Tailwind theme tokens and consolidate design-system drift (OM-242)
This commit is contained in:
Chris Scott authored and GitHub committed 2026-12-03 13:39:03 -05:00
commit d7131dd895
26 files changed
+84 -47

No files matched your search

@@ -14,7 +14,7 @@ export function ActivityCountPill({ needsInput, running, className }: ActivityCo
<span
aria-hidden="true"
className={cn(
'flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-[10px] font-semibold leading-none',
'flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-2xs font-semibold leading-none',
needsInput > 0 ? 'bg-warning text-warning-foreground' : 'bg-primary text-primary-foreground',
className,
)}
@@ -122,7 +122,7 @@ export function ContentDiffViewer({ before, after }: ContentDiffViewerProps) {
)}
>
{!isMobile && (
<div className="flex-shrink-0 w-14 flex text-muted-foreground/50 text-[10px]">
<div className="flex-shrink-0 w-14 flex text-muted-foreground/50 text-2xs">
<span className="w-7 px-1 text-right">
{line.oldLineNumber || ''}
</span>
@@ -337,7 +337,7 @@ function QueuedPromptRow({ item }: { item: SessionInboxUser }) {
/>
<div className="mt-2 flex items-center gap-2 text-xs text-muted-foreground">
<span>{new Date(item.time.created).toLocaleTimeString()}</span>
<span className="font-mono text-[11px] font-semibold tracking-wider text-warning">
<span className="font-mono text-2xs font-semibold tracking-wider text-warning">
{item.delivery === 'queue' ? 'QUEUED' : 'STEERING'}
</span>
</div>
@@ -1209,7 +1209,7 @@ if (isIOS && isSecureContext && navigator.clipboard && navigator.clipboard.read)
}`}
>
{key.symbol}
<span className="truncate font-sans text-[11px] font-medium opacity-80">{key.label}</span>
<span className="truncate font-sans text-2xs font-medium opacity-80">{key.label}</span>
</button>
)
})}
@@ -1249,7 +1249,7 @@ return (
{composerModeStyle && (
<span
data-testid="composer-mode-badge"
className={`absolute -top-2.5 left-3 z-10 px-1.5 py-0.5 rounded text-[10px] font-bold tracking-widest pointer-events-none ${composerModeStyle.badge}`}
className={`absolute -top-2.5 left-3 z-10 px-1.5 py-0.5 rounded text-2xs font-bold tracking-widest pointer-events-none ${composerModeStyle.badge}`}
>
{composerModeStyle.label}
</span>
@@ -129,7 +129,7 @@ export function PromptSuggestions<T>({
)}
</span>
{item.tag && (
<span className="flex-shrink-0 text-[10px] font-semibold uppercase tracking-wider px-1.5 py-0.5 rounded border border-border opacity-80">
<span className="flex-shrink-0 text-2xs font-semibold uppercase tracking-wider px-1.5 py-0.5 rounded border border-border opacity-80">
{item.tag}
</span>
)}
@@ -176,7 +176,7 @@ function ConfigSection({ label, children }: ConfigSectionProps) {
className="flex flex-col gap-1"
>
{label ? (
<div id={labelId} className="px-2 text-[11px] font-medium uppercase tracking-wide text-muted-foreground">
<div id={labelId} className="px-2 text-2xs font-medium uppercase tracking-wide text-muted-foreground">
{label}
</div>
) : null}
@@ -608,9 +608,9 @@ export const SessionConfigMenu = memo(function SessionConfigMenu({
· {modelName || 'Select model'}
</span>
{showVariant && currentVariant ? (
<span className="shrink-0 text-[11px] text-muted-foreground">{capitalize(currentVariant)}</span>
<span className="shrink-0 text-2xs text-muted-foreground">{capitalize(currentVariant)}</span>
) : null}
<span className={cn('shrink-0 text-[11px] font-medium', usageLabel ? usageTone : 'text-muted-foreground')}>
<span className={cn('shrink-0 text-2xs font-medium', usageLabel ? usageTone : 'text-muted-foreground')}>
{usageLabel ?? 'No context yet'}
</span>
</span>
@@ -266,7 +266,7 @@ export const ToolCallPart = memo(function ToolCallPart({ part, messageID, direct
{isCompleted && <span className="text-success text-sm font-medium">✓</span>}
{isError && <span className="text-destructive text-sm font-medium">✗</span>}
<span className="font-medium text-foreground truncate">{description}</span>
<span className="text-[11px] font-medium text-highlight shrink-0">sub-agent</span>
<span className="text-2xs font-medium text-highlight shrink-0">sub-agent</span>
{backgroundIndicator}
{subagentSessionId && <ExternalLink className="w-3 h-3 shrink-0 text-primary" />}
</div>
@@ -144,7 +144,7 @@ export function VoiceConversationBar({
</div>
</div>
<div className="flex flex-col items-center">
<p className={cn(RESERVED_LINE_CLASS, 'text-[11px] text-muted-foreground')}>{notice ?? ''}</p>
<p className={cn(RESERVED_LINE_CLASS, 'text-2xs text-muted-foreground')}>{notice ?? ''}</p>
<p className={cn(RESERVED_LINE_CLASS, 'text-xs text-muted-foreground')}>{hint}</p>
</div>
</div>
@@ -82,7 +82,7 @@ export function RepoNavGroup({
)}
>
<span className="flex min-w-0 items-center gap-1.5">
<span className="truncate text-[15px] font-bold tracking-tight text-highlight">
<span className="truncate text-sm font-bold tracking-tight text-highlight">
{name}
</span>
{indicator}
@@ -141,7 +141,7 @@ export function SessionNavRow({ item, isCurrent, onSelect, repoLabel }: SessionN
<span className="max-w-24 shrink-0 truncate text-xs text-highlight">{repoLabel}</span>
)}
{item.worktreeBranch && (
<span className="max-w-24 shrink-0 truncate font-mono text-[11px] text-primary">
<span className="max-w-24 shrink-0 truncate font-mono text-2xs text-primary">
{item.worktreeBranch}
</span>
)}
@@ -12,7 +12,7 @@ export function ScheduleReportsBadge({ total, failed, className }: ScheduleRepor
return (
<span
className={cn(
'absolute -top-1 -right-1 min-w-4 rounded-full px-1 text-center text-[10px] font-medium leading-4 text-primary-foreground',
'absolute -top-1 -right-1 min-w-4 rounded-full px-1 text-center text-2xs font-medium leading-4 text-primary-foreground',
failed > 0 ? 'bg-destructive' : 'bg-primary',
className,
)}
@@ -242,7 +242,7 @@ export function MultiRunCard({
<div className="border-t border-border">
<h4 className="flex items-center gap-2 px-3 pt-3 text-xs font-semibold uppercase tracking-wide text-muted-foreground">
Fusions
<span className="rounded-full border border-border px-1.5 text-[11px] font-medium normal-case">
<span className="rounded-full border border-border px-1.5 text-2xs font-medium normal-case">
{run.fusions.length}
</span>
</h4>
@@ -233,10 +233,10 @@ export function WorktreeSessionGroups({
<div className="flex min-w-0 items-center gap-2">
<span className="truncate text-sm font-medium">{label}</span>
{sourceLabel && source && (
<span className={`shrink-0 rounded-none border px-1.5 text-[10px] leading-4 ${OWNER_BADGE_CLASS[source]}`}>{sourceLabel}</span>
<span className={`shrink-0 rounded-none border px-1.5 text-2xs leading-4 ${OWNER_BADGE_CLASS[source]}`}>{sourceLabel}</span>
)}
{isInUse && (
<span className="inline-flex shrink-0 items-center gap-1 rounded-full border border-success/40 bg-success/15 px-1.5 text-[10px] leading-4 text-success">
<span className="inline-flex shrink-0 items-center gap-1 rounded-full border border-success/40 bg-success/15 px-1.5 text-2xs leading-4 text-success">
<span className="h-1.5 w-1.5 animate-pulse rounded-full bg-success" />
in use
</span>
@@ -245,7 +245,7 @@ export function WorktreeSessionGroups({
{group.sessions.length} {group.sessions.length === 1 ? 'session' : 'sessions'}
</span>
</div>
<div className="truncate font-mono text-[11px] text-muted-foreground" title={group.directory}>{group.directory}</div>
<div className="truncate font-mono text-2xs text-muted-foreground" title={group.directory}>{group.directory}</div>
</div>
</button>
{renderWorktreeActions(group, label, false)}
@@ -41,7 +41,7 @@ export function WorktreeTabs({
<TabsTrigger value="workspaces" className={tabClassName}>
<Layers className="h-3 w-3 shrink-0 text-primary" />
<span className={`min-w-0 truncate ${activeLabelClassName}`}>Worktrees</span>
<span className="shrink-0 rounded-full border border-border bg-card px-1.5 text-[11px] leading-4 text-muted-foreground">
<span className="shrink-0 rounded-full border border-border bg-card px-1.5 text-2xs leading-4 text-muted-foreground">
{workspaces.length}
</span>
</TabsTrigger>
@@ -35,10 +35,10 @@ export function PromptTemplateCard({ template, selected = false, onApply, onEdit
const content = (
<>
<div className="flex flex-wrap items-center gap-2">
<Badge className="border-transparent bg-highlight text-[10px] uppercase tracking-wide text-highlight-foreground">
<Badge className="border-transparent bg-highlight text-2xs uppercase tracking-wide text-highlight-foreground">
{template.category}
</Badge>
<Badge className="border-transparent bg-muted text-[10px] uppercase tracking-wide text-foreground">
<Badge className="border-transparent bg-muted text-2xs uppercase tracking-wide text-foreground">
{template.cadenceHint}
</Badge>
</div>
@@ -29,7 +29,7 @@ function isUnreadRun(lastRun: ScheduleRunSummary): boolean {
function ScheduleJobNewPill() {
return (
<span className="shrink-0 rounded-full bg-primary/15 px-1.5 py-0.5 text-[10px] font-medium text-primary">
<span className="shrink-0 rounded-full bg-primary/15 px-1.5 py-0.5 text-2xs font-medium text-primary">
NEW
</span>
)
@@ -187,7 +187,7 @@ export function ScheduleJobsTable({
{job.retainedWorktreeCount > 0 && (
<span
title="Worktrees this schedule has left on disk. Manage them from the job details."
className="shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground"
className="shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-2xs font-medium text-muted-foreground"
>
{job.retainedWorktreeCount} worktree{job.retainedWorktreeCount === 1 ? '' : 's'}
</span>
@@ -98,7 +98,7 @@ export function ScheduleRunsTable({
{getRunTitle(run)}
</button>
{isUnread && (
<span className="shrink-0 rounded-full bg-primary/15 px-1.5 py-0.5 text-[10px] font-medium text-primary">NEW</span>
<span className="shrink-0 rounded-full bg-primary/15 px-1.5 py-0.5 text-2xs font-medium text-primary">NEW</span>
)}
</span>
{run.errorText && (
@@ -453,7 +453,7 @@ function FieldLabel({
{required && <span className="text-destructive ml-0.5">*</span>}
</label>
{description && (
<p id={`${id}-description`} className="text-[15px] text-foreground/70 md:text-xs">
<p id={`${id}-description`} className="text-sm text-foreground/70 md:text-xs">
{description}
</p>
)}
@@ -478,7 +478,7 @@ function FieldGroup({
{label}
{required && <span className="text-destructive ml-0.5">*</span>}
</legend>
{description && <p className="text-[15px] text-foreground/70 md:text-xs">{description}</p>}
{description && <p className="text-sm text-foreground/70 md:text-xs">{description}</p>}
{children}
</fieldset>
)
@@ -330,10 +330,10 @@ export function BranchesTab({ repoId, currentBranch }: BranchesTabProps) {
)}
<span className="flex-1 text-sm truncate">{branch.name}</span>
{(isCheckedOutElsewhere || (isCurrent && isRepoWorktree)) && (
<span className="text-[10px] px-1.5 py-0.5 rounded bg-primary/20 text-primary">worktree</span>
<span className="text-2xs px-1.5 py-0.5 rounded bg-primary/20 text-primary">worktree</span>
)}
{branch.type === 'local' && !branch.upstream && !branch.isWorktree && !(isCurrent && isRepoWorktree) && (
<span className="text-[10px] px-1.5 py-0.5 rounded bg-muted text-muted-foreground">local</span>
<span className="text-2xs px-1.5 py-0.5 rounded bg-muted text-muted-foreground">local</span>
)}
{isCurrent && <Check className={`w-4 h-4 ${GIT_UI_COLORS.current}`} />}
</button>
@@ -184,7 +184,7 @@ export function ChangesTab({ repoId, onFileSelect, onClearFileSelection, selecte
)}
Commit {stagedFiles.length > 0 && `(${stagedFiles.length} staged)`}
</Button>
<p className="text-[10px] text-muted-foreground text-center">
<p className="text-2xs text-muted-foreground text-center">
{navigator.platform.includes('Mac') ? '⌘' : 'Ctrl'}+Enter to commit
</p>
</div>
@@ -74,7 +74,7 @@ export function GitFlatFileItem({ file, isSelected, onSelect, onStage, onUnstage
)}
</div>
{file.staged && (
<span className={cn('text-[10px] px-1.5 py-0.5 rounded flex-shrink-0', GIT_UI_COLORS.stagedBadge)}>
<span className={cn('text-2xs px-1.5 py-0.5 rounded flex-shrink-0', GIT_UI_COLORS.stagedBadge)}>
staged
</span>
)}
@@ -198,7 +198,7 @@ export function TerminalWorkspace({ target, directory, isOpen, onLastTerminalExi
>
<span className="truncate">{terminal.title}</span>
{terminal.status === 'exited' && (
<span className="rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground">
<span className="rounded bg-muted px-1.5 py-0.5 text-2xs text-muted-foreground">
{terminal.exitCode !== undefined ? `exited (${terminal.exitCode})` : 'exited'}
</span>
)}
+15 -8
View File
@@ -2,23 +2,26 @@
@theme {
--color-background: #0a0a0a;
--color-background-gradient: #0d0d0d;
--color-background-gradient: #0a0a0a;
--color-foreground: #fafafa;
--color-card: #141414;
--color-card-hover: #1a1a1a;
--color-card-foreground: #fafafa;
--color-border: #2a2a2a;
--color-ring: #d4d4d8;
--color-primary: #1d4ed8;
--color-primary-hover: #1e40af;
--color-primary-foreground: #fafafa;
--color-muted-foreground: #d4d4d8;
--color-placeholder: color-mix(in oklab, var(--color-muted-foreground) 55%, var(--color-background));
--color-accent: #27272a;
--color-accent: #2a2a2a;
--color-input: #323232;
--color-muted: #18181b;
--color-popover: #18181b;
--color-muted: #141414;
--color-popover: #141414;
--color-popover-foreground: #fafafa;
--color-destructive: #dc2626;
--color-destructive-foreground: #ffffff;
--color-secondary: #27272a;
--color-secondary: #2a2a2a;
--color-secondary-foreground: #fafafa;
--color-accent-foreground: #fafafa;
--color-success: #34d399;
@@ -45,6 +48,7 @@
--color-syntax-variable: #ffa657;
--color-syntax-operator: #79c0ff;
--color-syntax-punctuation: #d4d4d8;
--text-2xs: 0.625rem;
}
:root:not(.dark) {
@@ -53,7 +57,9 @@
--color-foreground: #111827;
--color-card: #f9fafb;
--color-card-hover: #f3f4f6;
--color-card-foreground: #111827;
--color-border: #e5e7eb;
--color-ring: #6b7280;
--color-primary: #1d4ed8;
--color-primary-hover: #1e40af;
--color-primary-foreground: #ffffff;
@@ -63,6 +69,7 @@
--color-input: #e5e7eb;
--color-muted: #f4f4f5;
--color-popover: #ffffff;
--color-popover-foreground: #111827;
--color-destructive: #dc2626;
--color-destructive-foreground: #ffffff;
--color-secondary: #f4f4f5;
@@ -82,7 +89,7 @@
--color-agent-build: #034cff;
--color-agent-docs: #ffb224;
--color-agent-ask: #0091ff;
--color-syntax-comment: #6a737d;
--color-syntax-comment: #6b7280;
--color-syntax-keyword: #d73a49;
--color-syntax-string: #032f62;
--color-syntax-primitive: #6f42c1;
@@ -366,7 +373,7 @@ body {
.prose-enhanced th,
.prose-enhanced td {
padding: 0.375rem 0.5rem;
padding: 0.25rem 0.5rem;
font-size: 0.75rem;
}
}
@@ -541,7 +548,7 @@ input:-webkit-autofill:active {
*::-webkit-scrollbar-thumb {
background-color: var(--color-border);
border-radius: 3px;
border-radius: var(--radius-sm);
}
*::-webkit-scrollbar-thumb:hover {
+29
View File
@@ -1,4 +1,5 @@
import indexHtml from '../../../index.html?raw'
import indexCss from '../../index.css?raw'
import { beforeEach, describe, expect, it } from 'vitest'
import {
APPEARANCE_STORAGE_KEY,
@@ -14,6 +15,10 @@ function themeColorMeta(): string | null {
return document.querySelector('meta[name="theme-color"]')?.getAttribute('content') ?? null
}
function countOccurrences(source: string, needle: string): number {
return source.split(needle).length - 1
}
function appearanceSnapshot() {
const raw = window.localStorage.getItem(APPEARANCE_STORAGE_KEY)
if (!raw) throw new Error('appearance snapshot missing')
@@ -35,9 +40,33 @@ describe('applyColorTheme', () => {
expect(root.style.getPropertyValue('--color-foreground')).toBe('#f8f8f2')
expect(root.style.getPropertyValue('--color-primary')).toBe('#bd93f9')
expect(root.style.getPropertyValue('--color-destructive')).toBe('#ff5555')
expect(root.style.getPropertyValue('--color-ring')).toBe('color-mix(in oklab, #f8f8f2 62%, #1d1e28)')
expect(root.style.getPropertyValue('--color-card-foreground')).toBe('#f8f8f2')
expect(root.style.getPropertyValue('--color-popover-foreground')).toBe('#f8f8f2')
expect(themeColorMeta()).toBe('#1d1e28')
})
it('derives the focus ring and the card and popover foregrounds from the palette', () => {
const dark = resolveColorThemeTokens('dracula', true)
const light = resolveColorThemeTokens('dracula', false)
expect(dark?.ring).toBe(dark?.['muted-foreground'])
expect(dark?.['card-foreground']).toBe('#f8f8f2')
expect(dark?.['popover-foreground']).toBe('#f8f8f2')
expect(light?.['card-foreground']).toBe('#1f1f2f')
expect(light?.['popover-foreground']).toBe('#1f1f2f')
expect(resolveColorThemeTokens('oc-2', true)?.ring).toBe('#707070')
})
it('defines every themed token once for dark mode and once for light mode', () => {
const keys = Object.keys(resolveColorThemeTokens('dracula', true) ?? {})
expect(keys).toEqual(expect.arrayContaining(['ring', 'card-foreground', 'popover-foreground']))
for (const key of keys) {
expect(countOccurrences(indexCss, `--color-${key}:`)).toBe(2)
}
})
it('applies the Dracula light palette when the mode is light', () => {
applyColorTheme(document.documentElement, 'dracula', false)
+6
View File
@@ -9,7 +9,9 @@ const MANAGER_THEME_TOKENS = [
'foreground',
'card',
'card-hover',
'card-foreground',
'border',
'ring',
'primary',
'primary-hover',
'primary-foreground',
@@ -18,6 +20,7 @@ const MANAGER_THEME_TOKENS = [
'input',
'muted',
'popover',
'popover-foreground',
'destructive',
'destructive-foreground',
'secondary',
@@ -134,11 +137,14 @@ export function resolveColorThemeTokens(
foreground: ink,
card: mix(4),
'card-hover': mix(7),
'card-foreground': ink,
popover: mix(5),
'popover-foreground': ink,
muted: mix(6),
accent: mix(10),
secondary: mix(10),
border: mix(14),
ring: mutedForeground,
input: mix(16),
'muted-foreground': mutedForeground,
primary,
@@ -3,10 +3,6 @@ import textPart from '../../components/message/TextPart.tsx?raw'
import { describe, expect, it } from 'vitest'
import { resolveColorThemeTokens } from './colorTheme'
function countOccurrences(source: string, needle: string): number {
return source.split(needle).length - 1
}
describe('syntax highlight stylesheet', () => {
it('does not import GitHub highlight.js stylesheets', () => {
expect(indexCss).not.toContain('highlight.js/styles')
@@ -26,7 +22,6 @@ describe('syntax highlight stylesheet', () => {
for (const key of syntaxKeys) {
expect(indexCss).toContain(`var(--color-${key})`)
expect(countOccurrences(indexCss, `--color-${key}:`)).toBe(2)
}
})
})
+3 -3
View File
@@ -839,13 +839,13 @@ export function SessionDetail() {
handleParentSessionClick();
}}
aria-label="Parent session"
className="mt-0.5 inline-flex max-w-full items-center gap-1 rounded-full border border-info/40 px-2 py-0.5 text-[10px] sm:text-xs text-info transition-colors hover:bg-info/10"
className="mt-0.5 inline-flex max-w-full items-center gap-1 rounded-full border border-info/40 px-2 py-0.5 text-2xs sm:text-xs text-info transition-colors hover:bg-info/10"
>
<CornerUpLeft className="h-3 w-3 shrink-0" />
<span className="truncate">Parent session</span>
</button>
) : (
<p className="flex min-w-0 items-center gap-1 text-[10px] sm:text-xs text-muted-foreground">
<p className="flex min-w-0 items-center gap-1 text-2xs sm:text-xs text-muted-foreground">
{isRemoteServer && (
<Server aria-label="Remote server" className="h-3 w-3 shrink-0 text-highlight" />
)}
@@ -861,7 +861,7 @@ export function SessionDetail() {
variant="outline"
data-testid="session-branch"
title={`Branch: ${headerBranch}`}
className="hidden sm:inline-flex max-w-44 shrink-0 items-center gap-1 border-border bg-card px-2 font-mono text-[11px] font-normal text-muted-foreground"
className="hidden sm:inline-flex max-w-44 shrink-0 items-center gap-1 border-border bg-card px-2 font-mono text-2xs font-normal text-muted-foreground"
>
<GitBranch className="h-3 w-3 shrink-0" />
<span className="truncate">{headerBranch}</span>