@@ -853,6 +853,15 @@ function renderWorkspaceSummary(currentTool) {
853853 return "" ;
854854 }
855855
856+ const workspacePagerOptions = getToolRegistry ( )
857+ . filter ( ( entry ) => entry ?. active === true && entry ?. visibleInToolsList === true )
858+ . map ( ( entry ) => {
859+ const displayName = normalizeTextValue ( entry . displayName || entry . name || entry . id ) ;
860+ const selected = entry . id === currentTool . id ? " selected" : "" ;
861+ return `<option value="${ escapeHtml ( entry . id ) } "${ selected } >${ escapeHtml ( displayName || entry . id ) } </option>` ;
862+ } )
863+ . join ( "" ) ;
864+
856865 const lockState = resolveWorkspaceToolLockState ( ) ;
857866 const workspaceActionDisabled = ! lockState . workspaceReady
858867 ? ' disabled aria-disabled="true"'
@@ -879,7 +888,7 @@ function renderWorkspaceSummary(currentTool) {
879888 <strong class="tools-platform-frame__project-name">${ escapeHtml ( workspaceName ) } ${ escapeHtml ( dirtyMark ) } </strong>
880889 <span class="tools-platform-frame__project-meta">${ escapeHtml ( readiness ) } </span>
881890 </div>
882- <section class="tool-host-pager" aria-label="Workspace tool pager" data-tool-host-pager><button type="button" class="tool-host-pager__button" data-tool-host-prev>[PREV]</button><span class="tool-host-pager__name" data-tool-host-current-label>${ escapeHtml ( currentTool ?. displayName || "Tool" ) } </span><button type="button" class="tool-host-pager__button" data-tool-host-next>[NEXT]</button><select id="tool-host-select" class="tool-host-pager__select" tabindex="-1" aria-hidden="true" data-tool-host-select></select></section>
891+ <section class="tool-host-pager" aria-label="Workspace tool pager" data-tool-host-pager><button type="button" class="tool-host-pager__button" data-tool-host-prev>[PREV]</button><span class="tool-host-pager__name" data-tool-host-current-label>${ escapeHtml ( currentTool ?. displayName || "Tool" ) } </span><button type="button" class="tool-host-pager__button" data-tool-host-next>[NEXT]</button><select id="tool-host-select" class="tool-host-pager__select" data-tool-host-select>${ workspacePagerOptions } </select></section>
883892 </div>
884893 ` ;
885894}
@@ -1215,6 +1224,36 @@ function bindWorkspacePagerDelegatedEvents() {
12151224 console . warn ( "[WorkspacePager] Failed to dispatch delegated pager action." , error ) ;
12161225 }
12171226 } ) ;
1227+
1228+ headerHost . addEventListener ( "change" , ( event ) => {
1229+ const select = event . target instanceof HTMLSelectElement
1230+ ? event . target
1231+ : null ;
1232+ if ( ! select || ! select . matches ( "[data-tool-host-select]" ) ) {
1233+ return ;
1234+ }
1235+ const toolId = normalizeTextValue ( select . value ) ;
1236+ if ( ! toolId ) {
1237+ console . warn ( "[WorkspacePager] Select change ignored because tool id is missing." ) ;
1238+ return ;
1239+ }
1240+ console . info ( `[WorkspacePager] SELECT handler fired (${ toolId } ).` ) ;
1241+
1242+ if ( typeof window === "undefined" || window . top === window ) {
1243+ console . warn ( "[WorkspacePager] No parent host available for delegated pager select." ) ;
1244+ return ;
1245+ }
1246+
1247+ try {
1248+ window . top . postMessage ( {
1249+ type : "workspace-pager-action" ,
1250+ action : "select" ,
1251+ toolId
1252+ } , window . location . origin ) ;
1253+ } catch ( error ) {
1254+ console . warn ( "[WorkspacePager] Failed to dispatch delegated pager select." , error ) ;
1255+ }
1256+ } ) ;
12181257}
12191258
12201259function renderShell ( currentTool ) {
0 commit comments