From d9a2d080f76ee83572654f2eaac41e862db37c2d Mon Sep 17 00:00:00 2001 From: Keith Guerin Date: Thu, 26 Feb 2026 13:51:08 -0800 Subject: [PATCH] feat(ui): finalize /colors layout and improve interaction explanation --- .../src/ui/components/ColorsDisplay.test.tsx | 3 ++ .../cli/src/ui/components/ColorsDisplay.tsx | 34 ++++++++++++++----- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/packages/cli/src/ui/components/ColorsDisplay.test.tsx b/packages/cli/src/ui/components/ColorsDisplay.test.tsx index 1cb9515896..9872f3ff2d 100644 --- a/packages/cli/src/ui/components/ColorsDisplay.test.tsx +++ b/packages/cli/src/ui/components/ColorsDisplay.test.tsx @@ -69,6 +69,9 @@ describe('ColorsDisplay', () => { // Check for title and description expect(output).toContain('/colors - Theme Colors Demo'); expect(output).toContain('visualize how colors are used'); + expect(output).toContain('How themes and terminals interact'); + expect(output).toContain('TrueColor (Hex)'); + expect(output).toContain('ANSI Names'); // Check for active theme name expect(output).toContain('Test Theme'); diff --git a/packages/cli/src/ui/components/ColorsDisplay.tsx b/packages/cli/src/ui/components/ColorsDisplay.tsx index 4c5fb2c307..d0845f7e2f 100644 --- a/packages/cli/src/ui/components/ColorsDisplay.tsx +++ b/packages/cli/src/ui/components/ColorsDisplay.tsx @@ -143,15 +143,31 @@ export const ColorsDisplay: React.FC = () => { - Note on overrides: - {' '} - Hex values (TrueColor) are rendered exactly as shown and are - generally not affected by your Terminal - app's theme. Color names (like 'red', - 'green', 'gray') used in the ANSI theme{' '} - are overridden by your Terminal app's - palette. + How themes and terminals interact: + + + + • TrueColor (Hex): Modern terminals (iTerm2, + Ghostty, VSCode) render hex codes exactly. They are{' '} + not overridden by terminal app themes. + + + • ANSI Names: Colors like 'red' or + 'green' (used in our ANSI theme) are{' '} + mapped to your terminal app's specific palette. + + + • Default colors: When Name or Value is + '(blank)', the app uses your terminal's default + foreground/background. + + + • Compatibility: In terminals with limited color + (like older Mac Terminals), hex colors are automatically + approximated to the closest available ANSI color. + + @@ -250,7 +266,7 @@ function renderBackgroundRow({ name, value }: BackgroundColorRow) { const description = COLOR_DESCRIPTIONS[name] || ''; return ( - +