Skip to content

Commit 2456265

Browse files
author
DavidQ
committed
# Codex Commands — BUILD_PR_LEVEL_20_23_MOVE_TOOL_HOST_PAGER_INSIDE_MOUNT_CONTAINER
## Model GPT-5.4 or GPT-5.3-codex ## Reasoning High ## Command ```text Read docs/dev/codex_rules.md first. Execute BUILD_PR_LEVEL_20_23_MOVE_TOOL_HOST_PAGER_INSIDE_MOUNT_CONTAINER. User correction: The tool-host-pager section must be moved out of the top-level Workspace Manager host shell and into: <div data-tool-host-mount-container class="tool-host-workspace__mount"></div> Current wrong structure: <main class="tool-host-workspace"> <section class="tool-host-pager">...</section> <div data-tool-host-mount-container class="tool-host-workspace__mount"></div> </main> Required: <main class="tool-host-workspace"> <div data-tool-host-mount-container class="tool-host-workspace__mount"> ...mounted Workspace Manager content... <section class="tool-host-pager">...</section> ...Editors... </div> </main> Required changes: 1. Remove top-level section.tool-host-pager from tools/Workspace Manager/index.html. 2. Ensure main.js renders/creates the pager inside [data-tool-host-mount-container]. 3. Place pager above Editors/card grid inside mounted Workspace Manager content. 4. Keep pager controls wired: - [PREV] - current tool name - [NEXT] - hidden select if needed by existing code 5. On load, select/mount first available tool. 6. Prev/Next changes selected/mounted tool. Forbidden: - duplicate pager - top-level pager before mount container - appending pager to document.body - putting pager above site chrome/header - restoring gameId || game - changing samples - broad Workspace Manager refactor - start_of_day changes Validation: Create docs/dev/reports/tool_host_pager_inside_mount_container_validation.md with: - changed files - proof Workspace Manager index no longer has top-level section.tool-host-pager - proof section.tool-host-pager is rendered inside data-tool-host-mount-container - proof pager appears above Editors/card grid inside mounted content - proof pager is not above Toolbox Aid site header/chrome - proof first available tool selected/mounted on load - proof Prev/Next changes selected/mounted tool - proof gameId || game fallback not restored - proof samples remain untouched - anti-pattern self-check Return ZIP at: tmp/BUILD_PR_LEVEL_20_23_MOVE_TOOL_HOST_PAGER_INSIDE_MOUNT_CONTAINER.zip ```
1 parent 21dea16 commit 2456265

11 files changed

Lines changed: 775 additions & 103 deletions

docs/dev/codex_rules.md

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,44 @@ These rules OVERRIDE all other instructions.
44

55
## This PR
66

7-
Rollback failed Workspace Manager header/banner attempts, then add only the requested pager.
7+
Move `section.tool-host-pager` inside `[data-tool-host-mount-container]`.
88

99
Allowed:
10-
- targeted rollback of Workspace Manager files affected by 20_14 through 20_19
11-
- add centered [PREV] <toolname> [NEXT] above tools/editors
10+
- targeted Workspace Manager index/main/CSS changes required for pager relocation
1211
- validation report
1312

1413
Forbidden:
1514
- broad cleanup
1615
- unrelated refactoring
17-
- changes to samples behavior
18-
- changes to required labels
19-
- new header
20-
- new banner
21-
- keeping failed top Workspace Manager control/header area
16+
- samples changes
17+
- game label changes
18+
- duplicate pager
19+
- top-level pager before mount container
20+
- pager appended to document.body
2221
- second SSoT
2322
- start_of_day changes
24-
- roadmap text rewrite outside status markers
2523

26-
## Rollback Anchor
24+
## Structural Requirement
2725

28-
Find the commit with comment:
26+
`tools/Workspace Manager/index.html` must not keep:
2927

30-
Remove Workspace Manager default and query fallbacks
28+
```html
29+
<section class="tool-host-pager">
30+
```
3131

32-
Use it as the Workspace Manager restore anchor before applying pager.
32+
as a sibling before:
3333

34-
## Required UI
34+
```html
35+
<div data-tool-host-mount-container>
36+
```
3537

36-
Restore normal Workspace Manager content first.
37-
38-
Then add only:
39-
40-
[PREV] <toolname> [NEXT]
41-
42-
above the existing tools/editors section.
38+
The visible pager must be rendered as a descendant of `[data-tool-host-mount-container]`.
4339

4440
## User-Approved Behavior
4541

4642
For this PR:
47-
- first available tool is selected on page load
48-
- selected tool is active/mounted on page load
43+
- first available tool is selected on load
44+
- selected tool is active/mounted on load
4945

5046
## Still Forbidden
5147

@@ -54,7 +50,6 @@ Do not restore:
5450
- legacy `game` query fallback
5551
- hidden fallback routing
5652
- stale memory reuse
57-
- broken header/banner/control area
5853

5954
## Anti-Patterns Forbidden
6055

@@ -67,10 +62,7 @@ Do not restore:
6762
- duplicated launch paths
6863
- silent redirects
6964
- silent caught errors
70-
- broad truthy/falsy behavior changes
71-
- magic strings outside existing registry/config pattern
7265
- duplicate event listeners
7366
- globals
74-
- new managers/factories/service layers
75-
- public API changes outside this PR
67+
- broad refactor
7668
- scope expansion
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# BUILD_PR_LEVEL_20_23_MOVE_TOOL_HOST_PAGER_INSIDE_MOUNT_CONTAINER Validation
2+
3+
## Changed Files
4+
- `tools/Workspace Manager/index.html`
5+
- `tools/Workspace Manager/main.js`
6+
- `tools/Workspace Manager/toolHost.css`
7+
- `docs/dev/reports/tool_host_pager_inside_mount_container_validation.md`
8+
9+
## Proof Workspace Manager Index No Longer Has Top-Level section.tool-host-pager
10+
- `index.html` now contains only mount container under main:
11+
- `tools/Workspace Manager/index.html:10` `<main class="tool-host-workspace">`
12+
- `tools/Workspace Manager/index.html:11` `<div data-tool-host-mount-container class="tool-host-workspace__mount"></div>`
13+
- No `<section class="tool-host-pager">` remains in `index.html`.
14+
15+
## Proof section.tool-host-pager Is Rendered Inside data-tool-host-mount-container
16+
- `main.js` creates pager in runtime mount content builder:
17+
- `tools/Workspace Manager/main.js:112` `function ensureWorkspaceMountContent() {`
18+
- `tools/Workspace Manager/main.js:117` checks for pager inside mount container
19+
- `tools/Workspace Manager/main.js:159` `mountedContent.append(pagerSection, runtimeMountContainer);`
20+
- `tools/Workspace Manager/main.js:160` `refs.mountContainer.replaceChildren(mountedContent);`
21+
22+
## Proof Pager Appears Above Editors/Card Grid Inside Mounted Content
23+
- Pager is appended before editor/runtime surface in mounted content:
24+
- `tools/Workspace Manager/main.js:159` `mountedContent.append(pagerSection, runtimeMountContainer);`
25+
- Mounted layout ensures pager row above editor surface:
26+
- `tools/Workspace Manager/toolHost.css:35` `.tool-host-mounted-content {` (column layout)
27+
- `tools/Workspace Manager/toolHost.css:80` `.tool-host-pager {`
28+
- `tools/Workspace Manager/toolHost.css:44` `.tool-host-editors-surface {`
29+
- `tools/Workspace Manager/toolHost.css:111` tool/game iframes render inside `.tool-host-editors-surface`
30+
31+
## Proof Pager Is Not Above Toolbox Aid Site Header/Chrome
32+
- `index.html` no longer renders pager directly in top-level shell markup.
33+
- Pager is generated only inside `data-tool-host-mount-container` via `ensureWorkspaceMountContent()`.
34+
35+
## Proof First Available Tool Selected/Mounted On Load
36+
- First available fallback selection on load:
37+
- `tools/Workspace Manager/main.js:801` `const initialToolId = requestedToolId || (toolIds[0] || "");`
38+
- Selected tool is mounted during init:
39+
- `tools/Workspace Manager/main.js:833` `if (!mountSelectedTool("init")) {`
40+
41+
## Proof Prev/Next Changes Selected/Mounted Tool
42+
- Prev wiring:
43+
- `tools/Workspace Manager/main.js:657` prev click handler
44+
- `tools/Workspace Manager/main.js:661` `mountSelectedTool("prev")`
45+
- Next wiring:
46+
- `tools/Workspace Manager/main.js:666` next click handler
47+
- `tools/Workspace Manager/main.js:670` `mountSelectedTool("next")`
48+
49+
## Proof gameId || game Fallback Not Restored
50+
- Explicit `gameId` only:
51+
- `tools/Workspace Manager/main.js:364` `const gameId = (url.searchParams.get("gameId") || "").trim();`
52+
- Search checks:
53+
- `NOT_FOUND gameId || game`
54+
- `NOT_FOUND searchParams.get("game")`
55+
- `NOT_FOUND searchParams.get('game')`
56+
57+
## Proof Samples Remain Untouched
58+
- Check result: `SAMPLES_UNCHANGED`
59+
- Based on `git diff --name-only -- samples`.
60+
61+
## Anti-Pattern Self-Check
62+
- No duplicate pager rendered: PASS (single dynamic pager inside mount container)
63+
- No top-level pager sibling before mount container: PASS
64+
- No pager appended to `document.body`: PASS
65+
- No `gameId || game` fallback restored: PASS
66+
- No samples changes: PASS
67+
- Scope remained targeted to Workspace Manager index/main/CSS + validation report: PASS
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# BUILD_PR_LEVEL_20_21_REPAIR_WORKSPACE_MOUNT_CONTAINER_PAGER Validation
2+
3+
## Changed Files
4+
- `tools/Workspace Manager/main.js`
5+
- `tools/Workspace Manager/toolHost.css`
6+
- `docs/dev/reports/workspace_manager_mount_container_pager_validation.md`
7+
8+
## Proof data-tool-host-mount-container Is Found
9+
- Shell mount container exists in host page:
10+
- `tools/Workspace Manager/index.html:17` `<div data-tool-host-mount-container class="tool-host-workspace__mount"></div>`
11+
- Runtime ref is resolved from DOM:
12+
- `tools/Workspace Manager/main.js:96` `mountContainer: document.querySelector("[data-tool-host-mount-container]")`
13+
14+
## Proof Valid Game-Launched URL Mounts Selected Tool Content Into Container
15+
For `tools/Workspace Manager/index.html?gameId=Breakout&mount=game`:
16+
- Explicit `gameId` parsing:
17+
- `tools/Workspace Manager/main.js:300` `const gameId = (url.searchParams.get("gameId") || "").trim();`
18+
- `init()` computes first tool for game-launched context:
19+
- `tools/Workspace Manager/main.js:735` `const initialToolId = requestedToolId || (initialGameEntry && gameLaunchRequested ? (toolIds[0] || "") : "");`
20+
- `init()` mounts selected tool:
21+
- `tools/Workspace Manager/main.js:767` `if (!mountSelectedTool("init")) {`
22+
- Mount writes iframe into mount container:
23+
- `tools/shared/toolHostRuntime.js:169` `mountContainer.replaceChildren(frame);`
24+
25+
## Proof First Available Tool Is Selected On Load
26+
- Game-launched selection uses first filtered tool id when no `tool` query is provided:
27+
- `tools/Workspace Manager/main.js:735` `... ? (toolIds[0] || "") : "")`
28+
29+
## Proof First Available Tool Is Mounted On Load
30+
- Initial selection path calls mount:
31+
- `tools/Workspace Manager/main.js:767` `if (!mountSelectedTool("init")) {`
32+
- Mount path invokes runtime mount API:
33+
- `tools/Workspace Manager/main.js:547` `const mountResult = runtime.mountTool(toolId, {`
34+
35+
## Proof Prev/Next Changes Current Label
36+
- Prev/Next handlers mount newly selected tool:
37+
- `tools/Workspace Manager/main.js:595` `mountSelectedTool("prev");`
38+
- `tools/Workspace Manager/main.js:604` `mountSelectedTool("next");`
39+
- Label updates on successful mount:
40+
- `tools/Workspace Manager/main.js:506` `setCurrentLabel(tool.displayName);`
41+
42+
## Proof Prev/Next Remounts Selected Tool Into Mount Container
43+
- Prev/Next call `mountSelectedTool(...)` (lines above).
44+
- `mountSelectedTool` calls runtime mount:
45+
- `tools/Workspace Manager/main.js:547` `const mountResult = runtime.mountTool(toolId, {`
46+
- Runtime replaces container children with selected tool iframe:
47+
- `tools/shared/toolHostRuntime.js:169` `mountContainer.replaceChildren(frame);`
48+
49+
## Proof Blank Mount Container Cannot Occur Silently
50+
Failure/empty states now render explicit diagnostic panel in mount container:
51+
- Diagnostic renderer:
52+
- `tools/Workspace Manager/main.js:196` `function renderMountDiagnostic(message, detail = "") {`
53+
- `tools/Workspace Manager/main.js:213` `refs.mountContainer.replaceChildren(panelNode);`
54+
- No selected tool:
55+
- `tools/Workspace Manager/main.js:520` `renderMountDiagnostic("No tool is selected for mount.", ...)`
56+
- No tools for game context:
57+
- `tools/Workspace Manager/main.js:654` `renderMountDiagnostic("No active tools are available for this game context.", ...)`
58+
- `tools/Workspace Manager/main.js:745` `renderMountDiagnostic("No active tools are available for this game context.", ...)`
59+
- Invalid/missing game context:
60+
- `tools/Workspace Manager/main.js:628`, `639`, `703`, `715`
61+
62+
## Proof Visible Diagnostic Appears Inside Mount Container On Mount Failure
63+
- Synchronous mount failure path:
64+
- `tools/Workspace Manager/main.js:558` `if (!mountResult || !(mountResult.frame instanceof HTMLIFrameElement)) {`
65+
- `tools/Workspace Manager/main.js:562` `renderMountDiagnostic(`
66+
- Frame load failure path:
67+
- `tools/Workspace Manager/main.js:569` `mountResult.frame.addEventListener("error", () => {`
68+
- `tools/Workspace Manager/main.js:573` `renderMountDiagnostic(`
69+
- Diagnostic panel has visible styling in mount surface:
70+
- `tools/Workspace Manager/toolHost.css:35` `.tool-host-mount-diagnostic {`
71+
- `tools/Workspace Manager/toolHost.css:39` `border: 1px solid #a73a3a;`
72+
73+
## Proof gameId || game Fallback Not Restored
74+
- Check result: `NOT_FOUND gameId || game`
75+
- Check result: `NOT_FOUND searchParams.get("game")`
76+
- Check result: `NOT_FOUND searchParams.get('game')`
77+
78+
## Proof Samples Remain Untouched
79+
- Check result: `SAMPLES_UNCHANGED`
80+
- Based on `git diff --name-only -- samples` output.
81+
82+
## Additional Layout Fix For Non-Blank Mount Surface
83+
- Host workspace now has explicit full-size dimensions to prevent mount-area collapse:
84+
- `tools/Workspace Manager/toolHost.css:14` `.tool-host-workspace {`
85+
- `tools/Workspace Manager/toolHost.css:15` `width: 100%;`
86+
- `tools/Workspace Manager/toolHost.css:16` `height: 100%;`
87+
88+
## Anti-Pattern Self-Check
89+
- No `gameId || game` or legacy `game` fallback restored: PASS
90+
- No hidden fallback routing introduced: PASS
91+
- No stale memory reuse changes introduced: PASS
92+
- No dropdown + Select Tool + Mount workflow restored: PASS
93+
- No samples changes: PASS
94+
- No new header/banner or pager relocation: PASS
95+
- Scope remained targeted to requested files: PASS
Lines changed: 41 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Codex Commands — BUILD_PR_LEVEL_20_20_ROLLBACK_WORKSPACE_HEADER_AND_ADD_TOOL_PAGER
1+
# Codex Commands — BUILD_PR_LEVEL_20_23_MOVE_TOOL_HOST_PAGER_INSIDE_MOUNT_CONTAINER
22

33
## Model
44
GPT-5.4 or GPT-5.3-codex
@@ -11,59 +11,62 @@ High
1111
```text
1212
Read docs/dev/codex_rules.md first.
1313
14-
Execute BUILD_PR_LEVEL_20_20_ROLLBACK_WORKSPACE_HEADER_AND_ADD_TOOL_PAGER.
14+
Execute BUILD_PR_LEVEL_20_23_MOVE_TOOL_HOST_PAGER_INSIDE_MOUNT_CONTAINER.
1515
16-
User UAT failure:
17-
- Current Workspace Manager page still has the unwanted header/banner/control area.
18-
- Only the site image is showing below it.
19-
- User wants this rolled back to the way Workspace Manager loaded before the failed header attempts.
20-
- Then add only [PREV] <toolname> [NEXT] above the tools/editors section.
16+
User correction:
17+
The tool-host-pager section must be moved out of the top-level Workspace Manager host shell and into:
18+
<div data-tool-host-mount-container class="tool-host-workspace__mount"></div>
2119
22-
Rollback anchor:
23-
Find the commit with commit comment:
24-
Remove Workspace Manager default and query fallbacks
20+
Current wrong structure:
21+
<main class="tool-host-workspace">
22+
<section class="tool-host-pager">...</section>
23+
<div data-tool-host-mount-container class="tool-host-workspace__mount"></div>
24+
</main>
2525
26-
This is the state after BUILD_PR_LEVEL_20_13_REMOVE_WORKSPACE_MANAGER_DEFAULT_AND_QUERY_FALLBACKS and before the failed 20_14 through 20_19 header/banner attempts.
26+
Required:
27+
<main class="tool-host-workspace">
28+
<div data-tool-host-mount-container class="tool-host-workspace__mount">
29+
...mounted Workspace Manager content...
30+
<section class="tool-host-pager">...</section>
31+
...Editors...
32+
</div>
33+
</main>
2734
28-
Required steps:
29-
1. Inspect git history for Workspace Manager files.
30-
2. Restore only Workspace Manager files affected by 20_14 through 20_19 to the rollback anchor state.
31-
Likely files:
32-
- tools/Workspace Manager/main.js
33-
- tools/Workspace Manager/index.html
34-
- any Workspace Manager CSS touched by those PRs
35-
3. Do not rollback unrelated files.
36-
4. After restore, add exactly one centered pager directly above the existing tools/editors section:
37-
[PREV] <toolname> [NEXT]
38-
5. On page load, select the first available tool for the explicit gameId context.
39-
6. Mount/activate that selected tool.
40-
7. Prev/Next changes selected and mounted tool.
41-
8. Do not use dropdown + Select Tool + Mount workflow.
42-
9. Do not create or keep any new header/banner.
35+
Required changes:
36+
1. Remove top-level section.tool-host-pager from tools/Workspace Manager/index.html.
37+
2. Ensure main.js renders/creates the pager inside [data-tool-host-mount-container].
38+
3. Place pager above Editors/card grid inside mounted Workspace Manager content.
39+
4. Keep pager controls wired:
40+
- [PREV]
41+
- current tool name
42+
- [NEXT]
43+
- hidden select if needed by existing code
44+
5. On load, select/mount first available tool.
45+
6. Prev/Next changes selected/mounted tool.
4346
44-
Still forbidden:
45-
- restore gameId || game
46-
- legacy game query fallback
47-
- hidden fallback routing
48-
- stale memory reuse
47+
Forbidden:
48+
- duplicate pager
49+
- top-level pager before mount container
50+
- appending pager to document.body
51+
- putting pager above site chrome/header
52+
- restoring gameId || game
4953
- changing samples
5054
- broad Workspace Manager refactor
5155
- start_of_day changes
5256
5357
Validation:
54-
Create docs/dev/reports/workspace_manager_rollback_header_and_tool_pager_validation.md with:
55-
- rollback anchor commit hash and comment
58+
Create docs/dev/reports/tool_host_pager_inside_mount_container_validation.md with:
5659
- changed files
57-
- proof failed header/banner/control area removed
58-
- proof normal Workspace Manager content loads below site chrome
59-
- proof only [PREV] <toolname> [NEXT] was added
60-
- proof pager appears above existing tools/editors section
60+
- proof Workspace Manager index no longer has top-level section.tool-host-pager
61+
- proof section.tool-host-pager is rendered inside data-tool-host-mount-container
62+
- proof pager appears above Editors/card grid inside mounted content
63+
- proof pager is not above Toolbox Aid site header/chrome
6164
- proof first available tool selected/mounted on load
6265
- proof Prev/Next changes selected/mounted tool
6366
- proof gameId || game fallback not restored
6467
- proof samples remain untouched
6568
- anti-pattern self-check
6669
6770
Return ZIP at:
68-
tmp/BUILD_PR_LEVEL_20_20_ROLLBACK_WORKSPACE_HEADER_AND_ADD_TOOL_PAGER.zip
71+
tmp/BUILD_PR_LEVEL_20_23_MOVE_TOOL_HOST_PAGER_INSIDE_MOUNT_CONTAINER.zip
6972
```
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
Rollback Workspace Manager header attempts and add tool pager
1+
Move tool host pager inside mount container
22

33
PR Details:
4-
- Restores Workspace Manager layout from the pre-header/banner anchor.
5-
- Removes failed top Workspace Manager header/banner/control experiments.
6-
- Adds centered [PREV] <toolname> [NEXT] above the existing tools/editors section.
7-
- Selects and mounts the first available tool on load.
8-
- Keeps explicit gameId behavior without restoring legacy query fallback.
4+
- Removes top-level tool-host-pager from Workspace Manager host shell.
5+
- Renders the pager inside data-tool-host-mount-container.
6+
- Places pager above Editors inside mounted Workspace Manager content.
7+
- Keeps first available tool selected/mounted on load.
8+
- Keeps Prev/Next tool switching.
9+
- Does not restore legacy game query fallback.

0 commit comments

Comments
 (0)