Skip to content

Commit 9501397

Browse files
author
DavidQ
committed
Guard session deletion add workspace save and verify Preview Generator V2 writes through repo handle - PR_26128_033-session-delete-save-and-preview-root-handle
1 parent a7f2934 commit 9501397

12 files changed

Lines changed: 506 additions & 35 deletions
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Playwright Session Delete Save And Preview Root Handle
2+
3+
## Commands
4+
- `node --check tools/workspace-manager-v2/js/WorkspaceManagerV2App.js`
5+
- `node --check tools/workspace-manager-v2/js/services/WorkspaceManagerV2ContextService.js`
6+
- `node --check tools/workspace-manager-v2/js/controls/ManifestMenuControl.js`
7+
- `node --check tools/workspace-manager-v2/js/controls/StatusLogControl.js`
8+
- `node --check tools/session-inspector-v2/js/SessionInspectorV2App.js`
9+
- `node --check tools/preview-generator-v2/PreviewGeneratorV2App.js`
10+
- `node --check tools/preview-generator-v2/PreviewGeneratorV2RepoAccess.js`
11+
- `node --check tests/playwright/tools/WorkspaceManagerV2.spec.mjs`
12+
- `npx playwright test tests/playwright/tools/WorkspaceManagerV2.spec.mjs --project=playwright --workers=1 --reporter=list -g "launches Session Inspector V2 with V2 labels|starts with no active game even when stale session hydration exists|exports manifests and launches tools from fixed Workspace Manager V2 tiles|keeps Preview Generator V2 repo writer after Asset Manager V2 deletes the preview asset entry|guards Workspace Manager V2 Close Workspace with dirty sessions|logs actionable Preview Generator V2 output path resolution failures"`
13+
- `npm run test:workspace-v2`
14+
- `git diff --check`
15+
16+
## Results
17+
- JavaScript syntax checks: passed.
18+
- Focused Workspace V2 coverage: passed 6/6 after the palette fixture correction.
19+
- Workspace Manager V2 suite: passed 19/19.
20+
- Diff whitespace check: passed.
21+
22+
## Targeted Coverage
23+
- Verified Session Inspector V2 per-tile Delete removes one key and logs it.
24+
- Verified Session Inspector V2 Delete All removes displayed keys and logs individual removals plus the summary.
25+
- Verified Close Workspace warns and does not close when a dirty tool session exists.
26+
- Verified Save persists dirty session data into the Workspace Manager V2 session context and marks the dirty session clean.
27+
- Verified Close Workspace clears workspace session data only after dirty sessions are clean.
28+
- Verified Close Workspace logs each removed workspace session key.
29+
- Verified Preview Generator V2 logs repo handle presence and handle root name.
30+
- Verified Preview Generator V2 resolves `games/Asteroids/assets/images` through the repo handle.
31+
- Verified missing folder checks report handle-root-relative resolution details.
32+
- Verified `OK WRITE` appears only after handle read-back verification passes.
33+
34+
## Skipped
35+
- Full samples smoke test was skipped by request. The required session deletion, Save/Close, and Preview Generator handle-root behavior is covered by `tests/playwright/tools/WorkspaceManagerV2.spec.mjs`.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Session Delete Save And Preview Root Handle
2+
3+
## Scope
4+
- Added Workspace Manager V2 `Save` and `Close Workspace` controls.
5+
- Restricted Workspace Manager V2 session deletion to the explicit `Close Workspace` path.
6+
- Preserved Session Inspector V2 per-entry Delete and Delete All deletion behavior.
7+
- Updated Session Inspector V2 Delete All to log each removed key before the summary.
8+
- Updated Preview Generator V2 repo handle diagnostics and handle-based write verification.
9+
10+
## Session Deletion Guardrails
11+
- Workspace Manager V2 lifecycle paths no longer delete normalized `workspace.tools.<tool-id>` keys.
12+
- Workspace Manager V2 Close Workspace checks every normalized `workspace.tools.<tool-id>.dirty` object before clearing workspace session data.
13+
- If any dirty session has `isDirty: true`, Close Workspace logs a visible `WARN` and leaves all session data in place.
14+
- If dirty state is clean and known, Close Workspace clears workspace session data and logs each removed key.
15+
- Session Inspector V2 Delete and Delete All remain explicit user actions and continue to log removed keys.
16+
17+
## Save Behavior
18+
- Save refreshes the active workspace context from normalized tool session data.
19+
- Save persists the refreshed context to the current Workspace Manager V2 session context key.
20+
- Save marks dirty enabled tool sessions clean after the refreshed context is persisted.
21+
- Tool tiles refresh dirty status after Save.
22+
23+
## Preview Generator V2 Root Handle
24+
- Workspace launch now logs:
25+
- repo display label
26+
- repo root path string
27+
- repo FileSystemDirectoryHandle presence
28+
- verified handle root name
29+
- handle resolution for `games/<game>/assets/images`
30+
- Missing folder failures log:
31+
- requested relative folder
32+
- handle root name
33+
- display repoRoot string
34+
- session key used
35+
- Preview Generator V2 now requires handle read-back verification before logging `OK WRITE`.
36+
- When absolute path strings and handle-relative paths differ, both are logged and the mismatch is flagged.
37+
38+
## Guardrails
39+
- No hidden fallback paths were added.
40+
- No direct cross-tool communication was added.
41+
- No sample JSON was modified.
42+
- No roadmap content was modified.
43+
44+
## Skipped
45+
- Full samples smoke test was skipped by request. The changed behavior is covered by Workspace V2 targeted and full Playwright validation.

0 commit comments

Comments
 (0)