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 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.
9
+
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.
19
16
No unrelated files.
20
17
No start_of_day changes.
21
18
22
19
Validation:
23
20
Run npm run test:workspace-v2.
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.
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.
25
23
Do not run full samples smoke test; document skipped reason.
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.
75
+
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.
71
76
72
77
## Playwright Impact
73
78
74
79
Playwright impacted: Yes.
75
80
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.
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.
77
82
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.
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.
79
84
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.
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.
81
86
82
87
## Coverage
83
88
84
89
Playwright V8 coverage report generated by `npm run test:workspace-v2`:
- Fixed normal Return to Workspace navigation so it preserves Workspace Manager V2 active repo/game/toolState state instead of reopening as a missing-handle restore.
6
+
- Workspace Manager V2 now stamps the active hostContextId into history before tool launch and records an explicit return marker.
7
+
- Workspace-launched tools use the return marker to prefer browser history return, preserving the live page state when available.
8
+
- If the browser reloads Workspace Manager on return, the active repo handle is restored from the explicit repo handle cache only for marked return navigation.
9
+
- Direct sessionStorage restores without a return marker still remain read-only until the user picks the repo folder.
10
+
- Return-state logging now reports repo selected, game selected, source binding status, and enabled tool count.
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.
27
+
28
+
## Playwright Coverage
29
+
30
+
Playwright impacted: Yes.
31
+
32
+
Coverage added/updated in `tests/playwright/tools/WorkspaceManagerV2.spec.mjs` validates:
33
+
34
+
- Opening a game, launching Session Inspector V2, and returning keeps Workspace Manager V2 tools enabled.
35
+
- Returning after clean toolState keeps Save disabled and Close enabled.
36
+
- Returning after dirty Palette Manager V2 or Asset Manager V2 changes keeps Save enabled and Close disabled.
37
+
- Returning after Preview Generator V2 preserves the active repo/game/source binding and enabled tool list.
38
+
- Gravity Well and Pong return paths keep their selected game bindings and tools enabled.
39
+
- Direct sessionStorage restore without a return marker still requires repo folder selection before Save/tool launch.
40
+
41
+
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.
42
+
43
+
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 return-state log lines.
`tests/playwright/tools/WorkspaceManagerV2.spec.mjs` is a changed test file and is not collected as browser runtime coverage.
56
+
57
+
## Manual Test
58
+
59
+
1. Open Workspace Manager V2.
60
+
2. Pick the repo folder and select Asteroids.
61
+
3. Launch Session Inspector V2 and click Return to Workspace.
62
+
4. Expected: Asteroids remains selected, Pick Repo Folder remains disabled, workspace tools remain enabled, Save remains disabled, Close remains enabled, and the status log includes return-state repo/game/source/enabled-count lines.
63
+
5. Launch Palette Manager V2, add a swatch, and click Return to Workspace.
64
+
6. Expected: workspace tools remain enabled, Save is enabled, Close is disabled, and the dirty Palette Manager V2 toolState is reflected in the tiles.
65
+
7. Refresh Workspace Manager V2 directly with a hostContextId but without selecting a repo folder.
66
+
8. Expected: Save remains disabled and Workspace Manager V2 requires Pick Repo Folder before Save/tool launch.
0 commit comments