You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix Workspace Manager V2 regression where returning from any tool leaves all workspace tools disabled/gray.
10
-
On return from a tool, preserve the selected repo, selected game, live repo folder handle, active game binding, and enabled tool list.
11
-
Do not treat normal return navigation as Cancel, Close, or lost file handle.
12
-
Only disable tools when no valid opened game/toolState is active or when repo binding is actually missing.
13
-
Add explicit log lines for return-from-tool state restoration: repo selected, game selected, source binding status, enabled tool count.
14
-
Keep Save disabled only when no live writable file handle exists.
15
-
Keep scope limited to Workspace Manager V2 return state and tool enablement regression.
9
+
Fix Preview Generator V2 write verification so SVG writes are verified through the same live repo FileSystemDirectoryHandle provided by Workspace Manager V2.
10
+
Do not treat absolute path string comparison against handle-relative path as a mismatch.
11
+
Normalize path reporting into:
12
+
- repo display label
13
+
- repo root path string
14
+
- handle root name
15
+
- handle-relative output path
16
+
- absolute display path
17
+
After SVG write, verify by re-reading the handle target and logging:
18
+
- file exists
19
+
- file size
20
+
- modified timestamp when available
21
+
- content starts as SVG
22
+
- output path
23
+
- handle-relative path
24
+
If Preview Generator cannot write through the Workspace Manager live repo handle, fail visibly and do not claim OK WRITE.
25
+
Document whether the handle is passed from Workspace Manager or resolved from workspace.repo.reference/session runtime state.
26
+
Keep scope limited to Preview Generator V2 handle/path/write verification.
16
27
No unrelated files.
17
28
No start_of_day changes.
18
29
19
30
Validation:
20
31
Run npm run test:workspace-v2.
21
-
Add/update Playwright test for opening a game, launching a tool, returning to workspace, and verifying tools remain enabled.
22
-
Add/update Playwright test that Save state remains correct after return.
32
+
Add/update Playwright coverage for Preview Generator V2 using Workspace Manager repo handle, SVG write verification, and no false OK WRITE when handle write/read verification fails.
23
33
Do not run full samples smoke test; document skipped reason.
Full samples smoke test skipped because this PR is limited to Workspace Manager V2 return state/tool enablement and does not modify shared sample loading, sample manifests, or broad sample runtime behavior.
75
+
Full samples smoke test skipped because this PR is limited to Preview Generator V2 handle/path/write verification and does not modify shared sample loading, sample manifests, or broad sample runtime behavior.
76
76
77
77
## Playwright Impact
78
78
79
79
Playwright impacted: Yes.
80
80
81
-
Workspace Manager V2 Playwright now validates opening a game, launching workspace tools, returning to Workspace Manager V2, keeping workspace tools enabled, preserving repo/game/source binding, and preserving clean/dirty Save and Close button state after return.
81
+
Workspace Manager V2 Playwright now validates Preview Generator V2 restoring the live Workspace Manager repo handle, writing `preview.svg` through that handle, logging read-back verification details, and failing without `OK WRITE` when handle read-back verification fails.
82
82
83
-
Expected pass behavior: normal Return to Workspace restores the active repo, game, source binding, enabled tool count, and refreshed dirty toolState data without requiring Pick Repo Folder.
83
+
Expected pass behavior: Preview Generator V2 writes and verifies `preview.svg` through the live repo handle, reports handle-relative and absolute display paths separately, and logs file exists/size/modified/SVG-start metadata.
84
84
85
-
Expected fail behavior: tests fail if return navigation drops the live repo handle, grays out tools, enables Save without a live binding, disables Save while dirty after a valid return, or omits the return-state log lines.
85
+
Expected fail behavior: tests fail if Preview Generator V2 falls back to session-only writes, logs a false path mismatch for absolute-vs-handle-relative paths, claims `OK WRITE`after read-back verification fails, or cannot restore the Workspace Manager V2 live repo handle.
86
86
87
87
## Coverage
88
88
89
-
Playwright V8 coverage report generated by `npm run test:workspace-v2`:
89
+
Playwright V8 coverage report generated by `npm run test:workspace-v2` noted changed Preview Generator V2 runtime coverage, including:
- Preview Generator V2 workspace launch now restores the live Workspace Manager V2 repo `FileSystemDirectoryHandle` instead of creating a session-backed synthetic repo writer.
6
+
-`preview.svg` writes are verified by re-reading the live handle target before `OK WRITE` is logged.
7
+
- Write logs now separate repo display label, repo root path string, handle root name, handle-relative output path, and absolute display path.
8
+
- SVG write verification logs file existence, file size, modified timestamp when available, SVG-start detection, output path, and handle-relative path.
9
+
- Absolute display paths are no longer compared directly against handle-relative paths, removing the false path mismatch warning.
10
+
11
+
## Scope
12
+
13
+
Changed only Preview Generator V2 live repo handle restoration/path/write verification and Workspace Manager V2 Playwright coverage for that behavior.
14
+
15
+
No `start_of_day` files were modified.
16
+
17
+
## Handle Source
18
+
19
+
The live handle is resolved from Workspace Manager V2 runtime state, not passed through or serialized inside toolState JSON.
20
+
21
+
Preview Generator V2 reads `workspace.repo.reference`, then restores the matching live repo handle from the Workspace Manager V2 repo handle cache:
`manifest.repoPath` is used for repo root path string and absolute display path reporting. It is not used as the write authority and is not compared as if it were handle-relative.
27
+
28
+
If no live Workspace Manager V2 repo handle can be restored, Preview Generator V2 logs the exact restore failure and required recovery action, leaves generation disabled, and does not claim `OK WRITE`.
Full samples smoke test was skipped because this PR is limited to Preview Generator V2 handle/path/write verification and does not modify shared sample loading, sample manifests, or broad sample runtime behavior.
39
+
40
+
## Playwright Coverage
41
+
42
+
Playwright impacted: Yes.
43
+
44
+
Validated behavior:
45
+
46
+
- Preview Generator V2 restores the Workspace Manager V2 live repo handle through `workspace.repo.reference` plus the runtime handle cache.
47
+
-`preview.svg` writes are performed through the live handle and verified by read-back before `OK WRITE`.
48
+
- Write logs include normalized path fields and SVG verification metadata.
49
+
- Handle-relative output paths are not treated as mismatches against absolute display paths.
50
+
- A forced read-back verification failure logs `FAIL`, records `Failed: 1`, and never logs `OK WRITE`.
51
+
52
+
Expected fail behavior: tests fail if Preview Generator V2 silently falls back to session-only writes, logs `OK WRITE` before successful read-back verification, or resurrects the absolute-vs-handle-relative mismatch warning.
53
+
54
+
## Coverage Notes
55
+
56
+
Runtime JavaScript coverage from `npm run test:workspace-v2` included changed Preview Generator V2 files:
57
+
58
+
-`(88%) tools/preview-generator-v2/PreviewGeneratorV2App.js - changed JS file with browser V8 coverage`
59
+
-`(28%) tools/preview-generator-v2/PreviewGeneratorV2RepoAccess.js - advisory low coverage; cache restore branches include browser API and failure-path guards`
60
+
61
+
`tests/playwright/tools/WorkspaceManagerV2.spec.mjs` is a changed test file and is not collected as browser runtime coverage.
62
+
63
+
## Manual Test
64
+
65
+
1. Open Workspace Manager V2.
66
+
2. Pick the repo folder and open Asteroids.
67
+
3. Launch Preview Generator V2 from the Workspace Manager V2 tool tiles.
68
+
4. Generate the workspace preview.
69
+
5. Expected: status log shows live handle restoration, write read-back verification, normalized path fields, and `OK WRITE Asteroids`.
70
+
6. Expected: no absolute path versus handle-relative path mismatch warning appears.
71
+
72
+
Out of scope: full sample smoke validation. Sample smoke remains skipped until a dedicated sample/runtime validation phase.
0 commit comments