Skip to content

Commit 11e2442

Browse files
author
DavidQ
committed
Place pager at explicit platformShell marker
1 parent 2456265 commit 11e2442

7 files changed

Lines changed: 191 additions & 245 deletions

File tree

docs/dev/codex_rules.md

Lines changed: 6 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,9 @@
1-
# Codex Rules (MANDATORY — HARD CONSTRAINTS)
21

3-
These rules OVERRIDE all other instructions.
2+
# Codex Rules
43

5-
## This PR
4+
MANDATORY:
65

7-
Move `section.tool-host-pager` inside `[data-tool-host-mount-container]`.
8-
9-
Allowed:
10-
- targeted Workspace Manager index/main/CSS changes required for pager relocation
11-
- validation report
12-
13-
Forbidden:
14-
- broad cleanup
15-
- unrelated refactoring
16-
- samples changes
17-
- game label changes
18-
- duplicate pager
19-
- top-level pager before mount container
20-
- pager appended to document.body
21-
- second SSoT
22-
- start_of_day changes
23-
24-
## Structural Requirement
25-
26-
`tools/Workspace Manager/index.html` must not keep:
27-
28-
```html
29-
<section class="tool-host-pager">
30-
```
31-
32-
as a sibling before:
33-
34-
```html
35-
<div data-tool-host-mount-container>
36-
```
37-
38-
The visible pager must be rendered as a descendant of `[data-tool-host-mount-container]`.
39-
40-
## User-Approved Behavior
41-
42-
For this PR:
43-
- first available tool is selected on load
44-
- selected tool is active/mounted on load
45-
46-
## Still Forbidden
47-
48-
Do not restore:
49-
- `gameId || game`
50-
- legacy `game` query fallback
51-
- hidden fallback routing
52-
- stale memory reuse
53-
54-
## Anti-Patterns Forbidden
55-
56-
- variable aliasing
57-
- pass-through variables
58-
- duplicate state
59-
- stored derived state
60-
- vague names
61-
- hidden query fallback
62-
- duplicated launch paths
63-
- silent redirects
64-
- silent caught errors
65-
- duplicate event listeners
66-
- globals
67-
- broad refactor
68-
- scope expansion
6+
- Use EXACT marker location
7+
- One pager only
8+
- No index.html edits for pager
9+
- No guessing placement
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# BUILD_PR_LEVEL_20_24_PLACE_PAGER_AT_PLATFORM_SHELL_MARKER Validation
2+
3+
## Changed Files
4+
- `tools/shared/platformShell.js`
5+
- `tools/Workspace Manager/main.js`
6+
- `docs/dev/reports/platform_shell_pager_marker_validation.md`
7+
8+
## Marker Found And Replaced
9+
- Marker location now contains pager render logic:
10+
- `tools/shared/platformShell.js:876` `<section class="tool-host-pager" ...>`
11+
- The original marker comment `// pager should go here` is no longer present.
12+
13+
## Pager Rendered At Marker Location
14+
- Pager markup is rendered in `renderWorkspaceSummary(...)` exactly at the former marker line.
15+
- Controls rendered at marker:
16+
- `[PREV]` via `data-tool-host-prev`
17+
- current name via `data-tool-host-current-label`
18+
- `[NEXT]` via `data-tool-host-next`
19+
- hidden select via `data-tool-host-select`
20+
21+
## No Other Pager Instances
22+
- Check results:
23+
- `NOT_FOUND index pager markup`
24+
- `NOT_FOUND workspace main pager markup builder`
25+
- `tool-host-pager` markup appears only in:
26+
- `tools/shared/platformShell.js:876`
27+
28+
## Tool Mount Still Works
29+
- Workspace Manager keeps selected tool state even when select is shell-rendered or unavailable:
30+
- `tools/Workspace Manager/main.js:110` `let selectedToolId = ...`
31+
- `tools/Workspace Manager/main.js:187` `function readSelectedToolId()`
32+
- `tools/Workspace Manager/main.js:194` `function writeSelectedToolId(toolId)`
33+
- First tool selection + mount on load preserved:
34+
- `tools/Workspace Manager/main.js:742` `const initialToolId = requestedToolId || (toolIds[0] || "");`
35+
- `tools/Workspace Manager/main.js:772` `if (!mountSelectedTool("init")) {`
36+
- Prev/Next remount flow preserved:
37+
- `tools/Workspace Manager/main.js:602` prev handler
38+
- `tools/Workspace Manager/main.js:606` `mountSelectedTool("prev")`
39+
- `tools/Workspace Manager/main.js:611` next handler
40+
- `tools/Workspace Manager/main.js:615` `mountSelectedTool("next")`
41+
42+
## Guard Checks
43+
- `gameId || game` fallback not restored:
44+
- `tools/Workspace Manager/main.js:312` uses only `gameId`
45+
- search checks:
46+
- `NOT_FOUND gameId || game`
47+
- `NOT_FOUND searchParams.get("game")`
48+
- `NOT_FOUND searchParams.get('game')`
49+
- Samples unchanged:
50+
- `SAMPLES_UNCHANGED`
51+
52+
## Anti-Pattern Self-Check
53+
- Exact marker placement used: PASS
54+
- One pager markup instance: PASS
55+
- No index pager edits: PASS
56+
- No duplicate pager builder in Workspace Manager: PASS
57+
- No scope expansion outside requested files: PASS
Lines changed: 11 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,16 @@
1-
# Codex Commands — BUILD_PR_LEVEL_20_23_MOVE_TOOL_HOST_PAGER_INSIDE_MOUNT_CONTAINER
21

3-
## Model
4-
GPT-5.4 or GPT-5.3-codex
2+
# Codex Command
53

6-
## Reasoning
7-
High
4+
Execute BUILD_PR_LEVEL_20_24_PLACE_PAGER_AT_PLATFORM_SHELL_MARKER
85

9-
## Command
6+
Steps:
107

11-
```text
12-
Read docs/dev/codex_rules.md first.
8+
1. Open tools/shared/platformShell.js
9+
2. Locate:
10+
// pager should go here
11+
3. Replace ONLY that line with pager render logic
12+
4. Remove any other pager instances
13+
5. Ensure tool mount still works
14+
6. Do not modify unrelated code
1315

14-
Execute BUILD_PR_LEVEL_20_23_MOVE_TOOL_HOST_PAGER_INSIDE_MOUNT_CONTAINER.
15-
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>
19-
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>
25-
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>
34-
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.
46-
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
53-
- changing samples
54-
- broad Workspace Manager refactor
55-
- start_of_day changes
56-
57-
Validation:
58-
Create docs/dev/reports/tool_host_pager_inside_mount_container_validation.md with:
59-
- changed files
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
64-
- proof first available tool selected/mounted on load
65-
- proof Prev/Next changes selected/mounted tool
66-
- proof gameId || game fallback not restored
67-
- proof samples remain untouched
68-
- anti-pattern self-check
69-
70-
Return ZIP at:
71-
tmp/BUILD_PR_LEVEL_20_23_MOVE_TOOL_HOST_PAGER_INSIDE_MOUNT_CONTAINER.zip
72-
```
16+
Return ZIP
Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1 @@
1-
Move tool host pager inside mount container
2-
3-
PR Details:
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.
1+
Place pager at explicit platformShell marker
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
2+
# BUILD_PR_LEVEL_20_24_PLACE_PAGER_AT_PLATFORM_SHELL_MARKER
3+
4+
## Purpose
5+
6+
Place the Workspace Manager pager EXACTLY at the developer-provided marker:
7+
8+
```js
9+
// pager should go here
10+
```
11+
12+
inside:
13+
14+
```
15+
tools/shared/platformShell.js (around line 876)
16+
```
17+
18+
## Critical Correction
19+
20+
Do NOT:
21+
- guess placement
22+
- search for Editors
23+
- inject into index.html
24+
- inject into mount container directly
25+
26+
DO:
27+
- insert pager at the explicit marker location
28+
29+
## Scope
30+
31+
- Find marker: `// pager should go here`
32+
- Replace that marker with pager render logic
33+
- Ensure pager binds to existing tool host controls
34+
- Ensure pager drives tool selection + mount
35+
36+
## Required Behavior
37+
38+
- Pager appears exactly where marker is
39+
- No duplicate pagers exist
40+
- No pager exists in index.html
41+
- No pager exists in host shell top
42+
- Pager controls:
43+
- [PREV]
44+
- <toolname>
45+
- [NEXT]
46+
47+
- On load:
48+
- first tool selected
49+
- tool mounted
50+
51+
- Prev/Next:
52+
- update tool
53+
- remount tool
54+
55+
## Forbidden
56+
57+
- DO NOT modify index.html structure
58+
- DO NOT add new headers/banners
59+
- DO NOT inject pager anywhere else
60+
- DO NOT keep old pager
61+
- DO NOT fallback to gameId||game
62+
- DO NOT create second pager
63+
64+
## Validation
65+
66+
Create:
67+
docs/dev/reports/platform_shell_pager_marker_validation.md
68+
69+
Must prove:
70+
- marker found and replaced
71+
- pager rendered at marker location
72+
- no other pagers exist
73+
- tool mounts correctly

0 commit comments

Comments
 (0)