Skip to content

Commit 2f9b715

Browse files
committed
Restore DB source palettes and remove user colors on unpin - PR_26156_173-palette-source-list-and-unpin-delete
1 parent 97243c2 commit 2f9b715

9 files changed

Lines changed: 1179 additions & 75 deletions

assets/theme-v2/css/forms.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ input[type="color"][data-palette-swatch-size="large"] {
179179
border-radius: var(--radius-pill);
180180
background: var(--red);
181181
box-shadow: var(--shadow-sm);
182-
pointer-events: none
182+
cursor: pointer;
183+
pointer-events: auto
183184
}
184185

185186
.palette-swatch-tile[data-palette-pinned="true"] .palette-swatch-pin {

docs_build/dev/reports/coverage_changed_js_guardrail.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ 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-
(86%) toolbox/colors/palette-workspace-repository.js - executed lines 1073/1073; executed functions 102/118
10-
(93%) toolbox/colors/colors.js - executed lines 717/717; executed functions 71/76
9+
(86%) toolbox/colors/palette-workspace-repository.js - executed lines 1103/1103; executed functions 107/124
10+
(95%) toolbox/colors/colors.js - executed lines 745/745; executed functions 74/78
11+
(100%) toolbox/colors/palette-source-mock-db.js - executed lines 927/927; executed functions 6/6
1112

1213
Guardrail warnings:
1314
(100%) none - no changed runtime JS coverage warnings
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# PR_26156_173 Palette Source List And Unpin Delete Report
2+
3+
## Result
4+
PASS
5+
6+
## Scope Completed
7+
- Restored Palette Tool source palette records through mock DB rows only.
8+
- Added DB-backed source groups for 8, 16, 24, 32, 48, 64, 96, 120, 150, W3C, and JavaScript palettes.
9+
- Kept `DEFAULT_SOURCE_PALETTES` removed and did not restore a default palette source.
10+
- Added a visible diagnostic for the case where source records exist but no valid dropdown option can render.
11+
- Updated active Palette Colors pin click behavior to remove the clicked color from the active user palette.
12+
- Ensured active user palette removal updates the mock DB `palette_colors` table, count, and selected state.
13+
- Ensured active user palette removal does not remove source palette records.
14+
- Kept source pinning duplicate-safe.
15+
16+
## Implementation Notes
17+
- Source palette records are provided by `toolbox/colors/palette-source-mock-db.js` and loaded by `createPaletteToolMockDbTables()`.
18+
- Source labels come from mock DB records, so dropdown labels render as `8-color set`, `16-color set`, `32-color set`, `W3C`, and `JavaScript`.
19+
- Palette options sort by label with numeric-aware ordering.
20+
- `repository.removeSwatch(symbol)` removes a specific active palette color and clears selection when the removed color was selected.
21+
- The active palette pin indicator now receives pointer events through the existing reusable Theme V2 swatch pin pattern.
22+
23+
## Validation
24+
- Targeted Palette Tool runtime/UI lane: PASS.
25+
- Changed-file JavaScript syntax checks: PASS.
26+
- Static validation lane: PASS.
27+
- `DEFAULT_SOURCE_PALETTES` active target check: PASS, no matches.
28+
- Playwright V8 coverage artifact refreshed: PASS.
29+
- Full samples smoke: SKIP per BUILD instruction.
30+
31+
## Manual Validation Steps
32+
1. Open `toolbox/colors/index.html`.
33+
2. Confirm Source Palette Browser dropdown lists DB-backed `8-color set`, `16-color set`, `32-color set`, larger sets, `W3C`, and `JavaScript`.
34+
3. Select `8-color set`, filter for `black`, and click `Pin All`.
35+
4. Confirm Palette Colors count becomes `1` and Black appears once.
36+
5. Click `Pin All` again and confirm the count stays `1`.
37+
6. Click the pin indicator on the active Black swatch.
38+
7. Confirm Black is removed from Palette Colors, count returns to `0`, selected summary shows `None`, and source swatches still render.
39+
8. Open `toolbox/colors/index.html?source=invalid` and confirm the visible source-record diagnostic appears.
40+
41+
## Out Of Scope
42+
- Full samples smoke was not run.
43+
- Archived V1/V2 files were not modified.
44+
- `start_of_day` folders were not modified.

docs_build/dev/reports/playwright_v8_coverage_report.txt

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,29 @@ Note: entry percentages use function coverage when available, otherwise line cov
1212
Note: coverage entries are aggregated across every page/tool where coverageReporter.start(page) and coverageReporter.stop(page) ran.
1313

1414
Exercised tool entry points detected:
15-
(84%) Toolbox Index - exercised 4 runtime JS files
15+
(85%) Toolbox Index - exercised 5 runtime JS files
1616
(0%) Tool Template V2 - not exercised by this Playwright run
1717
(83%) Theme V2 Shared JS - exercised 2 runtime JS files
1818

1919
Changed runtime JS files covered:
20-
(86%) toolbox/colors/palette-workspace-repository.js - executed lines 1073/1073; executed functions 102/118
21-
(93%) toolbox/colors/colors.js - executed lines 717/717; executed functions 71/76
20+
(86%) toolbox/colors/palette-workspace-repository.js - executed lines 1103/1103; executed functions 107/124
21+
(95%) toolbox/colors/colors.js - executed lines 745/745; executed functions 74/78
22+
(100%) toolbox/colors/palette-source-mock-db.js - executed lines 927/927; executed functions 6/6
2223

2324
Files with executed line/function counts where available:
2425
(65%) toolbox/project-workspace/project-workspace-mock-repository.js - executed lines 402/402; executed functions 20/31
2526
(75%) toolbox/toolRegistry.js - executed lines 1754/1754; executed functions 27/36
2627
(80%) assets/theme-v2/js/gamefoundry-partials.js - executed lines 205/205; executed functions 16/20
27-
(86%) toolbox/colors/palette-workspace-repository.js - executed lines 1073/1073; executed functions 102/118
28+
(86%) toolbox/colors/palette-workspace-repository.js - executed lines 1103/1103; executed functions 107/124
2829
(87%) assets/theme-v2/js/tool-display-mode.js - executed lines 201/201; executed functions 13/15
29-
(93%) toolbox/colors/colors.js - executed lines 717/717; executed functions 71/76
30+
(95%) toolbox/colors/colors.js - executed lines 745/745; executed functions 74/78
31+
(100%) toolbox/colors/palette-source-mock-db.js - executed lines 927/927; executed functions 6/6
3032

3133
Uncovered or low-coverage changed JS files:
3234
(100%) none - no low-coverage changed runtime JS files
3335

3436
Changed JS files considered:
3537
(0%) tests/playwright/tools/PaletteToolMockRepository.spec.mjs - changed JS file not collected as browser runtime coverage
3638
(86%) toolbox/colors/palette-workspace-repository.js - changed JS file with browser V8 coverage
37-
(93%) toolbox/colors/colors.js - changed JS file with browser V8 coverage
39+
(95%) toolbox/colors/colors.js - changed JS file with browser V8 coverage
40+
(100%) toolbox/colors/palette-source-mock-db.js - changed JS file with browser V8 coverage

docs_build/dev/reports/testing_lane_execution_report.md

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
1-
# PR_26156_172 Testing Lane Execution Report
1+
# PR_26156_173 Testing Lane Execution Report
22

33
## Result
44
PASS
55

66
## Commands Run
7-
- `node --check toolbox\colors\palette-workspace-repository.js`
7+
- `node --check toolbox/colors/palette-source-mock-db.js`
88
- PASS
9-
- `node --check toolbox\colors\colors.js`
9+
- `node --check toolbox/colors/palette-workspace-repository.js`
1010
- PASS
11-
- `node --check tests\playwright\tools\PaletteToolMockRepository.spec.mjs`
11+
- `node --check toolbox/colors/colors.js`
1212
- PASS
13-
- `rg -n "DEFAULT_SOURCE_PALETTES|DEFAULT_SOURCE_PALETTE_LABELS|SOURCE_PALETTES|paletteList" toolbox/colors tests/playwright/tools/PaletteToolMockRepository.spec.mjs`
13+
- `node --check tests/playwright/tools/PaletteToolMockRepository.spec.mjs`
14+
- PASS
15+
- `rg "DEFAULT_SOURCE_PALETTES" toolbox/colors tests/playwright/tools/PaletteToolMockRepository.spec.mjs`
1416
- PASS, no matches
15-
- `node .\node_modules\@playwright\test\cli.js test --project=playwright --workers=1 --reporter=list --grep "Palette (repository|Tool)"`
17+
- `node --input-type=module -e "import('./toolbox/colors/palette-workspace-repository.js').then(({createProjectWorkspacePaletteRepository})=>{ const repo=createProjectWorkspacePaletteRepository(); console.log(repo.sourcePaletteOptions().map((option)=>option.label + ' (' + option.swatchCount + ')').join('|')); })"`
18+
- PASS, source options include `8-color set`, `16-color set`, `24-color set`, `32-color set`, `48-color set`, `64-color set`, `96-color set`, `120-color set`, `150-color set`, `JavaScript`, and `W3C`
19+
- `npx playwright test tests/playwright/tools/PaletteToolMockRepository.spec.mjs --project=playwright --workers=1 --reporter=list`
1620
- PASS, 3 tests
1721
- `npm run test:playwright:static`
1822
- PASS
@@ -22,24 +26,24 @@ PASS
2226
- Changed-file/static validation: PASS.
2327

2428
## Playwright Coverage
25-
- Selected Palette Colors swatch is visibly indicated: PASS.
26-
- Selected state is separate from pinned state: PASS.
27-
- Selected swatch does not rely only on color because it uses a ring/border and glow treatment: PASS.
28-
- Harmony results render as swatches: PASS.
29-
- Harmony results do not render as text-only `Scheme N: #HEX (Source)` lines: PASS.
30-
- Harmony swatches expose scheme and generated hex through title and accessible label: PASS.
31-
- Add Selected works after choosing a harmony swatch: PASS.
32-
- Add All still works from rendered harmony swatches: PASS.
33-
- Swatch-only list rendering, upper-right pin, hover glow, and native browser `title` tooltip remain covered: PASS.
34-
- Harmony controls and Add Selected action remain covered: PASS.
29+
- DB-backed source palette dropdown lists required mock DB palettes: PASS.
30+
- Source palette records render visible swatches: PASS.
31+
- Empty source table shows `No source palette`: PASS.
32+
- Invalid source records with no dropdown options show visible diagnostic: PASS.
33+
- Pin from Source Palette Browser adds to active Palette Colors: PASS.
34+
- Repeat pinning does not duplicate an existing active palette color: PASS.
35+
- Clicking the active Palette Colors pin indicator removes that color only from the active user palette: PASS.
36+
- Palette Colors count updates after add/remove: PASS.
37+
- Selected state clears when selected color is removed: PASS.
38+
- Source palette records remain available after active color removal: PASS.
3539

3640
## Impacted Lane
3741
- Palette Tool runtime/UI lane.
38-
- Theme V2 static validation for reusable swatch selected-state styling.
42+
- Theme V2 static validation for the reusable swatch pin interaction target.
3943

4044
## Skipped Lanes
4145
- Full samples smoke was skipped by BUILD instruction.
42-
- Broader tool lanes were skipped because the Theme V2 change is a swatch modifier covered in the Palette Tool consumer lane plus static validation.
46+
- Broader tool lanes were skipped because changes are confined to Palette Tool runtime/mock DB behavior, one reusable Theme V2 swatch pin interaction, and the targeted Palette Tool spec.
4347

4448
## Not Run
4549
- Full samples smoke was not run, per BUILD instruction.

0 commit comments

Comments
 (0)