Skip to content

Commit 422e0ec

Browse files
author
DavidQ
committed
Fix Workspace Manager SVG tool mapping from registry through click handler - PR 11.181
1 parent 42b32f7 commit 422e0ec

6 files changed

Lines changed: 422 additions & 28 deletions

File tree

docs/dev/codex_commands.md

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,49 @@
1-
# Codex Commands — PR 11.180
1+
# Codex Commands — PR 11.181
22

3-
Model: GPT-5.4
3+
Model: GPT-5 high
44
Reasoning: high
55

6-
Fix SVG launch/entry path so `[SVG_HOSTED_WORKSPACE_ENTRY]` appears.
6+
Fix Workspace Manager SVG launch mapping.
77

88
Primary files:
99
- `tools/Workspace Manager/main.js`
10-
- `tools/SVG Asset Studio/main.js`
10+
- `tools/shared/toolRegistry.js` only if registry data is wrong
11+
- `tools/SVG Asset Studio/main.js` only if entry log is missing after correct launch URL
12+
13+
Hard rules:
14+
- Do not modify schemas.
15+
- Do not modify sample 1902 JSON.
16+
- Do not modify shell behavior.
17+
- Do not restore shared handoff.
18+
- Do not migrate all tools.
1119

1220
Steps:
13-
1. Add `[WORKSPACE_TOOL_LAUNCH]` logging for every mounted tool.
14-
2. Add `[SVG_LAUNCH_REQUEST]` logging for SVG with iframe URL and payload proof.
15-
3. Add `[SVG_ENTRY_TOP]` at the top of SVG Asset Studio entry.
16-
4. Ensure SVG iframe URL has:
17-
- hosted=1
18-
- hostToolId=svg-asset-studio
19-
- hostContextId non-empty
20-
5. Ensure SVG hosted guard condition matches actual URL params.
21-
6. Ensure hosted SVG calls `initWorkspaceShell()`.
22-
7. Do not restore shared handoff or platformShell badge writes.
23-
8. Add report:
24-
- `docs/dev/reports/pr_11_180_validation.md`
21+
1. Add `[WORKSPACE_REGISTRY_RESOLVE]` logging for registry resolution.
22+
2. Add `[WORKSPACE_TOOL_TILE_RENDER]` logging for rendered tool tiles/buttons.
23+
3. Add `[WORKSPACE_TOOL_CLICK]` logging before launch dispatch.
24+
4. Keep/add `[WORKSPACE_TOOL_LAUNCH]` logging.
25+
5. Add `[SVG_LAUNCH_REQUEST]` for SVG launch.
26+
6. Fix the first broken link causing SVG click not to launch `svg-asset-studio`.
27+
7. Create report:
28+
- `docs/dev/reports/pr_11_181_validation.md`
2529

2630
Validation:
2731
- `node --check "tools/Workspace Manager/main.js"`
32+
- `node --check tools/shared/toolRegistry.js`
2833
- `node --check "tools/SVG Asset Studio/main.js"`
29-
- `node --check tools/shared/workspaceShell.js`
30-
- `node --check tools/shared/platformShell.js`
3134

32-
Manual:
35+
Manual UAT:
3336
- Open sample 1902.
34-
- Click/mount SVG Asset Studio.
35-
- Confirm logs:
36-
- `[WORKSPACE_TOOL_LAUNCH]`
37+
- Click SVG Asset Studio.
38+
- Confirm:
39+
- `[WORKSPACE_TOOL_CLICK] datasetToolId: svg-asset-studio`
40+
- `[WORKSPACE_TOOL_LAUNCH] requestedToolId: svg-asset-studio`
3741
- `[SVG_LAUNCH_REQUEST]`
3842
- `[SVG_ENTRY_TOP]`
39-
- `[SVG_HOSTED_WORKSPACE_ENTRY]`
40-
- `[WORKSPACE_SHELL_STATE]`
41-
- `[SVG_POSTMESSAGE_SEND]`
42-
- `[SVG_POSTMESSAGE_RECEIVE]`
43+
44+
Full samples smoke:
45+
- Skip.
46+
- Reason: targeted Workspace Manager registry/tile/click launch mapping fix.
4347

4448
Return ZIP artifact at:
45-
`<project folder>/tmp/PR_11_180_20260430_01.zip`
49+
`<project folder>/tmp/PR_11_181_20260430_01.zip`

docs/dev/commit_comment.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Fix SVG launch entry path so hosted workspace shell executes - PR 11.180
1+
Fix Workspace Manager SVG tool mapping from registry through click handler - PR 11.181
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# PR 11.181 Mapping Strategy
2+
3+
## Decision
4+
Stop shell debugging until SVG actually launches.
5+
6+
## Evidence
7+
The latest log only shows Vector Map Editor launch:
8+
- `requestedToolId: vector-map-editor`
9+
- `normalizedToolId: vector-map-editor`
10+
11+
No SVG launch or SVG entry logs appear.
12+
13+
## Debug order
14+
1. Registry
15+
2. Rendered tile data
16+
3. Click handler
17+
4. Launch URL
18+
19+
## Goal
20+
Clicking SVG Asset Studio must produce:
21+
`[WORKSPACE_TOOL_LAUNCH] svg-asset-studio`
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# PR 11.181 Validation
2+
3+
## Scope
4+
Fixed Workspace Manager SVG launch mapping upstream of shell behavior.
5+
6+
## Files changed
7+
- `tools/Workspace Manager/main.js`
8+
- `docs/dev/reports/pr_11_181_validation.md`
9+
10+
## Registry audit
11+
The registry source used by Workspace Manager is `tools/toolRegistry.js` through `tools/shared/toolHostManifest.js`.
12+
13+
Registry evidence:
14+
- `svg-asset-studio` exists.
15+
- Display name is `SVG Asset Studio`.
16+
- Entry point is `SVG Asset Studio/index.html`.
17+
- `tools/shared/toolRegistry.js` does not exist in this repository, so validation was run against the actual registry file, `tools/toolRegistry.js`.
18+
19+
Added `[WORKSPACE_REGISTRY_RESOLVE]` logging in Workspace Manager with:
20+
- requested tool id
21+
- normalized tool id
22+
- registry tool id
23+
- display name
24+
- entry URL
25+
- SVG flag
26+
27+
## Rendered tile audit
28+
Added `[WORKSPACE_TOOL_TILE_RENDER]` logging when Workspace Manager derives the active tool list. This records:
29+
- tool id
30+
- display name
31+
- entry URL
32+
- data tool id expected for launch mapping
33+
34+
## Click handler fix
35+
Broken link found: Workspace Manager could launch from pager state, but did not resolve direct shared-shell tool row/link clicks into a selected Workspace Manager tool id. A click on a visible tool row could therefore fail to dispatch `svg-asset-studio` through `mountSelectedTool()`.
36+
37+
Fix added in `tools/Workspace Manager/main.js`:
38+
- Detect clicks on `.tools-platform-frame__nav-link` and `.tools-platform-frame__nav-tool-row` when present in the Workspace Manager document.
39+
- Resolve the tool id from data attributes when available.
40+
- If no data attribute exists, resolve the tool id from the clicked link href against the Workspace Manager tool manifest.
41+
- Log `[WORKSPACE_TOOL_CLICK]` before dispatch.
42+
- Set selected tool id to the resolved id and call `mountSelectedTool("tool-click")`.
43+
44+
Expected SVG click proof:
45+
- `[WORKSPACE_TOOL_CLICK]` with `datasetToolId: svg-asset-studio` or resolved SVG id from href
46+
- `[WORKSPACE_TOOL_LAUNCH]` with `requestedToolId: svg-asset-studio`
47+
- `[SVG_LAUNCH_REQUEST]`
48+
- `[SVG_ENTRY_TOP]`
49+
50+
## Existing launch logs retained
51+
Existing `[WORKSPACE_TOOL_LAUNCH]` and `[SVG_LAUNCH_REQUEST]` logging remains in place.
52+
53+
## Validation
54+
- PASS: `node --check "tools/Workspace Manager/main.js"`
55+
- PASS: `node --check tools/toolRegistry.js`
56+
- PASS: `node --check "tools/SVG Asset Studio/main.js"`
57+
58+
Note: requested path `tools/shared/toolRegistry.js` is not present in this repository; `tools/toolRegistry.js` is the actual registry source imported by Workspace Manager dependencies.
59+
60+
## Manual UAT
61+
Not run in this terminal session. Required browser UAT remains:
62+
- Open sample 1902.
63+
- Click SVG Asset Studio.
64+
- Confirm `[WORKSPACE_TOOL_CLICK] datasetToolId: svg-asset-studio`.
65+
- Confirm `[WORKSPACE_TOOL_LAUNCH] requestedToolId: svg-asset-studio`.
66+
- Confirm `[SVG_LAUNCH_REQUEST]`.
67+
- Confirm `[SVG_ENTRY_TOP]`.
68+
69+
## Full samples smoke
70+
Skipped. Reason: targeted Workspace Manager registry/tile/click launch mapping fix.
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
# BUILD_PR_LEVEL_11_181_AUDIT_WORKSPACE_TOOL_MAPPING_REGISTRY_CLICK
2+
3+
## Purpose
4+
Fix the upstream reason SVG Asset Studio is not launching: audit and correct Workspace Manager tool mapping in this order:
5+
6+
1. tool registry
7+
2. rendered tile metadata
8+
3. click handler dispatch
9+
4. launch request
10+
11+
## Proven State
12+
Recent logs show Workspace Manager launches only:
13+
14+
`requestedToolId: vector-map-editor`
15+
16+
No SVG launch logs appear:
17+
- no `[WORKSPACE_TOOL_LAUNCH] svg-asset-studio`
18+
- no `[SVG_LAUNCH_REQUEST]`
19+
- no `[SVG_ENTRY_TOP]`
20+
- no `[SVG_HOSTED_WORKSPACE_ENTRY]`
21+
22+
Therefore the current problem is upstream of shell/runtime:
23+
SVG is not being launched.
24+
25+
## Scope
26+
One PR purpose only:
27+
- Ensure clicking SVG Asset Studio launches `svg-asset-studio`, not `vector-map-editor`.
28+
29+
Do not modify schemas.
30+
Do not modify sample 1902 JSON.
31+
Do not modify SVG payload parsing.
32+
Do not change platformShell/workspaceShell behavior.
33+
Do not restore shared handoff.
34+
Do not migrate all tools.
35+
36+
## Implementation Requirements
37+
38+
### 1. Registry audit
39+
Inspect the registry source used by Workspace Manager.
40+
41+
Verify:
42+
- `svg-asset-studio` exists
43+
- display name is SVG Asset Studio
44+
- entry URL points to SVG Asset Studio, not Vector Map Editor
45+
- normalized ID remains `svg-asset-studio`
46+
47+
Add log during registry resolution:
48+
49+
`[WORKSPACE_REGISTRY_RESOLVE]`
50+
51+
Payload:
52+
- requestedToolId
53+
- normalizedToolId
54+
- registryToolId
55+
- displayName
56+
- entryUrl
57+
- isSvg
58+
59+
### 2. Rendered tile audit
60+
Where Workspace Manager renders the tool list/buttons/tiles, ensure each tile/button gets its own correct tool id.
61+
62+
For SVG tile/button:
63+
- `data-tool-id="svg-asset-studio"`
64+
- display text includes `SVG Asset Studio`
65+
- click target is not reused from Vector Map Editor
66+
67+
Add log during render:
68+
69+
`[WORKSPACE_TOOL_TILE_RENDER]`
70+
71+
Payload:
72+
- toolId
73+
- displayName
74+
- entryUrl
75+
- dataToolId
76+
77+
### 3. Click handler audit
78+
In the Workspace Manager click handler, log before any launch:
79+
80+
`[WORKSPACE_TOOL_CLICK]`
81+
82+
Payload:
83+
- clickedText
84+
- datasetToolId
85+
- resolvedToolId
86+
- eventTarget
87+
- closestToolId
88+
89+
Fix any handler that:
90+
- reads the first tile
91+
- uses stale closure state
92+
- uses active/current tool instead of clicked tile
93+
- defaults to vector-map-editor
94+
- normalizes SVG incorrectly
95+
96+
### 4. Launch audit
97+
Before launch, keep existing:
98+
99+
`[WORKSPACE_TOOL_LAUNCH]`
100+
101+
For SVG specifically, log:
102+
103+
`[SVG_LAUNCH_REQUEST]`
104+
105+
Payload:
106+
- requestedToolId
107+
- normalizedToolId
108+
- registry entry URL
109+
- iframe src
110+
- hostToolId param
111+
- hostContextId
112+
- has vectorAssetDocument
113+
- sourceName
114+
- svgText length
115+
116+
### 5. Fix first broken link
117+
Codex must fix the first confirmed broken point:
118+
- registry mismatch
119+
- tile data attribute mismatch
120+
- click handler mismatch
121+
- launch normalization mismatch
122+
123+
Keep the change surgical.
124+
125+
## Acceptance
126+
Manual UAT:
127+
128+
Open sample 1902 Workspace Manager.
129+
Click SVG Asset Studio.
130+
131+
Expected logs:
132+
- `[WORKSPACE_REGISTRY_RESOLVE]` for `svg-asset-studio`
133+
- `[WORKSPACE_TOOL_TILE_RENDER]` for `svg-asset-studio`
134+
- `[WORKSPACE_TOOL_CLICK]` with `datasetToolId: svg-asset-studio`
135+
- `[WORKSPACE_TOOL_LAUNCH]` with `requestedToolId: svg-asset-studio`
136+
- `[SVG_LAUNCH_REQUEST]`
137+
- `[SVG_ENTRY_TOP]`
138+
139+
Not acceptable:
140+
- clicking SVG launches `vector-map-editor`
141+
- SVG click has missing datasetToolId
142+
- SVG registry entry points to Vector Map Editor
143+
- SVG normalized ID becomes vector-map-editor
144+
145+
## Validation
146+
Run:
147+
- `node --check "tools/Workspace Manager/main.js"`
148+
- `node --check tools/shared/toolRegistry.js`
149+
- `node --check "tools/SVG Asset Studio/main.js"`
150+
151+
Full samples smoke:
152+
- Skip.
153+
- Reason: targeted Workspace Manager registry/tile/click launch mapping fix; full samples smoke takes about 20 minutes and is not required.
154+
155+
## Report
156+
Create:
157+
`docs/dev/reports/pr_11_181_validation.md`
158+
159+
Include:
160+
- where the broken link was found
161+
- files changed
162+
- console proof for SVG click
163+
- targeted validation result
164+
- full smoke skipped reason

0 commit comments

Comments
 (0)