|
1 | | -# Codex Commands - PR_26130_034-active-game-lifecycle-controls |
| 1 | +# Codex Commands - PR_26130_001-workspace-header-save-validation |
2 | 2 |
|
3 | 3 | ```text |
4 | 4 | codex |
5 | 5 |
|
6 | 6 | Changes: |
7 | | -Create PR_26130_034-active-game-lifecycle-controls. |
| 7 | +Create PR_26130_001-workspace-header-save-validation. |
8 | 8 | Read docs/dev/PROJECT_INSTRUCTIONS.md first. |
9 | | -Limit scope to Workspace Manager V2 / Preview Generator V2 lifecycle controls. |
10 | | -Once a game/tool state is opened, disable repo destination selection and game dropdown. |
11 | | -In Active Game bottom controls, add Save, Close, and Cancel buttons. |
12 | | -Save button must be disabled when dirty is false and enabled when dirty is true. |
13 | | -Close button must be disabled when dirty is true and enabled when dirty is false. |
14 | | -Close clears the active session/toolState variable only when allowed. |
15 | | -Cancel must warn the user that information will be lost when dirty is true, then clear the active session/toolState only after confirmation. |
16 | | -Use toolState terminology in code/docs where applicable. |
17 | | -No silent fallback. |
| 9 | +Remove Workspace header nav buttons that are no longer needed. |
| 10 | +Move Save, Close, and Cancel into the Workspace header nav. |
| 11 | +Fix Save so it writes the active game/toolState file and validates the file after write. |
| 12 | +After Save, log saved path, file size, item/count details, and validation result. |
| 13 | +Investigate whether repoPath is used anywhere. If used, document exact usage in the PR report. If unused, document that finding only. |
| 14 | +Keep scope limited to Workspace Manager V2 / Preview Generator V2 lifecycle and save validation. |
18 | 15 | No unrelated files. |
19 | 16 | No start_of_day changes. |
20 | 17 |
|
21 | 18 | Validation: |
22 | 19 | Run npm run test:workspace-v2. |
23 | | -Add/update Playwright coverage for opened-game control disabling, dirty-state Save/Close state, Close clearing clean state, and Cancel dirty warning. |
| 20 | +Add/update Playwright tests for header Save/Close/Cancel placement, save write verification, dirty-state button behavior, and post-save log details. |
24 | 21 | Do not run full samples smoke test; document skipped reason. |
25 | 22 |
|
26 | 23 | Required reports: |
27 | 24 | Create docs/dev/reports/codex_review.diff. |
28 | 25 | Create docs/dev/reports/codex_changed_files.txt. |
29 | | -Create docs/dev/reports/PR_26130_034-active-game-lifecycle-controls.md. |
| 26 | +Create docs/dev/reports/PR_26130_001-workspace-header-save-validation.md. |
30 | 27 | Update docs/dev/codex_commands.md. |
31 | 28 | Update docs/dev/commit_comment.txt. |
32 | 29 | Produce required repo-structured ZIP under tmp/. |
33 | 30 | ``` |
34 | 31 |
|
35 | | -## Validation Commands |
| 32 | +## Commands Run |
36 | 33 |
|
37 | 34 | ```powershell |
38 | 35 | Get-Content -Path "docs/dev/PROJECT_INSTRUCTIONS.md" |
39 | | -node --check "tools/workspace-manager-v2/js/WorkspaceManagerV2App.js" |
40 | | -node --check "tools/workspace-manager-v2/js/controls/GameSelectorControl.js" |
41 | | -node --check "tools/preview-generator-v2/PreviewGeneratorV2App.js" |
42 | | -node --check "tests/playwright/tools/WorkspaceManagerV2.spec.mjs" |
| 36 | +Get-Content -Path ".codex/skills/repo-build/SKILL.md" |
| 37 | +git status --short |
| 38 | +rg -n "repoPath" tools/workspace-manager-v2 tools/preview-generator-v2 tools/asset-manager-v2 tools/schemas games tests/playwright/tools/WorkspaceManagerV2.spec.mjs |
| 39 | +rg -n "exportWorkspaceManifest|importWorkspaceManifest|onExportManifest|onImportManifest|setExportEnabled|exportManifestButton|importManifest|activeGame(Save|Close|Cancel)Button|workspace-manager-v2__active-game-controls" tools/workspace-manager-v2 tests/playwright/tools/WorkspaceManagerV2.spec.mjs |
| 40 | +npm run test:workspace-v2 |
| 41 | +npm run test:workspace-v2 |
43 | 42 | npm run test:workspace-v2 |
44 | | -npm run codex:review-artifacts |
45 | 43 | ``` |
46 | 44 |
|
47 | | -## Playwright |
48 | | - |
49 | | -Playwright impacted: Yes. |
50 | | - |
51 | | -`npm run test:workspace-v2` validates that opened Workspace Manager V2 game toolState locks repo destination and game selection, Preview Generator V2 workspace launch locks repo/game target controls, dirty toolState enables Save and disables Close, clean toolState disables Save and enables Close, Close clears clean active toolState data, and Cancel warns before discarding dirty toolState data. |
| 45 | +## Validation |
52 | 46 |
|
53 | | -Expected pass behavior: all Workspace Manager V2 Playwright tests pass with no page errors and the lifecycle buttons match dirty state. |
| 47 | +`npm run test:workspace-v2` was attempted once with a 120 second command timeout and was cut off before Playwright returned a result. |
54 | 48 |
|
55 | | -Expected fail behavior: the test fails if repo/game controls remain editable after opening a toolState, Save/Close invert dirty behavior, Close clears dirty data, or Cancel clears dirty data without confirmation. |
| 49 | +`npm run test:workspace-v2` was rerun with a longer timeout and passed: 19 passed. |
56 | 50 |
|
57 | | -## Test Notes |
| 51 | +After removing the now-unreachable import/export app methods, `npm run test:workspace-v2` was run again and passed: 19 passed. |
58 | 52 |
|
59 | | -`npm run test:workspace-v2` passed: 20 passed. |
| 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. |
60 | 54 |
|
61 | | -Full samples smoke test skipped because this PR is limited to Workspace Manager V2 / Preview Generator V2 lifecycle controls and does not modify shared sample loading, sample JSON, or broadly impacted sample runtime behavior. |
| 55 | +## Playwright Coverage |
62 | 56 |
|
63 | | -## Manual Test |
| 57 | +Updated `tests/playwright/tools/WorkspaceManagerV2.spec.mjs` covers: |
64 | 58 |
|
65 | | -1. Open Workspace Manager V2. |
66 | | -2. Pick the repo folder and select Asteroids. |
67 | | -3. Confirm Pick Repo Folder and the game selector are disabled, Save is disabled, Close is enabled, and Cancel is enabled. |
68 | | -4. Launch Palette Manager V2, make a palette edit, and return to Workspace Manager V2. |
69 | | -5. Confirm Save is enabled, Close is disabled, and Cancel warns before discarding dirty toolState data. |
70 | | -6. Save, then confirm Save is disabled and Close is enabled. |
71 | | -7. Close and confirm the active game/toolState clears and repo/game selection can start over. |
| 59 | +- Header Save, Close, and Cancel placement with Import/Export header actions removed. |
| 60 | +- Opened-game disabling for repo destination selection and the game dropdown. |
| 61 | +- Dirty-state lifecycle behavior: Save enabled and Close disabled while dirty; Save disabled and Close enabled after save. |
| 62 | +- Save write verification against the active `game.manifest.json` toolState file. |
| 63 | +- Post-save logs for saved path, file size, toolState item/count details, and validation result. |
| 64 | +- Close clearing clean toolState state. |
| 65 | +- Cancel warning before dirty toolState data is discarded. |
0 commit comments