|
| 1 | +# PR_26159_038-colors-picker-preview-behavior Report |
| 2 | + |
| 3 | +## Summary |
| 4 | + |
| 5 | +Implemented the Colors Picker Preview behavior polish from PR_26159_038: |
| 6 | + |
| 7 | +- Picker Preview red pins add swatches to Project Swatches. |
| 8 | +- Picker Preview green pins remove already-added swatches from Project Swatches. |
| 9 | +- Same-column duplicate Hex swatches keep their true color, have no pin, and do not add. |
| 10 | +- Added `Show duplicates` beside the `Available Picker Swatches (xx)` header count. |
| 11 | +- Changed Steps to a numeric spinner where actual rows are `steps * 2 + 1`. |
| 12 | +- Removed Generate because live updates regenerate the preview. |
| 13 | +- Moved Tags to the left column after Picker Swatches. |
| 14 | +- Moved History to the right column before Validation. |
| 15 | +- Moved Restore Grid Picker Settings into the Project Swatches accordion header. |
| 16 | + |
| 17 | +## Requirement Checklist |
| 18 | + |
| 19 | +| Requirement | Status | Evidence | |
| 20 | +| --- | --- | --- | |
| 21 | +| Red pin adds a swatch to Project Swatches | PASS | `toolbox/colors/colors.js` `activateGeneratorPreviewTile`; Playwright test `Palette Tool uses green pins...` and generated-grid test | |
| 22 | +| Green pin removes an already-added swatch | PASS | `toolbox/colors/colors.js` `activateGeneratorPreviewTile`; Playwright test `Palette Tool uses green pins to remove already-added picker swatches` | |
| 23 | +| No pin duplicate does nothing | PASS | `toolbox/colors/colors.js` duplicate availability path; Playwright test `Palette Tool blocks only lower duplicate hexes...` | |
| 24 | +| Picker Preview swatches do not remain selected/boxed after click | PASS | `createGeneratorPreviewInput` always sets `data-palette-selected="false"`; CSS removes preview focus/selected outlines; Playwright asserts no selected state/box after click | |
| 25 | +| Add Show duplicates checkbox beside Available Picker Swatches | PASS | `toolbox/colors/index.html` `data-palette-show-duplicates`; Playwright asserts checked default and hide/show behavior | |
| 26 | +| Available Picker Swatches count is not bold | PASS | `assets/theme-v2/css/accordion.css`; Playwright checks computed font weight | |
| 27 | +| Show duplicates checked shows full grid | PASS | Default checked state plus row-count assertions in targeted Playwright | |
| 28 | +| Show duplicates unchecked hides duplicate-color swatches | PASS | Duplicate Playwright test unchecks control and verifies lower duplicate disappears | |
| 29 | +| Duplicate detection is same-column Hex and keeps top instance | PASS | `duplicatePickerHexReasons`; duplicate Playwright test validates top duplicate addable and lower duplicate blocked | |
| 30 | +| Duplicate swatches do not get pins | PASS | `appendPickerRows` and `createGeneratorPreviewInput`; duplicate Playwright test checks no pin on lower duplicate | |
| 31 | +| Add human-readable Theme display/control where needed | PASS | Existing Theme label/dropdown preserved in left Picker Swatches control table | |
| 32 | +| Contrast, Saturation, Hue Shift on one line | PASS | `toolbox/colors/index.html` grid `cols-3`; Playwright layout assertion | |
| 33 | +| Remove Generate button | PASS | `toolbox/colors/index.html` removed button; `toolbox/colors/colors.js` removed Generate handler; Playwright asserts selector absent | |
| 34 | +| Steps numeric spinner increments by 1 | PASS | `paletteGeneratorSteps` is `type="number"` with `step="1"`; Playwright asserts attributes | |
| 35 | +| Steps means rows above/below center | PASS | `actualPaletteGeneratorRows(steps)` returns `steps * 2 + 1`; Playwright validates `Grid 8 x 3` and row counts | |
| 36 | +| Grid summary uses actual rows | PASS | `renderPaletteGeneratorPreview`; Playwright asserts `Grid 8 x 3` and changed row counts | |
| 37 | +| Generated swatch names use Hex instead of row/column suffix | PASS | `generatorSwatchName`; Playwright asserts Hex present and no `R# C#` suffix | |
| 38 | +| History moved to right column before Validation | PASS | `toolbox/colors/index.html`; Playwright layout assertion with `data-palette-history-accordion` | |
| 39 | +| Tags moved to left column after Picker Swatches | PASS | `toolbox/colors/index.html`; Playwright layout assertion with `data-palette-tags-accordion` | |
| 40 | +| Restore Grid Picker Settings in Project Swatches header anchored right | PASS | `toolbox/colors/index.html`; `assets/theme-v2/css/accordion.css`; Playwright header layout assertion | |
| 41 | +| Preserve Project Swatches and Picker Preview vertical sharing | PASS | Existing `accordion-fill-panel` behavior preserved; Playwright height-sharing assertions pass | |
| 42 | +| Preserve no forced accordion height | PASS | No fixed height added; targeted Playwright vertical sharing assertions pass | |
| 43 | +| Add/Update/Clear show no Symbol validation | PASS | Existing repository and UI tests pass; static scan found no active Colors `Symbol: Enter a symbol` string | |
| 44 | +| No console errors | PASS | `expectNoPageFailures` passed across targeted Palette Tool Playwright lane | |
| 45 | + |
| 46 | +## Validation |
| 47 | + |
| 48 | +| Lane | Result | Evidence | |
| 49 | +| --- | --- | --- | |
| 50 | +| Changed-file syntax | PASS | `node --check toolbox/colors/colors.js`; `node --check tests/playwright/tools/PaletteToolMockRepository.spec.mjs` | |
| 51 | +| Static diff whitespace | PASS | `git diff --check` | |
| 52 | +| Static active-source scan | PASS | Active Colors/runtime scan found no stale Generate handler, old `Colors x Steps`, old active `Already in Project` unavailable logic, or active Symbol validation string. Remaining Generate hits are tests asserting absence. | |
| 53 | +| Targeted Palette/Colors Playwright | PASS | `npx playwright test tests/playwright/tools/PaletteToolMockRepository.spec.mjs` passed 8/8 | |
| 54 | +| Playwright V8 coverage | PASS | `docs_build/dev/reports/playwright_v8_coverage_report.txt` shows `toolbox/colors/colors.js` covered by browser V8 coverage | |
| 55 | + |
| 56 | +## Skipped Lanes |
| 57 | + |
| 58 | +| Lane | Skipped | Reason | |
| 59 | +| --- | --- | --- | |
| 60 | +| Full samples validation | Yes | PR only changes Colors tool behavior, reusable Theme V2 swatch/accordion CSS, and targeted Palette Playwright coverage. No shared sample loader/framework changed. | |
| 61 | +| Full workspace suite | Yes | Existing request says do not run full samples validation; targeted Colors runtime lane covers touched UI/runtime behavior. | |
| 62 | + |
| 63 | +## Notes |
| 64 | + |
| 65 | +- The first targeted Playwright run exposed two implementation/test issues: old layout expectations and physical pointer clicks not synthesizing `click` in the preview grid. The final implementation handles pointer activation directly while preserving click/keyboard activation through the same runtime path. |
| 66 | +- The active branch is `PR_26159_038-colors-picker-preview-behavior`; these changes are not on `main` until committed, pushed, and merged. |
0 commit comments