diff --git a/apps/desktop/src/app/settings/appearance-settings.tsx b/apps/desktop/src/app/settings/appearance-settings.tsx index 86cbf718c73..d60b1194577 100644 --- a/apps/desktop/src/app/settings/appearance-settings.tsx +++ b/apps/desktop/src/app/settings/appearance-settings.tsx @@ -66,37 +66,39 @@ function SectionHead({ title, description, pill }: { title: string; description: ) } -function OptionRow({ - icon: Icon, - label, - description, - active, - onClick +function SegmentedControl({ + options, + value, + onChange }: { - icon?: IconComponent - label: string - description: string - active: boolean - onClick: () => void + options: readonly { id: T; label: string; icon?: IconComponent }[] + value: T + onChange: (id: T) => void }) { return ( - +
+ {options.map(({ id, label, icon: Icon }) => { + const active = value === id + + return ( + + ) + })} +
) } @@ -119,21 +121,14 @@ export function AppearanceSettings() { pill={{prettyName(mode)}} title="Color Mode" /> -
- {MODE_OPTIONS.map(({ id, label, description, icon }) => ( - { - triggerHaptic('crisp') - setMode(id) - }} - /> - ))} -
+ { + triggerHaptic('crisp') + setMode(id) + }} + options={MODE_OPTIONS} + value={mode} + />
@@ -142,33 +137,19 @@ export function AppearanceSettings() { pill={{toolViewMode === 'technical' ? 'Technical' : 'Product'}} title="Tool Call Display" /> -
- {( + { + triggerHaptic('selection') + setToolViewMode(id) + }} + options={ [ - { - id: 'product', - label: 'Product', - description: 'Human-friendly tool activity with concise summaries.' - }, - { - id: 'technical', - label: 'Technical', - description: 'Include raw tool args/results and low-level details.' - } + { id: 'product', label: 'Product' }, + { id: 'technical', label: 'Technical' } ] as const - ).map(option => ( - { - triggerHaptic('selection') - setToolViewMode(option.id) - }} - /> - ))} -
+ } + value={toolViewMode} + />