|
1 | | -# Codex Commands - PR_26126_037-preview-generator-v2-remove-shared-and-consolidate-common |
| 1 | +# Codex Commands - PR_26130_034-active-game-lifecycle-controls |
2 | 2 |
|
3 | | -```bash |
4 | | -codex run "Create PR_26126_037-preview-generator-v2-remove-shared-and-consolidate-common. Fix Preview Generator V2 based on audit findings. Preserve existing behavior exactly. Remove all tools/shared dependencies from Preview Generator V2, consolidate safe repeated CSS declarations into common styles, update Preview Generator V2 to consume those common styles, verify Playwright, do not modify samples, do not add schema, do not modify start_of_day folders, and produce required reports." |
| 3 | +```text |
| 4 | +codex |
| 5 | +
|
| 6 | +Changes: |
| 7 | +Create PR_26130_034-active-game-lifecycle-controls. |
| 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. |
| 18 | +No unrelated files. |
| 19 | +No start_of_day changes. |
| 20 | +
|
| 21 | +Validation: |
| 22 | +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. |
| 24 | +Do not run full samples smoke test; document skipped reason. |
| 25 | +
|
| 26 | +Required reports: |
| 27 | +Create docs/dev/reports/codex_review.diff. |
| 28 | +Create docs/dev/reports/codex_changed_files.txt. |
| 29 | +Create docs/dev/reports/PR_26130_034-active-game-lifecycle-controls.md. |
| 30 | +Update docs/dev/codex_commands.md. |
| 31 | +Update docs/dev/commit_comment.txt. |
| 32 | +Produce required repo-structured ZIP under tmp/. |
5 | 33 | ``` |
6 | 34 |
|
7 | 35 | ## Validation Commands |
8 | 36 |
|
9 | 37 | ```powershell |
10 | | -rg -n "tools/shared|../shared|../../tools/shared|platformShell|shared/" tools/preview-generator-v2 tools/common tests/playwright/PreviewGeneratorV2Baseline.spec.mjs |
11 | | -if ($LASTEXITCODE -eq 1) { Write-Output "no tools/shared references found"; $global:LASTEXITCODE = 0 } |
12 | | -rg -n "<link|<script|import .* from" tools/preview-generator-v2 tools/common tests/playwright/PreviewGeneratorV2Baseline.spec.mjs |
13 | | -
|
14 | | -$files = Get-ChildItem -Path tools/preview-generator-v2 -Recurse -Filter *.js | Select-Object -ExpandProperty FullName |
15 | | -foreach ($file in $files) { |
16 | | - node --check $file |
17 | | - if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } |
18 | | -} |
19 | | -node --check tests/playwright/PreviewGeneratorV2Baseline.spec.mjs |
20 | | -npx playwright test tests/playwright/PreviewGeneratorV2Baseline.spec.mjs --project=playwright --reporter=list |
21 | | -git status --short -- samples tools/schemas start_of_day tests/results |
22 | | -git diff --check -- tools/preview-generator-v2 tools/common tests/playwright docs/dev/codex_commands.md docs/dev/commit_comment.txt docs/dev/reports/preview_generator_v2_shared_removed.txt docs/dev/reports/preview_generator_v2_common_styles_applied.txt docs/dev/reports/preview_generator_v2_playwright_result.txt |
| 38 | +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" |
23 | 43 | npm run test:workspace-v2 |
| 44 | +npm run codex:review-artifacts |
24 | 45 | ``` |
25 | 46 |
|
26 | 47 | ## Playwright |
27 | 48 |
|
28 | | -Playwright validates that Preview Generator V2 launches, the main shell/menu/status controls render, Generate Preview and Stop start disabled, Games is the default target source, a working accordion collapses/reopens, the common stylesheet loads, and the consolidated common style declarations are active. |
| 49 | +Playwright impacted: Yes. |
29 | 50 |
|
30 | | -Expected pass behavior: the targeted Playwright test passes with one launched tool page and no page errors. |
| 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. |
31 | 52 |
|
32 | | -Expected fail behavior: the test fails if the tool cannot load, controls are missing, common styles are not applied, accordion behavior is broken, or page errors are emitted. |
| 53 | +Expected pass behavior: all Workspace Manager V2 Playwright tests pass with no page errors and the lifecycle buttons match dirty state. |
| 54 | + |
| 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. |
33 | 56 |
|
34 | 57 | ## Test Notes |
35 | 58 |
|
36 | | -`npm run test:workspace-v2` is not defined in the current `package.json`. |
| 59 | +`npm run test:workspace-v2` passed: 20 passed. |
37 | 60 |
|
38 | | -## Manual Test |
| 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. |
39 | 62 |
|
40 | | -Open `tools/preview-generator-v2/index.html`, confirm the tool shell looks unchanged, toggle Repo Destination, use Hide Header and Details/Show Header and Details, and confirm Generate Preview remains visible but disabled before required fields are complete. |
| 63 | +## Manual Test |
41 | 64 |
|
42 | | -Full samples smoke test was skipped because this PR does not modify samples or shared sample loading. |
| 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. |
0 commit comments