@@ -94,7 +94,7 @@ const Sidebar = ({
94
94
95
95
return (
96
96
< div className = "w-80 bg-card border-r border-border flex flex-col h-full" >
97
- < div className = "flex items-center justify-between p-4 border-b border-gray-200" >
97
+ < div className = "flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-800 " >
98
98
< div className = "flex items-center" >
99
99
< h1 className = "ml-2 text-lg font-semibold" >
100
100
MCP Inspector v{ version }
@@ -105,14 +105,19 @@ const Sidebar = ({
105
105
< div className = "p-4 flex-1 overflow-auto" >
106
106
< div className = "space-y-4" >
107
107
< div className = "space-y-2" >
108
- < label className = "text-sm font-medium" > Transport Type</ label >
108
+ < label
109
+ className = "text-sm font-medium"
110
+ htmlFor = "transport-type-select"
111
+ >
112
+ Transport Type
113
+ </ label >
109
114
< Select
110
115
value = { transportType }
111
116
onValueChange = { ( value : "stdio" | "sse" ) =>
112
117
setTransportType ( value )
113
118
}
114
119
>
115
- < SelectTrigger >
120
+ < SelectTrigger id = "transport-type-select" >
116
121
< SelectValue placeholder = "Select transport type" />
117
122
</ SelectTrigger >
118
123
< SelectContent >
@@ -125,17 +130,26 @@ const Sidebar = ({
125
130
{ transportType === "stdio" ? (
126
131
< >
127
132
< div className = "space-y-2" >
128
- < label className = "text-sm font-medium" > Command</ label >
133
+ < label className = "text-sm font-medium" htmlFor = "command-input" >
134
+ Command
135
+ </ label >
129
136
< Input
137
+ id = "command-input"
130
138
placeholder = "Command"
131
139
value = { command }
132
140
onChange = { ( e ) => setCommand ( e . target . value ) }
133
141
className = "font-mono"
134
142
/>
135
143
</ div >
136
144
< div className = "space-y-2" >
137
- < label className = "text-sm font-medium" > Arguments</ label >
145
+ < label
146
+ className = "text-sm font-medium"
147
+ htmlFor = "arguments-input"
148
+ >
149
+ Arguments
150
+ </ label >
138
151
< Input
152
+ id = "arguments-input"
139
153
placeholder = "Arguments (space-separated)"
140
154
value = { args }
141
155
onChange = { ( e ) => setArgs ( e . target . value ) }
@@ -146,8 +160,11 @@ const Sidebar = ({
146
160
) : (
147
161
< >
148
162
< div className = "space-y-2" >
149
- < label className = "text-sm font-medium" > URL</ label >
163
+ < label className = "text-sm font-medium" htmlFor = "sse-url-input" >
164
+ URL
165
+ </ label >
150
166
< Input
167
+ id = "sse-url-input"
151
168
placeholder = "URL"
152
169
value = { sseUrl }
153
170
onChange = { ( e ) => setSseUrl ( e . target . value ) }
@@ -159,6 +176,7 @@ const Sidebar = ({
159
176
variant = "outline"
160
177
onClick = { ( ) => setShowBearerToken ( ! showBearerToken ) }
161
178
className = "flex items-center w-full"
179
+ aria-expanded = { showBearerToken }
162
180
>
163
181
{ showBearerToken ? (
164
182
< ChevronDown className = "w-4 h-4 mr-2" />
@@ -169,8 +187,14 @@ const Sidebar = ({
169
187
</ Button >
170
188
{ showBearerToken && (
171
189
< div className = "space-y-2" >
172
- < label className = "text-sm font-medium" > Bearer Token</ label >
190
+ < label
191
+ className = "text-sm font-medium"
192
+ htmlFor = "bearer-token-input"
193
+ >
194
+ Bearer Token
195
+ </ label >
173
196
< Input
197
+ id = "bearer-token-input"
174
198
placeholder = "Bearer Token"
175
199
value = { bearerToken }
176
200
onChange = { ( e ) => setBearerToken ( e . target . value ) }
@@ -189,6 +213,7 @@ const Sidebar = ({
189
213
onClick = { ( ) => setShowEnvVars ( ! showEnvVars ) }
190
214
className = "flex items-center w-full"
191
215
data-testid = "env-vars-button"
216
+ aria-expanded = { showEnvVars }
192
217
>
193
218
{ showEnvVars ? (
194
219
< ChevronDown className = "w-4 h-4 mr-2" />
@@ -203,6 +228,7 @@ const Sidebar = ({
203
228
< div key = { idx } className = "space-y-2 pb-4" >
204
229
< div className = "flex gap-2" >
205
230
< Input
231
+ aria-label = { `Environment variable key ${ idx + 1 } ` }
206
232
placeholder = "Key"
207
233
value = { key }
208
234
onChange = { ( e ) => {
@@ -245,6 +271,7 @@ const Sidebar = ({
245
271
</ div >
246
272
< div className = "flex gap-2" >
247
273
< Input
274
+ aria-label = { `Environment variable value ${ idx + 1 } ` }
248
275
type = { shownEnvVars . has ( key ) ? "text" : "password" }
249
276
placeholder = "Value"
250
277
value = { value }
@@ -311,6 +338,7 @@ const Sidebar = ({
311
338
onClick = { ( ) => setShowConfig ( ! showConfig ) }
312
339
className = "flex items-center w-full"
313
340
data-testid = "config-button"
341
+ aria-expanded = { showConfig }
314
342
>
315
343
{ showConfig ? (
316
344
< ChevronDown className = "w-4 h-4 mr-2" />
@@ -327,7 +355,10 @@ const Sidebar = ({
327
355
return (
328
356
< div key = { key } className = "space-y-2" >
329
357
< div className = "flex items-center gap-1" >
330
- < label className = "text-sm font-medium text-green-600 break-all" >
358
+ < label
359
+ className = "text-sm font-medium text-green-600 break-all"
360
+ htmlFor = { `${ configKey } -input` }
361
+ >
331
362
{ configItem . label }
332
363
</ label >
333
364
< Tooltip >
@@ -341,6 +372,7 @@ const Sidebar = ({
341
372
</ div >
342
373
{ typeof configItem . value === "number" ? (
343
374
< Input
375
+ id = { `${ configKey } -input` }
344
376
type = "number"
345
377
data-testid = { `${ configKey } -input` }
346
378
value = { configItem . value }
@@ -367,7 +399,7 @@ const Sidebar = ({
367
399
setConfig ( newConfig ) ;
368
400
} }
369
401
>
370
- < SelectTrigger >
402
+ < SelectTrigger id = { ` ${ configKey } -input` } >
371
403
< SelectValue />
372
404
</ SelectTrigger >
373
405
< SelectContent >
@@ -377,6 +409,7 @@ const Sidebar = ({
377
409
</ Select >
378
410
) : (
379
411
< Input
412
+ id = { `${ configKey } -input` }
380
413
data-testid = { `${ configKey } -input` }
381
414
value = { configItem . value }
382
415
onChange = { ( e ) => {
@@ -400,7 +433,13 @@ const Sidebar = ({
400
433
< div className = "space-y-2" >
401
434
{ connectionStatus === "connected" && (
402
435
< div className = "grid grid-cols-2 gap-4" >
403
- < Button data-testid = "connect-button" onClick = { onConnect } >
436
+ < Button
437
+ data-testid = "connect-button"
438
+ onClick = { ( ) => {
439
+ onDisconnect ( ) ;
440
+ onConnect ( ) ;
441
+ } }
442
+ >
404
443
< RotateCcw className = "w-4 h-4 mr-2" />
405
444
{ transportType === "stdio" ? "Restart" : "Reconnect" }
406
445
</ Button >
@@ -450,14 +489,19 @@ const Sidebar = ({
450
489
451
490
{ loggingSupported && connectionStatus === "connected" && (
452
491
< div className = "space-y-2" >
453
- < label className = "text-sm font-medium" > Logging Level</ label >
492
+ < label
493
+ className = "text-sm font-medium"
494
+ htmlFor = "logging-level-select"
495
+ >
496
+ Logging Level
497
+ </ label >
454
498
< Select
455
499
value = { logLevel }
456
500
onValueChange = { ( value : LoggingLevel ) =>
457
501
sendLogLevelRequest ( value )
458
502
}
459
503
>
460
- < SelectTrigger >
504
+ < SelectTrigger id = "logging-level-select" >
461
505
< SelectValue placeholder = "Select logging level" />
462
506
</ SelectTrigger >
463
507
< SelectContent >
0 commit comments