@@ -66,7 +66,7 @@ function readStoredHeaderExpandedState() {
6666 return false ;
6767 }
6868 } catch {
69- // Ignore storage read failures and fall back to defaults .
69+ // Ignore storage read failures and use the baseline state .
7070 }
7171 return getDefaultHeaderExpandedState ( ) ;
7272}
@@ -115,16 +115,16 @@ function normalizeForwardedLaunchParam(key, value) {
115115}
116116
117117function buildHostedRegistryEntryHref ( toolEntry ) {
118- const defaultHref = getRegistryEntryHref ( toolEntry . entryPoint ) ;
118+ const baseHref = getRegistryEntryHref ( toolEntry . entryPoint ) ;
119119 if ( typeof window === "undefined" ) {
120- return defaultHref ;
120+ return baseHref ;
121121 }
122122 const currentParams = new URLSearchParams ( window . location . search ) ;
123123 if ( currentParams . get ( "hosted" ) !== "1" ) {
124- return defaultHref ;
124+ return baseHref ;
125125 }
126126
127- const nextUrl = new URL ( defaultHref , window . location . href ) ;
127+ const nextUrl = new URL ( baseHref , window . location . href ) ;
128128 nextUrl . searchParams . set ( "hosted" , "1" ) ;
129129 nextUrl . searchParams . set ( "hostToolId" , normalizeTextValue ( toolEntry . id ) ) ;
130130
@@ -547,41 +547,41 @@ function summarizeEmbeddedToolPayloadDocument(toolId = "", scopedToolState = nul
547547 const payload = scopedToolState . payload && typeof scopedToolState . payload === "object" && ! Array . isArray ( scopedToolState . payload )
548548 ? scopedToolState . payload
549549 : { } ;
550- const fallbackId = normalizeTextValue ( scopedToolState . tool || normalizedToolId ) ;
550+ const toolLabel = normalizeTextValue ( scopedToolState . tool || normalizedToolId ) ;
551551 const directPalette = normalizedToolId === "palette-browser" && Array . isArray ( scopedToolState . swatches )
552552 ? scopedToolState
553553 : null ;
554554 if ( directPalette ) {
555- const name = normalizeTextValue ( directPalette . name || directPalette . id || fallbackId ) ;
555+ const name = normalizeTextValue ( directPalette . name || directPalette . id || toolLabel ) ;
556556 const swatchCount = directPalette . swatches . length ;
557- return `embedded palette ${ name || fallbackId } ${ swatchCount > 0 ? ` (${ swatchCount } swatches)` : "" } ` ;
557+ return `embedded palette ${ name || toolLabel } ${ swatchCount > 0 ? ` (${ swatchCount } swatches)` : "" } ` ;
558558 }
559559
560560 const vectorMapDocument = readWorkspaceScopedToolDocument ( payload , "vectorMapDocument" , scopedToolState ) ;
561561 if ( vectorMapDocument ) {
562- const name = normalizeTextValue ( vectorMapDocument . name || vectorMapDocument . id || fallbackId ) ;
562+ const name = normalizeTextValue ( vectorMapDocument . name || vectorMapDocument . id || toolLabel ) ;
563563 const objectCount = Array . isArray ( vectorMapDocument . objects ) ? vectorMapDocument . objects . length : 0 ;
564- return `embedded vector map ${ name || fallbackId } ${ objectCount > 0 ? ` (${ objectCount } objects)` : "" } ` ;
564+ return `embedded vector map ${ name || toolLabel } ${ objectCount > 0 ? ` (${ objectCount } objects)` : "" } ` ;
565565 }
566566
567567 const vectorAssetDocument = readWorkspaceScopedToolDocument ( payload , "vectorAssetDocument" , scopedToolState ) ;
568568 if ( vectorAssetDocument ) {
569- const sourceName = normalizeTextValue ( vectorAssetDocument . sourceName || vectorAssetDocument . name || fallbackId ) ;
570- return `embedded vector asset ${ sourceName || fallbackId } ` ;
569+ const sourceName = normalizeTextValue ( vectorAssetDocument . sourceName || vectorAssetDocument . name || toolLabel ) ;
570+ return `embedded vector asset ${ sourceName || toolLabel } ` ;
571571 }
572572
573573 const tileMapDocument = readWorkspaceScopedToolDocument ( payload , "tileMapDocument" , scopedToolState ) ;
574574 if ( tileMapDocument ) {
575- const mapName = normalizeTextValue ( tileMapDocument ?. map ?. name || tileMapDocument . name || tileMapDocument . id || fallbackId ) ;
575+ const mapName = normalizeTextValue ( tileMapDocument ?. map ?. name || tileMapDocument . name || tileMapDocument . id || toolLabel ) ;
576576 const layerCount = Array . isArray ( tileMapDocument . layers ) ? tileMapDocument . layers . length : 0 ;
577- return `embedded tile map ${ mapName || fallbackId } ${ layerCount > 0 ? ` (${ layerCount } layers)` : "" } ` ;
577+ return `embedded tile map ${ mapName || toolLabel } ${ layerCount > 0 ? ` (${ layerCount } layers)` : "" } ` ;
578578 }
579579
580580 const parallaxDocument = readWorkspaceScopedToolDocument ( payload , "parallaxDocument" , scopedToolState ) ;
581581 if ( parallaxDocument ) {
582- const mapName = normalizeTextValue ( parallaxDocument ?. map ?. name || parallaxDocument . name || fallbackId ) ;
582+ const mapName = normalizeTextValue ( parallaxDocument ?. map ?. name || parallaxDocument . name || toolLabel ) ;
583583 const layerCount = Array . isArray ( parallaxDocument . layers ) ? parallaxDocument . layers . length : 0 ;
584- return `embedded parallax ${ mapName || fallbackId } ${ layerCount > 0 ? ` (${ layerCount } layers)` : "" } ` ;
584+ return `embedded parallax ${ mapName || toolLabel } ${ layerCount > 0 ? ` (${ layerCount } layers)` : "" } ` ;
585585 }
586586
587587 const spriteProject = readWorkspaceScopedToolDocument ( payload , "spriteProject" , scopedToolState ) ;
@@ -596,8 +596,8 @@ function summarizeEmbeddedToolPayloadDocument(toolId = "", scopedToolState = nul
596596 : null
597597 ) ;
598598 if ( skin ) {
599- const name = normalizeTextValue ( skin . name || skin . gameId || skin . projectId || fallbackId ) ;
600- return `embedded skin ${ name || fallbackId } ` ;
599+ const name = normalizeTextValue ( skin . name || skin . gameId || skin . projectId || toolLabel ) ;
600+ return `embedded skin ${ name || toolLabel } ` ;
601601 }
602602
603603 const flatAssets = scopedToolState . assets && typeof scopedToolState . assets === "object" && ! Array . isArray ( scopedToolState . assets )
@@ -613,15 +613,15 @@ function summarizeEmbeddedToolPayloadDocument(toolId = "", scopedToolState = nul
613613 const palette = readWorkspaceScopedToolDocument ( payload , "palette" , scopedToolState )
614614 || ( Array . isArray ( payload . swatches ) ? payload : null ) ;
615615 if ( palette ) {
616- const name = normalizeTextValue ( palette . name || palette . id || fallbackId ) ;
616+ const name = normalizeTextValue ( palette . name || palette . id || toolLabel ) ;
617617 const swatchCount = Array . isArray ( palette . swatches ) ? palette . swatches . length : 0 ;
618- return `embedded palette ${ name || fallbackId } ${ swatchCount > 0 ? ` (${ swatchCount } swatches)` : "" } ` ;
618+ return `embedded palette ${ name || toolLabel } ${ swatchCount > 0 ? ` (${ swatchCount } swatches)` : "" } ` ;
619619 }
620620
621621 const snapshot = readWorkspaceScopedToolDocument ( payload , "snapshot" , scopedToolState ) ;
622622 if ( snapshot ) {
623- const snapshotId = normalizeTextValue ( snapshot . toolId || snapshot . schema || fallbackId ) ;
624- return `embedded snapshot ${ snapshotId || fallbackId } ` ;
623+ const snapshotId = normalizeTextValue ( snapshot . toolId || snapshot . schema || toolLabel ) ;
624+ return `embedded snapshot ${ snapshotId || toolLabel } ` ;
625625 }
626626
627627 if ( Array . isArray ( payload . events ) ) {
@@ -640,32 +640,32 @@ function summarizeEmbeddedToolPayloadDocument(toolId = "", scopedToolState = nul
640640
641641 const pipelinePayload = readWorkspaceScopedToolDocument ( payload , "pipelinePayload" , scopedToolState ) ;
642642 if ( pipelinePayload ) {
643- const projectId = normalizeTextValue ( pipelinePayload . projectId || fallbackId ) ;
644- return `embedded pipeline payload ${ projectId || fallbackId } ` ;
643+ const projectId = normalizeTextValue ( pipelinePayload . projectId || toolLabel ) ;
644+ return `embedded pipeline payload ${ projectId || toolLabel } ` ;
645645 }
646646
647647 const candidate = readWorkspaceScopedToolDocument ( payload , "candidate" , scopedToolState ) ;
648648 if ( candidate ) {
649- const name = normalizeTextValue ( candidate . id || candidate . name || fallbackId ) ;
650- return `embedded candidate ${ name || fallbackId } ` ;
649+ const name = normalizeTextValue ( candidate . id || candidate . name || toolLabel ) ;
650+ return `embedded candidate ${ name || toolLabel } ` ;
651651 }
652652
653653 const mapPayload = readWorkspaceScopedToolDocument ( payload , "mapPayload" , scopedToolState ) ;
654654 if ( mapPayload ) {
655- const name = normalizeTextValue ( mapPayload . mapId || mapPayload . id || fallbackId ) ;
656- return `embedded map payload ${ name || fallbackId } ` ;
655+ const name = normalizeTextValue ( mapPayload . mapId || mapPayload . id || toolLabel ) ;
656+ return `embedded map payload ${ name || toolLabel } ` ;
657657 }
658658
659659 const asset3d = readWorkspaceScopedToolDocument ( payload , "asset3d" , scopedToolState ) ;
660660 if ( asset3d ) {
661- const name = normalizeTextValue ( asset3d . assetId || asset3d . id || fallbackId ) ;
662- return `embedded 3D asset ${ name || fallbackId } ` ;
661+ const name = normalizeTextValue ( asset3d . assetId || asset3d . id || toolLabel ) ;
662+ return `embedded 3D asset ${ name || toolLabel } ` ;
663663 }
664664
665665 const cameraPath = readWorkspaceScopedToolDocument ( payload , "cameraPath" , scopedToolState ) ;
666666 if ( cameraPath ) {
667- const name = normalizeTextValue ( cameraPath . pathId || cameraPath . id || fallbackId ) ;
668- return `embedded camera path ${ name || fallbackId } ` ;
667+ const name = normalizeTextValue ( cameraPath . pathId || cameraPath . id || toolLabel ) ;
668+ return `embedded camera path ${ name || toolLabel } ` ;
669669 }
670670
671671 return null ;
@@ -1321,8 +1321,8 @@ function renderToolAssetBadge(toolId = "") {
13211321 const missingAssetLabel = normalizedToolId === "skin-editor"
13221322 ? "select skin in Asset Browser"
13231323 : "none" ;
1324- const fallbackAssetLabel = embeddedPayloadSummary || missingAssetLabel ;
1325- const assetLabel = compatibleAsset ?. displayName || fallbackAssetLabel ;
1324+ const assetLabelBasis = embeddedPayloadSummary || missingAssetLabel ;
1325+ const assetLabel = compatibleAsset ?. displayName || assetLabelBasis ;
13261326 const assetTitle = compatibleAsset
13271327 ? `Updated: ${ escapeHtml ( compatibleAsset ?. selectedAt || "not-set" ) } `
13281328 : escapeHtml ( embeddedPayloadSummary ? "Resolved from embedded workspace payload" : "Updated: not-set" ) ;
0 commit comments