@@ -18,6 +18,7 @@ import { localizeTemplateSourceTag } from "@/shared/i18n";
1818import { ModelsIcon } from "@/components/ui/Icons" ;
1919import {
2020 Button ,
21+ DialogBody ,
2122 DialogCloseButton ,
2223 DialogContent ,
2324 DialogDescription ,
@@ -268,12 +269,14 @@ function parseMCPServerDocument(value: string, t: TranslateFn): MCPServerDocumen
268269}
269270
270271function JSONConfigEditor ( {
272+ hideLabel = false ,
271273 invalid = false ,
272274 label,
273275 minRows = 12 ,
274276 onChange,
275277 value,
276278} : {
279+ hideLabel ?: boolean ;
277280 invalid ?: boolean ;
278281 label : string ;
279282 minRows ?: number ;
@@ -343,7 +346,7 @@ function JSONConfigEditor({
343346 className = { `hub-json-editor${ invalid ? " is-invalid" : "" } ` }
344347 style = { { "--hub-json-editor-min-height" : minHeight } as CSSProperties }
345348 >
346- < label className = " hub-json-editor-label" htmlFor = { editorId } >
349+ < label className = { ` hub-json-editor-label${ hideLabel ? " sr-only" : "" } ` } htmlFor = { editorId } >
347350 { label }
348351 </ label >
349352 < div className = "hub-json-editor-shell" ref = { editorParentRef } aria-invalid = { invalid || undefined } />
@@ -437,10 +440,10 @@ export function HubDetailPane({
437440 const canDeleteSkill = Boolean ( selectedSkill && ! isReadonlySkill ( selectedSkill ) ) ;
438441 const skillEntries = skillTree ?. entries ?? EMPTY_WORKSPACE_ENTRIES ;
439442 const activeResourceType = useMemo ( ( ) => {
440- if ( selectedResourceType === "mcp" && mcpServers . length ) {
443+ if ( selectedResourceType === "mcp" ) {
441444 return "mcp" ;
442445 }
443- if ( selectedResourceType === "skill" && skills . length ) {
446+ if ( selectedResourceType === "skill" ) {
444447 return "skill" ;
445448 }
446449 if ( templates . length ) {
@@ -796,7 +799,13 @@ export function HubDetailPane({
796799 *
797800 </ span >
798801 < strong >
799- { templates . length || skills . length || mcpServers . length ? t ( "resourcesLoading" ) : t ( "resourcesEmpty" ) }
802+ { activeResourceType === "mcp"
803+ ? t ( "resourcesMCPEmpty" )
804+ : activeResourceType === "skill"
805+ ? t ( "resourcesSkillsEmpty" )
806+ : templates . length || skills . length || mcpServers . length
807+ ? t ( "resourcesLoading" )
808+ : t ( "resourcesEmpty" ) }
800809 </ strong >
801810 </ div >
802811 ) }
@@ -848,8 +857,9 @@ export function HubDetailPane({
848857 </ div >
849858 < DialogCloseButton label = { t ( "close" ) } size = "sm" variant = "tertiaryGray" />
850859 </ DialogHeader >
851- < div className = "mcp-form" >
860+ < DialogBody className = "mcp-form" >
852861 < JSONConfigEditor
862+ hideLabel
853863 label = { t ( "resourcesMCPServerDocumentJSONLabel" ) }
854864 value = { mcpDraftDocument }
855865 onChange = { handleMCPDraftDocumentChange }
@@ -859,7 +869,7 @@ export function HubDetailPane({
859869 { mcpFormError || mcpMutationError ? (
860870 < div className = "form-error hub-json-editor-error" > { mcpFormError || mcpMutationError } </ div >
861871 ) : null }
862- </ div >
872+ </ DialogBody >
863873 < DialogFooter className = "hub-skill-delete-dialog-actions" >
864874 < Button variant = "secondaryGray" size = "sm" disabled = { mcpMutationBusy } onClick = { closeMCPFormDialog } >
865875 { t ( "cancel" ) }
0 commit comments