From 63b484a0bbe3422f7451fc9acb5411d4cfde0b00 Mon Sep 17 00:00:00 2001 From: Keith Guerin Date: Sun, 1 Mar 2026 02:50:36 -0800 Subject: [PATCH] feat(ui): make shell icon green when focused and fix DescriptiveRadioButtonSelect test mock --- .../components/messages/ShellToolMessage.tsx | 6 +- .../ui/components/messages/ToolMessage.tsx | 6 +- .../src/ui/components/messages/ToolShared.tsx | 8 +- .../DescriptiveRadioButtonSelect.test.tsx | 6 ++ ...DescriptiveRadioButtonSelect.test.tsx.snap | 86 +++---------------- 5 files changed, 35 insertions(+), 77 deletions(-) diff --git a/packages/cli/src/ui/components/messages/ShellToolMessage.tsx b/packages/cli/src/ui/components/messages/ShellToolMessage.tsx index 8e760b28e7..3a0cdb702e 100644 --- a/packages/cli/src/ui/components/messages/ShellToolMessage.tsx +++ b/packages/cli/src/ui/components/messages/ShellToolMessage.tsx @@ -125,7 +125,11 @@ export const ShellToolMessage: React.FC = ({ borderDimColor={borderDimColor} containerRef={headerRef} > - + = ({ borderColor={borderColor} borderDimColor={borderDimColor} > - + = ({ status: coreStatus, name, + isFocused, }) => { const status = mapCoreStatusToDisplayStatus(coreStatus); const isShell = isShellTool(name); - const statusColor = isShell ? theme.ui.active : theme.status.warning; + const statusColor = isFocused + ? theme.ui.focus + : isShell + ? theme.ui.active + : theme.status.warning; return ( diff --git a/packages/cli/src/ui/components/shared/DescriptiveRadioButtonSelect.test.tsx b/packages/cli/src/ui/components/shared/DescriptiveRadioButtonSelect.test.tsx index 14af016b38..8fe9f66bee 100644 --- a/packages/cli/src/ui/components/shared/DescriptiveRadioButtonSelect.test.tsx +++ b/packages/cli/src/ui/components/shared/DescriptiveRadioButtonSelect.test.tsx @@ -29,6 +29,12 @@ vi.mock('../../semantic-colors.js', () => ({ primary: 'COLOR_PRIMARY', secondary: 'COLOR_SECONDARY', }, + ui: { + focus: 'COLOR_FOCUS', + }, + background: { + focus: 'COLOR_FOCUS_BG', + }, status: { success: 'COLOR_SUCCESS', }, diff --git a/packages/cli/src/ui/components/shared/__snapshots__/DescriptiveRadioButtonSelect.test.tsx.snap b/packages/cli/src/ui/components/shared/__snapshots__/DescriptiveRadioButtonSelect.test.tsx.snap index 1015750761..9fa0f0f79f 100644 --- a/packages/cli/src/ui/components/shared/__snapshots__/DescriptiveRadioButtonSelect.test.tsx.snap +++ b/packages/cli/src/ui/components/shared/__snapshots__/DescriptiveRadioButtonSelect.test.tsx.snap @@ -1,83 +1,21 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`DescriptiveRadioButtonSelect > should render correctly with custom props 1`] = ` -" - ERROR Cannot read properties of undefined (reading 'focus') - - src/ui/components/shared/BaseSelectionList.tsx:120:33 - - 117: let numberColor = theme.text.primary; - 118: - 119: if (isSelected) { - 120: titleColor = theme.ui.focus; - 121: numberColor = theme.ui.focus; - 122: } else if (item.disabled) { - 123: titleColor = theme.text.secondary; - - - (src/ui/components/shared/BaseSelectionList.tsx:120:33) - - at Array.map ()\\t - - BaseSelectionList (src/ui/components/shared/BaseSelectionList.tsx:111:21) - -Object.react-stack-bott - m-frame (/Users/keithguerin/Documents/gemini-cli_colors/node_modules/react-reconci - ler/cjs/react-reconciler.development.js:15859:20) - -renderWithHoo - s (/Users/keithguerin/Documents/gemini-cli_colors/node_modules/react-reconciler/cjs/re - act-reconciler.development.js:3221:22) - -updateFunctionComp - nent (/Users/keithguerin/Documents/gemini-cli_colors/node_modules/react-reconciler/c - js/react-reconciler.development.js:6475:19) - -beginWor - (/Users/keithguerin/Documents/gemini-cli_colors/node_modules/react-reconciler/cjs/react-r - econciler.development.js:8009:18) - -runWithFiberIn - EV (/Users/keithguerin/Documents/gemini-cli_colors/node_modules/react-reconciler/cjs/r - eact-reconciler.development.js:1738:13) - -performUnitOfW - rk (/Users/keithguerin/Documents/gemini-cli_colors/node_modules/react-reconciler/cjs/r - eact-reconciler.development.js:12834:22) - -workLoopSyn - (/Users/keithguerin/Documents/gemini-cli_colors/node_modules/react-reconciler/cjs/reac - t-reconciler.development.js:12644:41) +" 1. Foo Title + This is Foo. +● 2. Bar Title + This is Bar. + 3. Baz Title + This is Baz. " `; exports[`DescriptiveRadioButtonSelect > should render correctly with default props 1`] = ` -" - ERROR Cannot read properties of undefined (reading 'focus') - - src/ui/components/shared/BaseSelectionList.tsx:120:33 - - 117: let numberColor = theme.text.primary; - 118: - 119: if (isSelected) { - 120: titleColor = theme.ui.focus; - 121: numberColor = theme.ui.focus; - 122: } else if (item.disabled) { - 123: titleColor = theme.text.secondary; - - - (src/ui/components/shared/BaseSelectionList.tsx:120:33) - - at Array.map ()\\t - - BaseSelectionList (src/ui/components/shared/BaseSelectionList.tsx:111:21) - -Object.react-stack-bott - m-frame (/Users/keithguerin/Documents/gemini-cli_colors/node_modules/react-reconci - ler/cjs/react-reconciler.development.js:15859:20) - -renderWithHoo - s (/Users/keithguerin/Documents/gemini-cli_colors/node_modules/react-reconciler/cjs/re - act-reconciler.development.js:3221:22) - -updateFunctionComp - nent (/Users/keithguerin/Documents/gemini-cli_colors/node_modules/react-reconciler/c - js/react-reconciler.development.js:6475:19) - -beginWor - (/Users/keithguerin/Documents/gemini-cli_colors/node_modules/react-reconciler/cjs/react-r - econciler.development.js:8009:18) - -runWithFiberIn - EV (/Users/keithguerin/Documents/gemini-cli_colors/node_modules/react-reconciler/cjs/r - eact-reconciler.development.js:1738:13) - -performUnitOfW - rk (/Users/keithguerin/Documents/gemini-cli_colors/node_modules/react-reconciler/cjs/r - eact-reconciler.development.js:12834:22) - -workLoopSyn - (/Users/keithguerin/Documents/gemini-cli_colors/node_modules/react-reconciler/cjs/reac - t-reconciler.development.js:12644:41) +"● Foo Title + This is Foo. + Bar Title + This is Bar. + Baz Title + This is Baz. " `;