@@ -6,9 +6,24 @@ import { Icon } from '@iconify/react'
66export type AgentMode = 'ask' | 'agent' | 'plan'
77
88const MODES : Array < { id : AgentMode ; label : string ; icon : string ; desc : string } > = [
9- { id : 'ask' , label : 'Ask' , icon : 'lucide:message-square' , desc : 'Discuss and answer questions — no code changes' } ,
10- { id : 'agent' , label : 'Agent' , icon : 'lucide:zap' , desc : 'Autonomous code changes and edits' } ,
11- { id : 'plan' , label : 'Plan' , icon : 'lucide:list-checks' , desc : 'Outline steps first, then execute with approval' } ,
9+ {
10+ id : 'ask' ,
11+ label : 'Ask' ,
12+ icon : 'lucide:message-square' ,
13+ desc : 'Discuss and answer questions — no code changes' ,
14+ } ,
15+ {
16+ id : 'agent' ,
17+ label : 'Agent' ,
18+ icon : 'lucide:zap' ,
19+ desc : 'Autonomous code changes and edits' ,
20+ } ,
21+ {
22+ id : 'plan' ,
23+ label : 'Plan' ,
24+ icon : 'lucide:list-checks' ,
25+ desc : 'Outline steps first, then execute with approval' ,
26+ } ,
1227]
1328
1429interface Props {
@@ -23,7 +38,7 @@ export function ModeSelector({ mode, onChange, size = 'sm' }: Props) {
2338 const [ pill , setPill ] = useState ( { left : 0 , width : 0 } )
2439
2540 const recalcPill = useCallback ( ( ) => {
26- const idx = MODES . findIndex ( m => m . id === mode )
41+ const idx = MODES . findIndex ( ( m ) => m . id === mode )
2742 const btn = btnRefs . current [ idx ]
2843 const container = containerRef . current
2944 if ( btn && container ) {
@@ -53,34 +68,37 @@ export function ModeSelector({ mode, onChange, size = 'sm' }: Props) {
5368 return (
5469 < div
5570 ref = { containerRef }
56- className = { `relative inline-flex items-center rounded-[10px] bg-[color-mix(in_srgb,var(--text-primary)_6 %,transparent)] ${
57- isMd ? 'gap-0.5 p-[3px ]' : 'gap-px p-[2px ]'
71+ className = { `relative inline-flex items-center rounded-[12px] border border-[color-mix(in_srgb,var(--border)_92%,transparent)] bg-[color-mix(in_srgb,var(--bg-elevated)_92 %,transparent)] shadow-[var(--shadow-xs )] ${
72+ isMd ? 'gap-0.5 p-[4px ]' : 'gap-[2px] p-[3px ]'
5873 } `}
5974 >
6075 < span
61- className = { `absolute rounded-lg pointer-events-none bg-[color-mix(in_srgb,var(--text-primary)_10%,var(--bg))] ${
76+ className = { `absolute rounded-[10px] pointer-events-none bg-[color-mix(in_srgb,var(--text-primary)_10%,var(--bg))] ${
6277 isMd
63- ? 'top-[3px ] h-[calc(100%-6px )] shadow-[0_1px_3px_rgba (0,0,0,0.12 ),0_0_0_1px_color-mix(in_srgb,var(--text-primary)_12 %,transparent)]'
64- : 'top-[2px ] h-[calc(100%-4px )] shadow-[0_1px_2px_rgba (0,0,0,0.1 ),0_0_0_1px_color-mix(in_srgb,var(--text-primary)_10 %,transparent)]'
78+ ? 'top-[4px ] h-[calc(100%-8px )] shadow-[0_2px_6px_rgba (0,0,0,0.16 ),0_0_0_1px_color-mix(in_srgb,var(--brand)_18 %,transparent)]'
79+ : 'top-[3px ] h-[calc(100%-6px )] shadow-[0_2px_5px_rgba (0,0,0,0.14 ),0_0_0_1px_color-mix(in_srgb,var(--brand)_14 %,transparent)]'
6580 } `}
6681 style = { {
6782 left : pill . left ,
6883 width : pill . width ,
69- transition : 'left 300ms cubic-bezier(0.22, 1, 0.36, 1), width 300ms cubic-bezier(0.22, 1, 0.36, 1)' ,
84+ transition :
85+ 'left 300ms cubic-bezier(0.22, 1, 0.36, 1), width 300ms cubic-bezier(0.22, 1, 0.36, 1)' ,
7086 opacity : pill . width > 0 ? 1 : 0 ,
7187 } }
7288 />
7389 { MODES . map ( ( m , i ) => (
7490 < button
7591 key = { m . id }
76- ref = { el => { btnRefs . current [ i ] = el } }
92+ ref = { ( el ) => {
93+ btnRefs . current [ i ] = el
94+ } }
7795 onClick = { ( ) => onChange ( m . id ) }
78- className = { `relative z-[1] flex items-center rounded-lg font-medium transition-colors duration-200 cursor-pointer select-none ${
79- isMd ? 'gap-1.5 px-3.5 py-1.5 text-[13px]' : 'gap-1 px-2.5 py-1 text-[11px ]'
96+ className = { `relative z-[1] flex items-center rounded-[10px] font-medium transition-colors duration-200 cursor-pointer select-none ${
97+ isMd ? 'gap-1.5 px-3.5 py-2 text-[13px]' : 'gap-1.5 px-3 py-1.5 text-[12px ]'
8098 } ${
8199 mode === m . id
82100 ? 'text-[var(--text-primary)]'
83- : 'text-[var(--text-disabled )] hover:text-[var(--text-tertiary )]'
101+ : 'text-[var(--text-secondary )] hover:text-[var(--text-primary )]'
84102 } `}
85103 title = { m . desc }
86104 >
0 commit comments