@@ -84,47 +84,65 @@ export const FreebuffModelSelector: React.FC = () => {
8484 < text style = { { fg : theme . muted , marginBottom : 1 } } >
8585 Model — tap or press 1-{ FREEBUFF_MODELS . length } to switch
8686 </ text >
87- { FREEBUFF_MODELS . map ( ( model , idx ) => {
88- const isSelected = model . id === selectedModel
89- const isPending = pending === model . id
90- const isHovered = hoveredId === model . id
91- const indicator = isSelected ? '●' : '○'
92- const indicatorColor = isSelected ? theme . primary : theme . muted
93- const labelColor = isSelected ? theme . foreground : theme . muted
94- const interactable = ! pending && ! isSelected
95- const ahead = aheadByModel ?. [ model . id ]
96- const hint =
97- ahead === undefined
98- ? model . tagline
99- : ahead === 0
100- ? 'No wait'
101- : `${ ahead } ahead`
102- return (
103- < Button
104- key = { model . id }
105- onClick = { ( ) => pick ( model . id ) }
106- onMouseOver = { ( ) => interactable && setHoveredId ( model . id ) }
107- onMouseOut = { ( ) => setHoveredId ( ( curr ) => ( curr === model . id ? null : curr ) ) }
108- style = { { paddingLeft : 0 , paddingRight : 1 } }
109- >
110- < text >
111- < span fg = { indicatorColor } > { indicator } </ span >
112- < span fg = { theme . muted } > { idx + 1 } . </ span >
113- < span
114- fg = { labelColor }
115- attributes = { isSelected ? TextAttributes . BOLD : TextAttributes . NONE }
116- >
117- { model . displayName }
118- </ span >
119- < span fg = { theme . muted } > { hint } </ span >
120- { isPending && < span fg = { theme . muted } > switching…</ span > }
121- { isHovered && interactable && ! isPending && (
122- < span fg = { theme . muted } > ↵</ span >
123- ) }
124- </ text >
125- </ Button >
126- )
127- } ) }
87+ < box
88+ style = { {
89+ flexDirection : 'row' ,
90+ gap : 2 ,
91+ } }
92+ >
93+ { FREEBUFF_MODELS . map ( ( model , idx ) => {
94+ const isSelected = model . id === selectedModel
95+ const isPending = pending === model . id
96+ const isHovered = hoveredId === model . id
97+ const indicator = isSelected ? '●' : '○'
98+ const indicatorColor = isSelected ? theme . primary : theme . muted
99+ const labelColor = isSelected ? theme . foreground : theme . muted
100+ const interactable = ! pending && ! isSelected
101+ const ahead = aheadByModel ?. [ model . id ]
102+ const hint =
103+ ahead === undefined
104+ ? model . tagline
105+ : ahead === 0
106+ ? 'No wait'
107+ : `${ ahead } ahead`
108+
109+ const borderColor = isSelected
110+ ? theme . primary
111+ : isHovered && interactable
112+ ? theme . foreground
113+ : theme . border
114+
115+ return (
116+ < Button
117+ key = { model . id }
118+ onClick = { ( ) => pick ( model . id ) }
119+ onMouseOver = { ( ) => interactable && setHoveredId ( model . id ) }
120+ onMouseOut = { ( ) => setHoveredId ( ( curr ) => ( curr === model . id ? null : curr ) ) }
121+ style = { {
122+ borderStyle : 'single' ,
123+ borderColor,
124+ paddingLeft : 1 ,
125+ paddingRight : 1 ,
126+ } }
127+ border = { [ 'top' , 'bottom' , 'left' , 'right' ] }
128+ >
129+ < text >
130+ < span fg = { indicatorColor } > { indicator } </ span >
131+ < span fg = { theme . muted } > { idx + 1 } . </ span >
132+ < span
133+ fg = { labelColor }
134+ attributes = { isSelected ? TextAttributes . BOLD : TextAttributes . NONE }
135+ >
136+ { model . displayName }
137+ </ span >
138+ < span fg = { theme . muted } > { hint } </ span >
139+ { isPending && < span fg = { theme . muted } > switching…</ span > }
140+
141+ </ text >
142+ </ Button >
143+ )
144+ } ) }
145+ </ box >
128146 </ box >
129147 )
130148}
0 commit comments