@@ -75,6 +75,42 @@ function getManifest() {
7575 return workspaceController ? workspaceController . getManifest ( ) : null ;
7676}
7777
78+ function isWorkspaceManagerContext ( ) {
79+ if ( typeof window === "undefined" ) {
80+ return false ;
81+ }
82+ const currentPath = window . location . pathname || "" ;
83+ const searchParams = new URLSearchParams ( window . location . search ) ;
84+ const isHostedWorkspaceView = searchParams . get ( "hosted" ) === "1"
85+ || searchParams . has ( "hostToolId" )
86+ || searchParams . has ( "hostContextId" ) ;
87+ const isWorkspaceManagerReferrer = / \/ t o o l s \/ W o r k s p a c e (?: % 2 0 | ) M a n a g e r \/ / i. test ( document . referrer || "" ) ;
88+ const isWorkspaceManagerParent = ( ( ) => {
89+ try {
90+ return window . top !== window
91+ && / \/ t o o l s \/ W o r k s p a c e (?: % 2 0 | ) M a n a g e r \/ / i. test ( window . top . location . pathname || "" ) ;
92+ } catch {
93+ return false ;
94+ }
95+ } ) ( ) ;
96+ return isHostedWorkspaceView
97+ || isWorkspaceManagerReferrer
98+ || isWorkspaceManagerParent
99+ || / \/ t o o l s \/ W o r k s p a c e % 2 0 M a n a g e r \/ / i. test ( currentPath )
100+ || / \/ t o o l s \/ W o r k s p a c e M a n a g e r \/ / i. test ( currentPath ) ;
101+ }
102+
103+ function getDisplaySurfaceName ( currentTool ) {
104+ if ( isWorkspaceManagerContext ( ) ) {
105+ const toolName = currentTool ?. displayName || document . body . dataset . toolTitle || "Tool" ;
106+ return `Workspace Manager (${ toolName } )` ;
107+ }
108+ if ( currentTool ) {
109+ return currentTool . displayName ;
110+ }
111+ return document . body . dataset . toolTitle || "Tools Platform" ;
112+ }
113+
78114function formatBindingValue ( label , value , fallback = "none" ) {
79115 const safe = String ( value || "" ) . trim ( ) ;
80116 return `${ label } : ${ safe || fallback } ` ;
@@ -265,7 +301,7 @@ function renderHeaderMarkup(currentTool, isHeaderExpanded) {
265301 || / \/ t o o l s \/ W o r k s p a c e % 2 0 M a n a g e r \/ / i. test ( currentPath )
266302 || / \/ t o o l s \/ W o r k s p a c e M a n a g e r \/ / i. test ( currentPath ) ;
267303 const sharedActionLinks = ! isLanding ? renderSharedActionLinks ( currentTool ?. id ?? "" ) : "" ;
268- const title = currentTool ? currentTool . displayName : ( document . body . dataset . toolTitle || "Tools Platform" ) ;
304+ const title = isLanding ? ( document . body . dataset . toolTitle || "Tools Platform" ) : getDisplaySurfaceName ( currentTool ) ;
269305 const description = currentTool
270306 ? currentTool . description
271307 : "Registry-driven, engine-themed entry surface for vector maps, vector assets, tilemaps, parallax scenes, and sprite workspaces." ;
@@ -314,9 +350,9 @@ function renderHeaderMarkup(currentTool, isHeaderExpanded) {
314350}
315351
316352function renderStatusMarkup ( currentTool ) {
317- const label = currentTool
318- ? currentTool . displayName
319- : ( getPageMode ( ) === "landing" ? "Landing Surface" : ( document . body . dataset . toolTitle || "Tool Surface" ) ) ;
353+ const label = getPageMode ( ) === "landing"
354+ ? "Landing Surface"
355+ : getDisplaySurfaceName ( currentTool ) ;
320356 const manifest = getManifest ( ) ;
321357 const workspaceName = manifest ?. name || "No active workspace" ;
322358 const dirtyLabel = manifest ?. dirty === true ? "Unsaved changes" : "Saved" ;
@@ -332,8 +368,9 @@ function renderStatusMarkup(currentTool) {
332368
333369function applyDocumentMetadata ( currentTool ) {
334370 document . body . classList . add ( "tools-platform-surface" ) ;
335- if ( currentTool ) {
336- document . title = `${ currentTool . displayName } | Tools Platform` ;
371+ const surfaceName = getDisplaySurfaceName ( currentTool ) ;
372+ if ( currentTool || isWorkspaceManagerContext ( ) ) {
373+ document . title = `${ surfaceName } | Tools Platform` ;
337374 } else if ( getPageMode ( ) === "landing" ) {
338375 document . title = "Tools Platform" ;
339376 } else {
0 commit comments