@@ -118,11 +118,12 @@ export const ModelSelectionButton: React.FC<{}> = ({ }) => {
118
118
onClick = { ( ) => { setTempSelectedMode ( undefined ) } }
119
119
>
120
120
< TableCell align = "right" >
121
- < Radio checked = { tempSelectedModel == undefined } name = "radio-buttons" />
121
+ < Radio checked = { tempSelectedModel == undefined } name = "radio-buttons" inputProps = { { 'aria-label' : 'Select this model' } } />
122
122
</ TableCell >
123
123
< TableCell align = "left" >
124
124
< FormControl sx = { { width : 100 } } size = "small" >
125
125
< Select
126
+ title = 'key type'
126
127
value = { newKeyType }
127
128
input = { < OutlinedInput sx = { { fontSize : '0.875rem' } } /> }
128
129
onChange = { ( event : SelectChangeEvent ) => {
@@ -135,7 +136,7 @@ export const ModelSelectionButton: React.FC<{}> = ({ }) => {
135
136
</ FormControl >
136
137
</ TableCell >
137
138
< TableCell component = "th" scope = "row" >
138
- { newKeyType == "openai" ? < Typography sx = { { color : "lightgray " } } fontSize = 'inherit' > N/A</ Typography > : < TextField size = "small" type = "text" fullWidth
139
+ { newKeyType == "openai" ? < Typography sx = { { color : "text.secondary " } } fontSize = 'inherit' > N/A</ Typography > : < TextField size = "small" type = "text" fullWidth
139
140
disabled = { newKeyType == "openai" }
140
141
InputProps = { { style : { fontSize : "0.875rem" } } }
141
142
value = { newEndpoint } onChange = { ( event : any ) => { setNewEndpoint ( event . target . value ) ; } }
@@ -163,6 +164,10 @@ export const ModelSelectionButton: React.FC<{}> = ({ }) => {
163
164
//label={modelExists ? "endpoint and model exists" : ""}
164
165
{ ...params }
165
166
InputProps = { { ...params . InputProps , style : { fontSize : "0.875rem" } } }
167
+ inputProps = { {
168
+ ...params . inputProps , // Spread params.inputProps to preserve existing functionality
169
+ 'aria-label' : 'Select or enter a model' , // Apply aria-label directly to inputProps
170
+ } }
166
171
size = "small"
167
172
onChange = { ( event : any ) => { setNewModel ( event . target . value ) ; } }
168
173
/>
@@ -234,21 +239,19 @@ export const ModelSelectionButton: React.FC<{}> = ({ }) => {
234
239
235
240
let message = status == "unknown" ? "Status unknown, click the status icon to test again." :
236
241
( testedModels . find ( m => m . model === oaiModel . model && m . endpoint === oaiModel . endpoint ) ?. message || "Unknown error" ) ;
237
- const borderStyle = [ 'error' , 'unknown' ] . includes ( status ) ? '1px dashed lightgray ' : undefined ;
242
+ const borderStyle = [ 'error' , 'unknown' ] . includes ( status ) ? '1px dashed text.secondary ' : undefined ;
238
243
const noBorderStyle = [ 'error' , 'unknown' ] . includes ( status ) ? 'none' : undefined ;
239
244
240
245
return (
241
246
< >
242
247
< TableRow
243
- role = "checkbox"
244
- aria-checked = { isItemSelected }
245
248
selected = { isItemSelected }
246
249
key = { `${ oaiModel . endpoint } -${ oaiModel . model } ` }
247
250
onClick = { ( ) => { setTempSelectedMode ( { model : oaiModel . model , endpoint : oaiModel . endpoint } ) } }
248
251
sx = { { cursor : 'pointer' } }
249
252
>
250
253
< TableCell align = "right" sx = { { borderBottom : noBorderStyle } } >
251
- < Radio checked = { isItemSelected } name = "radio-buttons" />
254
+ < Radio checked = { isItemSelected } name = "radio-buttons" inputProps = { { 'aria-label' : 'Select this model' } } />
252
255
</ TableCell >
253
256
< TableCell align = "left" sx = { { borderBottom : noBorderStyle } } >
254
257
{ oaiModel . endpoint == 'openai' ? 'openai' : 'azure openai' }
@@ -258,37 +261,41 @@ export const ModelSelectionButton: React.FC<{}> = ({ }) => {
258
261
</ TableCell >
259
262
< TableCell align = "left" sx = { { borderBottom : borderStyle } } >
260
263
{ oaiModel . key != "" ?
261
- ( showKeys ? ( oaiModel . key || < Typography sx = { { color : "lightgray " } } fontSize = 'inherit' > N/A</ Typography > ) : "************" ) :
262
- < Typography sx = { { color : "lightgray " } } fontSize = 'inherit' > N/A</ Typography >
264
+ ( showKeys ? ( oaiModel . key || < Typography sx = { { color : "text.secondary " } } fontSize = 'inherit' > N/A</ Typography > ) : "************" ) :
265
+ < Typography sx = { { color : "text.secondary " } } fontSize = 'inherit' > N/A</ Typography >
263
266
}
264
267
</ TableCell >
265
268
< TableCell align = "left" sx = { { borderBottom : borderStyle } } > { oaiModel . model } </ TableCell >
266
269
< TableCell sx = { { fontWeight : 'bold' , borderBottom : borderStyle } } align = "right" >
267
- < IconButton
268
- onClick = { ( ) => { testModel ( oaiModel . endpoint , oaiModel . key , oaiModel . model ) } }
269
- >
270
- { statusIcon }
271
- </ IconButton >
270
+ < Tooltip title = { message } >
271
+ < IconButton
272
+ onClick = { ( ) => { testModel ( oaiModel . endpoint , oaiModel . key , oaiModel . model ) } }
273
+ >
274
+ { statusIcon }
275
+ </ IconButton >
276
+ </ Tooltip >
272
277
</ TableCell >
273
278
< TableCell sx = { { borderBottom : borderStyle } } align = "right" >
274
- < IconButton disabled = { oaiModel . endpoint == "default" }
275
- onClick = { ( ) => {
276
- dispatch ( dfActions . removeModel ( { model : oaiModel . model , endpoint : oaiModel . endpoint } ) ) ;
277
- if ( ( tempSelectedModel )
278
- && tempSelectedModel . endpoint == oaiModel . endpoint
279
- && tempSelectedModel . model == oaiModel . model ) {
280
- if ( oaiModels . length == 0 ) {
281
- setTempSelectedMode ( undefined ) ;
282
- } else {
283
- let chosenModel = oaiModels [ oaiModels . length - 1 ] ;
284
- setTempSelectedMode ( {
285
- model : chosenModel . model , endpoint : chosenModel . endpoint
286
- } )
279
+ < Tooltip title = "remove model" >
280
+ < IconButton disabled = { oaiModel . endpoint == "default" }
281
+ onClick = { ( ) => {
282
+ dispatch ( dfActions . removeModel ( { model : oaiModel . model , endpoint : oaiModel . endpoint } ) ) ;
283
+ if ( ( tempSelectedModel )
284
+ && tempSelectedModel . endpoint == oaiModel . endpoint
285
+ && tempSelectedModel . model == oaiModel . model ) {
286
+ if ( oaiModels . length == 0 ) {
287
+ setTempSelectedMode ( undefined ) ;
288
+ } else {
289
+ let chosenModel = oaiModels [ oaiModels . length - 1 ] ;
290
+ setTempSelectedMode ( {
291
+ model : chosenModel . model , endpoint : chosenModel . endpoint
292
+ } )
293
+ }
287
294
}
288
- }
289
- } } >
290
- < ClearIcon / >
291
- </ IconButton >
295
+ } } >
296
+ < ClearIcon / >
297
+ </ IconButton >
298
+ </ Tooltip >
292
299
</ TableCell >
293
300
</ TableRow >
294
301
{ [ 'error' , 'unknown' ] . includes ( status ) && (
@@ -304,7 +311,7 @@ export const ModelSelectionButton: React.FC<{}> = ({ }) => {
304
311
>
305
312
< TableCell colSpan = { 2 } align = "right" > </ TableCell >
306
313
< TableCell colSpan = { 5 } >
307
- < Typography variant = "caption" color = "error " >
314
+ < Typography variant = "caption" color = "#c82c2c " >
308
315
{ message }
309
316
</ Typography >
310
317
</ TableCell >
0 commit comments