Skip to content

Commit 54b6a5b

Browse files
committed
Align Achievements with project data and clarify Colors disabled swatches - PR_26159_030-achievements-project-data-alignment & Restore Colors picker viewer and explain unavailable swatches - PR_26159_031-colors-picker-viewer-restore
1 parent 81b6dbb commit 54b6a5b

10 files changed

Lines changed: 263 additions & 98 deletions

docs_build/dev/admin-notes/project-journey/index.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

docs_build/dev/reports/achievements-project-data-alignment-report.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ Project Workspace uses the `project-workspace` server repository source, seeded
2525

2626
Because the Account page did not read from the Project Workspace repository/API boundary, the two surfaces drifted. This PR moves the Build rows into `assets/theme-v2/js/account-achievements.js` and reads them through `createServerRepositoryClient("project-workspace")`.
2727

28+
## Scope Cleanup
29+
30+
The current working tree also removes `docs_build/dev/admin-notes/project-journey/index.txt` because it was accidentally included in the prior PR_26159_030 commit even though Admin Notes and Project Journey notes are unrelated to this PR. No Admin Notes runtime behavior is changed.
31+
2832
## Colors Disabled / Grayed Swatch Explanation
2933

3034
The meaningful disabled subset is picker swatches that are already pinned into Project Swatches. Those swatches are not invalid colors; they are already selected. They are dimmed/disabled by default in Picker Preview so clicking the picker grid adds new swatches instead of toggling already selected ones.
@@ -58,6 +62,7 @@ The checkbox is now labeled `Include already selected swatches`, which describes
5862
| Playwright impacted | PASS | Account Achievements, Project Workspace render, and Palette lanes run. |
5963
| Do not run full samples validation | PASS | Full samples skipped with reason. |
6064
| Produce repo-structured ZIP | PASS | Created under `tmp/PR_26159_030-achievements-project-data-alignment_delta.zip`. |
65+
| Keep PR scope clean | PASS | Removed the out-of-scope `docs_build/dev/admin-notes/project-journey/index.txt` file that was accidentally included in the prior PR_26159_030 commit. |
6166

6267
## Validation Evidence
6368

@@ -72,7 +77,7 @@ Commands run:
7277
- `npx playwright test tests/playwright/tools/PaletteToolMockRepository.spec.mjs` - PASS, 6 passed
7378
- `npx playwright test tests/playwright/account/AchievementsPage.spec.mjs tests/playwright/tools/PaletteToolMockRepository.spec.mjs --workers=1` - PASS, 8 passed and final V8 coverage
7479
- `git diff --check` - PASS
75-
- Active scans for old Achievements mock names, Colors Symbol validation, and old global picker checkbox naming - PASS
80+
- Active scans for old Achievements mock names, Colors Symbol validation, and old global picker checkbox naming - PASS. The text `Picker Preview` remains only as the accordion title, not as the checkbox label.
7681

7782
## Skipped Lanes
7883

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# PR_26159_031 Colors Picker Viewer Restore Report
2+
3+
## Executive Summary
4+
5+
Status: PASS
6+
Playwright impacted: Yes
7+
Full samples validation: Skipped, not impacted.
8+
9+
Colors Picker Preview now renders available picker swatches first and already-in-project picker swatches in a separate bottom section. ROYGBIV was added as a curated Defined Swatch Selector source, and active Colors Symbol validation remains removed.
10+
11+
## Root Cause: Unavailable Picker Swatches
12+
13+
Some picker swatches are unavailable because their normalized RGB value already exists in Project Swatches. The exact rule is `pinnedSwatchForHex(hex)`: compare the generated picker swatch hex against Project Swatches using the first seven normalized hex characters, ignoring alpha.
14+
15+
Unavailable swatches are not unavailable because of contrast/filter rules, missing metadata, or generic disabled picker state. They are RGB duplicates of an existing Project Swatches color.
16+
17+
This PR places available swatches in the top `Available Picker Swatches` section and places duplicates in the bottom `Already in Project` section. The unavailable section preserves the real color, does not use disabled buttons, does not change opacity, and click attempts do not add duplicates. The override checkbox is now named `Include already in Project swatches` and only affects that already-in-project subset.
18+
19+
## Root Cause: Symbol Regression
20+
21+
The returned `Symbol: Enter a symbol for this swatch.` error came from older/stale Colors validation paths where swatches required a one-character symbol. The current active Colors flow is key/hex/name based. Active Colors source no longer has Symbol fields, Symbol validation, or `data-palette-symbol` controls.
22+
23+
This PR also corrected the browser API helper for `validatePaletteSwatchInput` so it forwards the same input, existing-swatches, and options contract used by the server-side palette validation. Add, Update, picker selection, Project Swatches, and `tools.palette-browser.swatches` all operate without Symbol input.
24+
25+
## Requirement Checklist
26+
27+
| Requirement | Status | Evidence |
28+
| --- | --- | --- |
29+
| Read `PROJECT_INSTRUCTIONS.md` first | PASS | Read before implementation. |
30+
| Inspect PR_26159_025 behavior/history | PASS | Inspected commit `1ad83b4c2` and current picker render code. |
31+
| Available picker swatches grouped at top | PASS | Playwright validates `Available Picker Swatches` top group and counts. |
32+
| Unavailable picker swatches grouped at bottom | PASS | Playwright validates `Already in Project` bottom group and counts. |
33+
| Preserve subset unavailable behavior | PASS | Unavailable subset is only RGB duplicates already in Project Swatches. |
34+
| Keep newer Defined Swatch Selector controls/options | PASS | Existing Theme Collection, Palette Type, Variant controls and curated options remain; Playwright iterates all expected collections/types. |
35+
| Add ROYGBIV curated selector option | PASS | Added ROYGBIV collection/type with Red, Orange, Yellow, Green, Blue, Indigo, Violet base swatches; Playwright validates generated names. |
36+
| Report why swatches are unavailable | PASS | Root-cause section above. |
37+
| Report exact bottom-section rule | PASS | `pinnedSwatchForHex(hex)` normalized RGB match against Project Swatches. |
38+
| Do not gray out unavailable swatches | PASS | Unavailable swatches do not use disabled button opacity; Playwright validates opacity remains `1`. |
39+
| Remove red not-allowed cursor behavior | PASS | Unavailable swatches are not disabled and Playwright validates cursor is not `not-allowed`. |
40+
| Unavailable swatches preserve true color | PASS | Playwright validates unavailable color input value matches the generated hex. |
41+
| Unavailable swatches do not add on click | PASS | Playwright clicks unavailable swatch and verifies Project Swatches count stays unchanged. |
42+
| Available swatches add on click | PASS | Playwright clicks available picker swatches and verifies Project Swatches count increases. |
43+
| Remove global enable/disable checkbox behavior | PASS | Old global picker checkbox strings are absent; remaining checkbox only affects already-in-project swatches. |
44+
| Fix Symbol validation error | PASS | Active Symbol validation scan is clean; Add/Update Playwright passes without Symbol field. |
45+
| `tools.palette-browser.swatches` accepts swatches without Symbol | PASS | Repository and UI tests add swatches using key/hex/name payloads with no Symbol input. |
46+
| Validate no console errors | PASS | Palette Playwright captures page errors/console errors and passed. |
47+
| Do not run full samples validation | PASS | Full samples skipped; no sample JSON or shared sample loader changed. |
48+
49+
## Validation Evidence
50+
51+
- `node --check toolbox/colors/colors.js` - PASS
52+
- `node --check toolbox/colors/palette-api-client.js` - PASS
53+
- `node --check tests/playwright/tools/PaletteToolMockRepository.spec.mjs` - PASS
54+
- `npx playwright test tests/playwright/tools/PaletteToolMockRepository.spec.mjs` - PASS, 6 passed
55+
- `git diff --check` - PASS with line-ending warnings only
56+
- Active `rg` scan for Symbol validation/control strings - PASS, no matches
57+
- Active `rg` scan for old global picker checkbox strings - PASS, no matches
58+
59+
## Skipped Lanes
60+
61+
- Full samples validation: skipped because this PR only changes the Colors tool runtime/test path and does not change sample JSON, sample launcher code, or shared sample framework behavior.
62+
- Broad Playwright suite: skipped because targeted Palette Playwright validates the affected picker viewer, Add/Update, validation, and console-error behavior.
63+
64+
## Artifacts
65+
66+
- `docs_build/dev/reports/codex_review.diff`
67+
- `docs_build/dev/reports/codex_changed_files.txt`
68+
- `docs_build/dev/reports/playwright_v8_coverage_report.txt`
69+
- `tmp/PR_26159_031-colors-picker-viewer-restore_delta.zip`

docs_build/dev/reports/coverage_changed_js_guardrail.txt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,8 @@ Missing changed runtime JS files are WARN, not FAIL.
66
Source: Playwright/Chromium built-in V8 coverage from the active Playwright run.
77

88
Changed runtime JS files considered:
9-
(0%) src/dev-runtime/guest-seeds/tool-state-samples.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
10-
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
11-
(0%) src/dev-runtime/persistence/tool-repositories/palette-workspace-repository.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
12-
(84%) toolbox/colors/colors.js - executed lines 1872/1872; executed functions 157/186
9+
(85%) toolbox/colors/colors.js - executed lines 1938/1938; executed functions 165/194
10+
(100%) toolbox/colors/palette-api-client.js - executed lines 19/19; executed functions 4/4
1311

1412
Guardrail warnings:
15-
(0%) src/dev-runtime/guest-seeds/tool-state-samples.js - WARNING: changed runtime JS file missing from coverage; advisory only
16-
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: changed runtime JS file missing from coverage; advisory only
17-
(0%) src/dev-runtime/persistence/tool-repositories/palette-workspace-repository.js - WARNING: changed runtime JS file missing from coverage; advisory only
13+
(100%) none - no changed runtime JS coverage warnings

docs_build/dev/reports/playwright_v8_coverage_report.txt

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,37 +14,26 @@ Note: coverage entries are aggregated across every page/tool where coverageRepor
1414
Exercised tool entry points detected:
1515
(84%) Toolbox Index - exercised 3 runtime JS files
1616
(0%) Tool Template V2 - not exercised by this Playwright run
17-
(71%) Theme V2 Shared JS - exercised 3 runtime JS files
17+
(64%) Theme V2 Shared JS - exercised 2 runtime JS files
1818

1919
Changed runtime JS files covered:
20-
(0%) src/dev-runtime/guest-seeds/tool-state-samples.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
21-
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
22-
(0%) src/dev-runtime/persistence/tool-repositories/palette-workspace-repository.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
23-
(84%) toolbox/colors/colors.js - executed lines 1872/1872; executed functions 157/186
20+
(85%) toolbox/colors/colors.js - executed lines 1938/1938; executed functions 165/194
21+
(100%) toolbox/colors/palette-api-client.js - executed lines 19/19; executed functions 4/4
2422

2523
Files with executed line/function counts where available:
2624
(58%) src/engine/api/server-api-client.js - executed lines 159/159; executed functions 11/19
25+
(64%) assets/theme-v2/js/gamefoundry-partials.js - executed lines 525/525; executed functions 28/44
2726
(64%) assets/theme-v2/js/tool-display-mode.js - executed lines 201/201; executed functions 9/14
28-
(66%) assets/theme-v2/js/gamefoundry-partials.js - executed lines 525/525; executed functions 29/44
2927
(78%) toolbox/tool-registry-api-client.js - executed lines 148/148; executed functions 21/27
30-
(84%) toolbox/colors/colors.js - executed lines 1872/1872; executed functions 157/186
31-
(93%) assets/theme-v2/js/account-achievements.js - executed lines 106/106; executed functions 13/14
28+
(85%) toolbox/colors/colors.js - executed lines 1938/1938; executed functions 165/194
3229
(100%) toolbox/colors/palette-api-client.js - executed lines 19/19; executed functions 4/4
3330

3431
Uncovered or low-coverage changed JS files:
35-
(0%) src/dev-runtime/guest-seeds/tool-state-samples.js - WARNING: uncovered changed runtime JS file; advisory only
36-
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: uncovered changed runtime JS file; advisory only
37-
(0%) src/dev-runtime/persistence/tool-repositories/palette-workspace-repository.js - WARNING: uncovered changed runtime JS file; advisory only
32+
(100%) none - no low-coverage changed runtime JS files
3833

3934
Changed JS files considered:
40-
(0%) src/dev-runtime/guest-seeds/tool-state-samples.js - changed JS file not collected as browser runtime coverage
41-
(0%) src/dev-runtime/persistence/mock-db-store.js - changed JS file not collected as browser runtime coverage
42-
(0%) src/dev-runtime/persistence/tool-repositories/palette-workspace-repository.js - changed JS file not collected as browser runtime coverage
35+
(0%) assets/theme-v2/js/account-achievements.js - changed JS file not collected as browser runtime coverage
4336
(0%) tests/playwright/account/AchievementsPage.spec.mjs - changed JS file not collected as browser runtime coverage
44-
(0%) tests/playwright/tools/AdminDbViewer.spec.mjs - changed JS file not collected as browser runtime coverage
45-
(0%) tests/playwright/tools/LoginSessionMode.spec.mjs - changed JS file not collected as browser runtime coverage
4637
(0%) tests/playwright/tools/PaletteToolMockRepository.spec.mjs - changed JS file not collected as browser runtime coverage
47-
(0%) tests/playwright/tools/ProjectJourneyTool.spec.mjs - changed JS file not collected as browser runtime coverage
48-
(66%) assets/theme-v2/js/gamefoundry-partials.js - changed JS file with browser V8 coverage
49-
(84%) toolbox/colors/colors.js - changed JS file with browser V8 coverage
50-
(93%) assets/theme-v2/js/account-achievements.js - changed JS file with browser V8 coverage
38+
(85%) toolbox/colors/colors.js - changed JS file with browser V8 coverage
39+
(100%) toolbox/colors/palette-api-client.js - changed JS file with browser V8 coverage
Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,37 @@
11
# Testing Lane Execution Report
22

3-
PR: PR_26159_030-achievements-project-data-alignment
3+
PR: PR_26159_031-colors-picker-viewer-restore
44
Generated: 2026-06-08
55
Full samples validation: SKIPPED
66

77
## Summary
88

99
PASS: 7
10-
WARN: 1
10+
WARN: 0
1111
FAIL: 0
12-
SKIP: 1
12+
SKIP: 2
1313

1414
## Executed Lanes
1515

1616
| Lane | Status | Command | Evidence |
1717
| --- | --- | --- | --- |
18-
| Changed JS syntax | PASS | `node --check assets/theme-v2/js/account-achievements.js` | Account Achievements module parses. |
19-
| Colors runtime syntax | PASS | `node --check toolbox/colors/colors.js` | Colors picker subset changes parse. |
20-
| Achievements Playwright syntax | PASS | `node --check tests/playwright/account/AchievementsPage.spec.mjs` | Updated account test parses. |
21-
| Palette Playwright syntax | PASS | `node --check tests/playwright/tools/PaletteToolMockRepository.spec.mjs` | Updated palette test parses. |
22-
| Account Achievements Playwright | PASS | `npx playwright test tests/playwright/account/AchievementsPage.spec.mjs` | 2 passed. Validates Project Workspace project names/statuses, placeholders, old mock names absent, and no console errors. |
23-
| Project Workspace render validation | PASS | `npx playwright test tests/playwright/tools/ProjectWorkspaceMockRepository.spec.mjs -g "Project Workspace creates, opens, and deletes mock projects"` | 1 passed. Validates Project Workspace still renders its project cards/list. |
24-
| Palette / Colors Playwright | PASS | `npx playwright test tests/playwright/tools/PaletteToolMockRepository.spec.mjs` | 6 passed. Validates Add/Update without Symbol, renamed picker checkbox, subset-only disabled behavior, and no console errors. |
25-
| Combined V8 coverage run | PASS | `npx playwright test tests/playwright/account/AchievementsPage.spec.mjs tests/playwright/tools/PaletteToolMockRepository.spec.mjs --workers=1` | 8 passed. Final V8 coverage includes `assets/theme-v2/js/account-achievements.js` and `toolbox/colors/colors.js`. |
26-
| Full Project Workspace spec | WARN | `npx playwright test tests/playwright/tools/ProjectWorkspaceMockRepository.spec.mjs` | 6 passed, 1 unrelated existing Toolbox member-role count expectation failed: expected `Tool Count: 5/38`, current page shows `6/38`. The requested Project Workspace render/list test passed and was rerun directly. |
27-
| Static validation | PASS | `git diff --check`; active `rg` scans for Symbol validation, old Achievements mock names, and picker checkbox labels | No whitespace errors; no active Colors Symbol validation hits; old Achievements mock names are absent from active Achievements source; global picker enable label removed. |
18+
| Colors runtime syntax | PASS | `node --check toolbox/colors/colors.js` | Colors picker grouping, ROYGBIV data, and unavailable handling parse. |
19+
| Colors API helper syntax | PASS | `node --check toolbox/colors/palette-api-client.js` | Validation API contract forwarding parses. |
20+
| Palette Playwright syntax | PASS | `node --check tests/playwright/tools/PaletteToolMockRepository.spec.mjs` | Updated Palette tests parse. |
21+
| Palette / Colors Playwright | PASS | `npx playwright test tests/playwright/tools/PaletteToolMockRepository.spec.mjs` | 6 passed. Validates available/unavailable picker groups, unavailable click blocking, no graying/not-allowed cursor, ROYGBIV, Add/Update without Symbol validation, and no console errors. |
22+
| Runtime V8 coverage | PASS | Palette Playwright afterAll coverage reporter | `docs_build/dev/reports/playwright_v8_coverage_report.txt` includes `toolbox/colors/colors.js` and `toolbox/colors/palette-api-client.js`. |
23+
| Static whitespace validation | PASS | `git diff --check` | No whitespace errors; line-ending warnings only. |
24+
| Targeted string scans | PASS | Active `rg` scans for Symbol validation/control strings and old global picker checkbox strings | No active Colors Symbol validation/control hits and no old global picker checkbox strings. |
2825

2926
## Skipped Lanes
3027

3128
| Lane | Status | Reason |
3229
| --- | --- | --- |
33-
| Full samples validation | SKIP | This PR did not change sample JSON contracts or the shared sample loader/framework. Targeted account, Project Workspace render, Colors, syntax, and static checks covered the impacted surfaces. |
30+
| Full samples validation | SKIP | This PR does not touch sample JSON, sample launcher code, or shared sample framework behavior. |
31+
| Broad Playwright suite | SKIP | Targeted Palette Playwright covers the changed Colors runtime/UI behavior and console-error assertions. |
3432

3533
## Notes
3634

37-
- The unrelated untracked folder `docs_build/dev/admin-notes/project-journey/` was present before this PR work and was not touched or packaged.
38-
- Playwright V8 coverage was generated at `docs_build/dev/reports/playwright_v8_coverage_report.txt`.
35+
- The unavailable picker swatch rule is normalized RGB duplicate detection against Project Swatches via `pinnedSwatchForHex(hex)`.
36+
- Unavailable picker swatches are not disabled buttons, so their color and cursor remain normal while click handling prevents duplicate adds.
37+
- Existing local test-server output still prints SQLite experimental warnings and seed-only audit fallback diagnostics; targeted Playwright assertions passed.

0 commit comments

Comments
 (0)