Skip to content

Commit 3e8da02

Browse files
fix(web): web colors come from theme tokens
Enable shadcn/no-raw-colors as an error for all of apps/web/src, including components/ui (it had no findings there). 267 findings -> 0. Status colors move onto the tokens the theme already declares, so they follow custom themes and each light/dark pair collapses into one class: - amber -> warning / warning-foreground / warning-surface - emerald -> success / success-foreground - sky, blue -> info / info-foreground - red -> destructive / destructive-foreground The Diagnostics I/O read/write series (sky/amber) and process category dots use info/warning/success too, the nearest tokens, not status meanings. One-offs go to the nearest existing token: the favorite model star (yellow) uses warning, the artifact template sparkle badge (fuchsia) uses primary, the "waiting for input" toast icon (indigo) uses info-foreground, the CLI auth eyebrow (blue) uses primary, the provider driver option hover (zinc-50) uses accent, and the quit overlay pill (neutral-700 + white) inverts with foreground/background. SVG strokes in ContextWindowMeter and DesktopUpdateStatusIcon use stroke utilities with the existing tokens instead of inline color-mix(). No new tokens. Exemption: Icons.tsx and JetBrainsIcons.tsx have the rule off. They hold third-party marks that must keep their exact colors (brand logos, and now also the macOS Screen Recording / Accessibility pane marks from the SnapShot setup dialog and Codex's Computer Use mark from the work log, moved there from their feature files for that reason). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1 parent c5aa11f commit 3e8da02

28 files changed

Lines changed: 173 additions & 172 deletions

‎apps/web/src/components/ChatMarkdown.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ function CodexArtifactTemplateCard(props: {
308308
<div className="flex min-w-0 flex-1 items-center gap-3">
309309
<span className="relative flex size-9 shrink-0 items-center justify-center rounded-lg border border-border/70 bg-background text-muted-foreground shadow-xs">
310310
<Icon aria-hidden className="size-5" />
311-
<span className="absolute -right-1 -bottom-1 flex size-4 items-center justify-center rounded-full border border-background bg-fuchsia-500 text-white shadow-xs">
311+
<span className="absolute -right-1 -bottom-1 flex size-4 items-center justify-center rounded-full border border-background bg-primary text-primary-foreground shadow-xs">
312312
<SparklesIcon aria-hidden className="size-2.5" />
313313
</span>
314314
</span>

‎apps/web/src/components/Icons.tsx‎

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -781,3 +781,88 @@ export const ForgejoIcon: Icon = (props) => (
781781
</g>
782782
</svg>
783783
);
784+
785+
// macOS System Settings > Privacy & Security pane marks, so the SnapShot setup
786+
// step points at the same icon the user is about to look for.
787+
export const MacScreenRecordingIcon: Icon = (props) => {
788+
const gradientId = useId();
789+
return (
790+
<svg viewBox="0 0 32 32" aria-hidden="true" {...props}>
791+
<defs>
792+
<linearGradient id={gradientId} x2="0" y2="1">
793+
<stop stopColor="#ff6972" />
794+
<stop offset="1" stopColor="#ff2938" />
795+
</linearGradient>
796+
</defs>
797+
<rect
798+
x="0.5"
799+
y="0.5"
800+
width="31"
801+
height="31"
802+
rx="7"
803+
fill={`url(#${gradientId})`}
804+
stroke="#ffffff40"
805+
/>
806+
<circle cx="16" cy="16" r="10" fill="none" stroke="#fff" strokeWidth="2" />
807+
<circle cx="16" cy="16" r="4.5" fill="#fff" />
808+
</svg>
809+
);
810+
};
811+
812+
export const MacAccessibilityIcon: Icon = (props) => {
813+
const gradientId = useId();
814+
return (
815+
<svg viewBox="0 0 32 32" aria-hidden="true" {...props}>
816+
<defs>
817+
<linearGradient id={gradientId} x2="0" y2="1">
818+
<stop stopColor="#48b6ff" />
819+
<stop offset="1" stopColor="#0085ff" />
820+
</linearGradient>
821+
</defs>
822+
<rect
823+
x="0.5"
824+
y="0.5"
825+
width="31"
826+
height="31"
827+
rx="7"
828+
fill={`url(#${gradientId})`}
829+
stroke="#ffffff40"
830+
/>
831+
<circle cx="16" cy="16" r="10" fill="none" stroke="#fff" strokeWidth="1.75" />
832+
<circle cx="16" cy="10" r="1.6" fill="#fff" />
833+
<path
834+
d="m10 13 6 1 6-1M16 14v4m0 0-2.5 6m2.5-6 2.5 6"
835+
fill="none"
836+
stroke="#fff"
837+
strokeWidth="1.6"
838+
strokeLinecap="round"
839+
strokeLinejoin="round"
840+
/>
841+
</svg>
842+
);
843+
};
844+
845+
// Codex's Computer Use app mark, shown on computer-use rows in the work log.
846+
export const ComputerUseAppIcon: Icon = (props) => {
847+
const gradientId = `${useId().replaceAll(":", "")}-computer-use-app-gradient`;
848+
return (
849+
<svg viewBox="0 0 24 24" aria-hidden="true" {...props}>
850+
<defs>
851+
<linearGradient id={gradientId} x1="2" y1="2" x2="22" y2="22">
852+
<stop offset="0" stopColor="#00dff0" />
853+
<stop offset="0.42" stopColor="#3b9cff" />
854+
<stop offset="0.72" stopColor="#b044f5" />
855+
<stop offset="1" stopColor="#ff78b6" />
856+
</linearGradient>
857+
</defs>
858+
<rect x="1" y="1" width="22" height="22" rx="5" fill={`url(#${gradientId})`} />
859+
<path
860+
d="m7.2 6.2 10.5 4.1-4.2 2.1-2 4.7z"
861+
fill="white"
862+
stroke="#315cff"
863+
strokeWidth="1.1"
864+
strokeLinejoin="round"
865+
/>
866+
</svg>
867+
);
868+
};

‎apps/web/src/components/LegacySidebar.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP
806806
<button
807807
type="button"
808808
aria-label={`Open localhost:${discoveredPorts[0]?.port ?? ""}`}
809-
className="inline-flex cursor-pointer items-center justify-center text-emerald-600 outline-hidden focus-visible:ring-1 focus-visible:ring-ring dark:text-emerald-400"
809+
className="inline-flex cursor-pointer items-center justify-center text-success-foreground outline-hidden focus-visible:ring-1 focus-visible:ring-ring"
810810
onClick={handleOpenDiscoveredPort}
811811
/>
812812
}

‎apps/web/src/components/QuitHoldOverlay.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export function QuitHoldOverlay() {
4848
role="status"
4949
className="pointer-events-none fixed inset-x-0 top-[22%] z-100 flex justify-center"
5050
>
51-
<div className="rounded-full bg-neutral-700/95 px-8 py-4 text-2xl font-bold text-white shadow-xl">
51+
<div className="rounded-full bg-foreground/95 px-8 py-4 text-2xl font-bold text-background shadow-xl">
5252
{message}
5353
</div>
5454
</div>

‎apps/web/src/components/Sidebar.tsx‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ function SidebarThreadTooltip({
414414
</div>
415415
) : null}
416416
{thread.session?.lastError ? (
417-
<div className="flex min-w-0 items-center gap-2 text-red-600 dark:text-red-400">
417+
<div className="flex min-w-0 items-center gap-2 text-destructive-foreground">
418418
<CircleAlertIcon className="size-3 shrink-0 stroke-current" />
419419
<div className="min-w-0 truncate">Error occurred</div>
420420
</div>
@@ -529,8 +529,8 @@ function SortableThreadRow(props: {
529529

530530
// Unsent work shares one look: the new-thread draft rows and thread rows
531531
// with unsent composer text both use this tint and pen so they read alike.
532-
const draftSurfaceClassName = "bg-amber-400/[0.04] hover:bg-amber-400/[0.08]";
533-
const draftPenClassName = "size-3 shrink-0 text-amber-600 dark:text-amber-300/80";
532+
const draftSurfaceClassName = "bg-warning/4 hover:bg-warning/8";
533+
const draftPenClassName = "size-3 shrink-0 text-warning-foreground";
534534

535535
// Structural list items — the section headers and the
536536
// empty-section placeholders — take part in the sortable list so they shift
@@ -647,7 +647,7 @@ function SidebarSectionHeader(props: {
647647
const snoozed = props.marker === "snoozed-header";
648648
const className = cn(
649649
"flex h-full w-full items-center gap-2 px-2 text-left text-xs font-medium",
650-
snoozed ? "text-blue-600 dark:text-blue-400" : "text-sidebar-muted-foreground/60",
650+
snoozed ? "text-info-foreground" : "text-sidebar-muted-foreground/60",
651651
props.dragging && "text-sidebar-foreground/80",
652652
props.isDropTarget && "text-primary",
653653
);
@@ -658,7 +658,7 @@ function SidebarSectionHeader(props: {
658658
aria-hidden
659659
className={cn(
660660
"h-px min-w-2 flex-1",
661-
snoozed ? "bg-blue-500/20 dark:bg-blue-400/15" : "bg-sidebar-border/60",
661+
snoozed ? "bg-info/20" : "bg-sidebar-border/60",
662662
props.dragging && "bg-sidebar-foreground/25",
663663
props.isDropTarget && "bg-primary/50",
664664
)}
@@ -1143,7 +1143,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: {
11431143
? {
11441144
label: "Approval",
11451145
icon: "approval" as const,
1146-
className: "text-amber-700 dark:text-amber-300",
1146+
className: "text-warning-foreground",
11471147
}
11481148
: status === "input"
11491149
? {
@@ -1161,7 +1161,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: {
11611161
? {
11621162
label: "Woke",
11631163
icon: "woke" as const,
1164-
className: "text-amber-700 dark:text-amber-300",
1164+
className: "text-warning-foreground",
11651165
}
11661166
: isUnread
11671167
? {
@@ -1629,7 +1629,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: {
16291629
{variantAction === "unsnooze" && props.snoozeWakeLabelText !== null ? (
16301630
// Snoozed rows show when they come BACK, not when they were
16311631
// last touched — the return ticket is the row's whole story.
1632-
<span className="text-xs text-blue-600 tabular-nums dark:text-blue-400">
1632+
<span className="text-xs text-info-foreground tabular-nums">
16331633
{props.snoozeWakeLabelText}
16341634
</span>
16351635
) : isWoke ? (
@@ -1642,7 +1642,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: {
16421642
type="button"
16431643
aria-label="Dismiss Woke notification"
16441644
onClick={handleAcknowledgeWokeClick}
1645-
className="inline-flex cursor-pointer items-center gap-1 rounded-sm text-xs font-medium text-amber-700 outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring dark:text-amber-300"
1645+
className="inline-flex cursor-pointer items-center gap-1 rounded-sm text-xs font-medium text-warning-foreground outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring"
16461646
>
16471647
<AlarmClockIcon aria-hidden className="size-3" />
16481648
<span role="status">Woke</span>

‎apps/web/src/components/ThreadNotificationCoordinator.tsx‎

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -164,22 +164,13 @@ function EnvironmentNotifications({
164164
hideCopyButton: true,
165165
leadingIcon:
166166
kind === "completion" ? (
167-
<CircleCheckIcon
168-
aria-hidden
169-
className="size-4 text-emerald-700 dark:text-emerald-300"
170-
/>
167+
<CircleCheckIcon aria-hidden className="size-4 text-success-foreground" />
171168
) : status === "approval" ? (
172-
<ShieldQuestionIcon
173-
aria-hidden
174-
className="size-4 text-amber-700 dark:text-amber-300"
175-
/>
169+
<ShieldQuestionIcon aria-hidden className="size-4 text-warning-foreground" />
176170
) : status === "failed" ? (
177-
<CircleAlertIcon aria-hidden className="size-4 text-red-700 dark:text-red-300" />
171+
<CircleAlertIcon aria-hidden className="size-4 text-destructive-foreground" />
178172
) : (
179-
<MessageCircleQuestionIcon
180-
aria-hidden
181-
className="size-4 text-indigo-600 dark:text-indigo-300"
182-
/>
173+
<MessageCircleQuestionIcon aria-hidden className="size-4 text-info-foreground" />
183174
),
184175
},
185176
actionProps: {

‎apps/web/src/components/ThreadSearchMatch.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export function ThreadSearchMatchExcerpt(props: {
5757
const isUser = props.match.source === "user";
5858
return (
5959
<span className="truncate text-xs text-muted-foreground/85">
60-
<span className={isUser ? "text-blue-400" : "text-emerald-400"}>
60+
<span className={isUser ? "text-info-foreground" : "text-success-foreground"}>
6161
{isUser ? "You:" : "Agent:"}
6262
</span>{" "}
6363
<HighlightedSearchText text={props.match.snippet} query={props.match.query} />

‎apps/web/src/components/chat/ChatComposer.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6559,7 +6559,7 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
65596559
<span
65606560
role="img"
65616561
aria-label="Draft attachment may not persist"
6562-
className="absolute left-1 top-1 inline-flex items-center justify-center rounded bg-background/85 p-0.5 text-amber-600"
6562+
className="absolute left-1 top-1 inline-flex items-center justify-center rounded bg-background/85 p-0.5 text-warning-foreground"
65636563
>
65646564
<CircleAlertIcon className="size-3" />
65656565
</span>

‎apps/web/src/components/chat/ContextWindowMeter.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export function ContextWindowMeter(props: {
6363
cy="12"
6464
r={radius}
6565
fill="none"
66-
stroke="color-mix(in oklab, var(--color-muted-foreground) 24%, transparent)"
66+
className="stroke-muted-foreground/24"
6767
strokeWidth="3"
6868
/>
6969
<circle

‎apps/web/src/components/chat/MessagesTimeline.tsx‎

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ import {
6363
use,
6464
useCallback,
6565
useEffect,
66-
useId,
6766
useLayoutEffect,
6867
useMemo,
6968
useRef,
@@ -256,6 +255,7 @@ import {
256255
type ReviewCommentContext,
257256
} from "../../reviewCommentContext";
258257
import { PullRequestGlyph } from "~/components/pullRequest/pullRequestIcons";
258+
import { ComputerUseAppIcon } from "~/components/Icons";
259259

260260
// ---------------------------------------------------------------------------
261261
// Context — shared state consumed by every row component via Context.
@@ -4146,30 +4146,6 @@ function BrowserAppIcon({ className }: { className: string }) {
41464146
);
41474147
}
41484148

4149-
function ComputerUseAppIcon({ className }: { className: string }) {
4150-
const gradientId = `${useId().replaceAll(":", "")}-computer-use-app-gradient`;
4151-
return (
4152-
<svg viewBox="0 0 24 24" className={className} aria-hidden>
4153-
<defs>
4154-
<linearGradient id={gradientId} x1="2" y1="2" x2="22" y2="22">
4155-
<stop offset="0" stopColor="#00dff0" />
4156-
<stop offset="0.42" stopColor="#3b9cff" />
4157-
<stop offset="0.72" stopColor="#b044f5" />
4158-
<stop offset="1" stopColor="#ff78b6" />
4159-
</linearGradient>
4160-
</defs>
4161-
<rect x="1" y="1" width="22" height="22" rx="5" fill={`url(#${gradientId})`} />
4162-
<path
4163-
d="m7.2 6.2 10.5 4.1-4.2 2.1-2 4.7z"
4164-
fill="white"
4165-
stroke="#315cff"
4166-
strokeWidth="1.1"
4167-
strokeLinejoin="round"
4168-
/>
4169-
</svg>
4170-
);
4171-
}
4172-
41734149
function ToolActivityIconView(props: {
41744150
icon: ToolActivityIcon | undefined;
41754151
fallbackName: WorkEntryIconName;

0 commit comments

Comments
 (0)