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
When restoring an active game from session context, rebind it to the discovered game.manifest.json source for that game.
11
-
Save must write to the actual game.manifest.json file, not only persisted browser/session context.
12
-
After write, re-read the file and validate that:
13
-
- modified timestamp changed or file content changed
14
-
- saved JSON validates
15
-
- root game.workspace toolState exists
16
-
- expected dirty/clean state was persisted
17
-
If save cannot bind to a real game.manifest.json source, log the exact missing field/source and recovery action.
18
-
Document whether repoPath is used and where.
19
-
Keep scope limited to Workspace Manager V2 save/source binding.
9
+
Fix Workspace Manager V2 restore behavior when no active repo folder handle exists.
10
+
Do not restore/open an active game from sessionStorage as save-capable unless a live repo folder handle is present.
11
+
If sessionStorage has active game context but no live repo folder handle:
12
+
- show restored game details as read-only context only, or clear active game state
13
+
- keep Save disabled
14
+
- require repo folder selection before opening a save-capable game
15
+
- log exact reason and required action
16
+
After repo folder is picked, rebind active game to the real game.manifest.json source.
17
+
Ensure Save writes to the actual file and validates by re-reading after write.
18
+
Keep scope limited to Workspace Manager V2 restore/save binding.
20
19
No unrelated files.
21
20
No start_of_day changes.
22
21
23
22
Validation:
24
23
Run npm run test:workspace-v2.
25
-
Add/update Playwright tests for restored session save binding, actual file write validation, and failure logging when file source is missing.
24
+
Add/update Playwright tests for sessionStorage restore without file handle, Save disabled until repo folder is selected, repo rebind after folder pick, and successful post-save validation.
26
25
Do not run full samples smoke test; document skipped reason.
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.
70
+
Full samples smoke test skipped because this PR is limited to Workspace Manager V2 restore/save binding and does not modify shared sample loading, sample manifests, or broad sample runtime behavior.
67
71
68
72
## Playwright Impact
69
73
70
74
Playwright impacted: Yes.
71
75
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.
76
+
Workspace Manager V2 Playwright now validates sessionStorage restore without a live repo folder handle, Save disabled until a repo folder is selected, active game dropdown locked while restored read-only context is shown, repo rebind after folder pick, successful post-save write/read-back validation, and missing-handle Save recovery logging.
73
77
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.
78
+
Expected pass behavior: restored sessionStorage toolState is read-only until repo selection, Save stays disabled without a live repo handle, repo selection rebinds the active game to `/games/<game>/game.manifest.json`, and Save writes/re-reads the actual manifest file before marking dirty toolState clean.
75
79
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.
80
+
Expected fail behavior: tests fail if restored sessionStorage context becomes save-capable without a live handle, Save writes only browser/session context, repo rebinding is skipped, tool launch is allowed before rebind, or post-save file validation/dirty-clean logging is missing.
77
81
78
82
## Coverage
79
83
80
84
Playwright V8 coverage report generated by `npm run test:workspace-v2`:
Full samples smoke test skipped because this PR is limited to Workspace Manager V2 restore/save binding and does not modify shared sample loading, sample manifests, or broad sample runtime behavior.
21
+
22
+
## Playwright Coverage
23
+
24
+
Playwright impacted: Yes.
25
+
26
+
Coverage added/updated in `tests/playwright/tools/WorkspaceManagerV2.spec.mjs` validates:
27
+
28
+
- Restoring active game/toolState context from sessionStorage without a live repo folder handle.
29
+
- Save remains disabled until repo folder selection supplies a live handle.
30
+
- Repo destination selection remains enabled and active game selection remains locked for restored read-only context.
31
+
- Tool tiles remain blocked before rebind and show the required repo folder state.
32
+
- Repo folder selection rebinds the restored active game to `/games/Asteroids/game.manifest.json`.
33
+
- Save after rebind writes the actual mock repo `game.manifest.json`, re-reads it, validates `root.game.workspace`, and marks dirty toolState clean.
34
+
- Missing-handle Save attempts log the exact missing handle/source and required action without writing browser-only fallback data.
35
+
36
+
Expected pass behavior: restored sessionStorage toolState is read-only until repo selection, Save stays disabled without a live handle, repo selection rebinds the active game to the real manifest source, and Save writes/re-reads the manifest file before clearing dirty state.
37
+
38
+
Expected fail behavior: tests fail if restored sessionStorage context becomes save-capable without a live repo handle, Save writes only persisted browser/session context, repo rebinding is skipped, tool launch is allowed before rebind, or post-save file validation/dirty-clean logging is missing.
-`(93%) tools/workspace-manager-v2/js/controls/ToolTilesControl.js - changed JS file with browser V8 coverage`
44
+
-`(93%) tools/workspace-manager-v2/js/services/WorkspaceManagerV2ContextService.js - changed JS file with browser V8 coverage`
45
+
46
+
`tests/playwright/tools/WorkspaceManagerV2.spec.mjs` is a changed test file and is not collected as browser runtime coverage.
47
+
48
+
## Manual Test
49
+
50
+
1. Open Workspace Manager V2.
51
+
2. Pick the repo folder and select Asteroids.
52
+
3. Launch Palette Manager V2, add a swatch, and return to Workspace Manager V2.
53
+
4. Expected: Workspace Manager V2 restores the Asteroids toolState as read-only, Save is disabled, Pick Repo Folder is enabled, and the status log explains that a live repo folder handle is required.
54
+
5. Pick the repo folder again.
55
+
6. Expected: the status log reports the restored toolState was rebound to `/games/Asteroids/game.manifest.json`; Save is enabled because the toolState is dirty.
56
+
7. Click Save.
57
+
8. Expected: status log shows source binding, saved path, file content/timestamp validation, schema/toolState validation, and dirty/clean validation.
0 commit comments