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
Full samples smoke test skipped because this PR is limited to Workspace Manager V2 save/source binding and does not modify shared sample loading, sample manifests, or broad runtime sample behavior.
67
+
68
+
## Playwright Impact
69
+
70
+
Playwright impacted: Yes.
48
71
49
-
`npm run test:workspace-v2` was rerun with a longer timeout and passed: 19 passed.
72
+
Workspace Manager V2 Playwright now validates restored-session Save rebinding to the discovered `game.manifest.json` source, actual file write/read-back validation, dirty payload persistence with clean toolState marking after Save, and exact recovery logging when a real file source cannot be bound.
50
73
51
-
After removing the now-unreachable import/export app methods, `npm run test:workspace-v2` was run again and passed: 19 passed.
74
+
Expected pass behavior: Save writes the active toolState to the real `game.manifest.json`, re-reads the file, validates `game.workspace`, logs write/source validation, and marks dirty toolState keys clean.
52
75
53
-
Full samples smoke test skipped because this PR is limited to Workspace Manager V2 / Preview Generator V2 lifecycle controls and save validation, and does not modify sample manifests broadly, shared sample loading, or runtime sample smoke behavior.
76
+
Expected fail behavior: the test fails if Save only updates browser/session context, loses the restored game manifest source, accepts an unchanged file, omits `game.workspace`, fails to mark toolState clean, or silently falls back when the file source is missing.
- Added Workspace Manager V2 save source rebinding so restored session context can bind back to the real discovered `game.manifest.json` source before Save writes.
6
+
- Save now writes through the active game manifest file handle, then re-reads the file and verifies content/timestamp change, valid JSON/schema, `root.game.workspace`, and exact saved workspace toolState.
7
+
- Save logs source binding, write validation, schema/toolState validation, and dirty/clean validation.
8
+
- Missing source binding now fails visibly with the exact active source, missing context field/source, and recovery action.
- Final rerun after source-binding recovery log hardening passed: 21 passed.
18
+
19
+
Full samples smoke test skipped because this PR is limited to Workspace Manager V2 save/source binding and does not modify shared sample loading, sample manifests, or broad runtime sample behavior.
20
+
21
+
## Playwright Coverage
22
+
23
+
Playwright impacted: Yes.
24
+
25
+
Coverage added/updated in `tests/playwright/tools/WorkspaceManagerV2.spec.mjs` validates:
26
+
27
+
- Restored session Save rebinds from `sessionStorage:*` active game source to `/games/Asteroids/game.manifest.json`.
28
+
- Save writes the actual mock repo `game.manifest.json` file and re-read validation logs file content changed.
29
+
- Re-read JSON contains `root.game.workspace` and the dirty palette payload that triggered Save.
30
+
- Save marks dirty toolState keys clean after file persistence.
31
+
- Missing file source logs the exact source binding failure and recovery action without writing browser-only fallback data.
32
+
33
+
Expected pass behavior: Save writes the real active game manifest file, re-reads and validates it, logs source/write/schema/dirty-clean validation, and leaves dirty toolState clean.
34
+
35
+
Expected fail behavior: tests fail if Save writes only session context, keeps a `sessionStorage:*` game source, omits `game.workspace`, does not change file content/timestamp, or silently falls back when the repo/file source is missing.
-`tools/workspace-manager-v2/js/services/WorkspaceManagerV2ContextService.js:849`: `contextResultFromManifest` copies `workspaceManifest.repoPath || ""` onto active game metadata as `game.repoPath`.
47
+
-`tools/preview-generator-v2/PreviewGeneratorV2App.js:1449`: workspace launch hydration reads `manifest.repoPath` with `normalizeAbsoluteRepoPath(manifest.repoPath)` when present.
48
+
-`tools/asset-manager-v2/js/services/WorkspaceBridge.js:87`: workspace context extra-field filtering allows `repoPath` as a known root workspace field.
49
+
-`tools/schemas/workspace.manifest.schema.json:49` and `tools/schemas/game.manifest.schema.json:136`: schemas define the `repoPath` field.
50
+
- Current manifests persist `repoPath` in `games/Asteroids/game.manifest.json:27`, `games/GravityWell/game.manifest.json:27`, `games/Pong/game.manifest.json:27`, and `games/_template/workspace-manager-v2-UAT.manifest.json:12`.
51
+
52
+
## Manual Test
53
+
54
+
1. Open Workspace Manager V2.
55
+
2. Pick the repo folder and select Asteroids.
56
+
3. Launch Palette Manager V2, add a swatch, and return to Workspace Manager V2.
57
+
4. Click Save.
58
+
5. Expected: status log shows source binding to the Asteroids `game.manifest.json`, file content/timestamp validation, schema/toolState validation, and dirty/clean validation.
59
+
6. Recovery path check: if Save has no active real repo/file source, expected status log identifies the missing source and instructs the user to cancel active toolState, pick the repo folder again, reopen the game, and retry Save.
0 commit comments