Skip to content

Commit 7923226

Browse files
committed
Restore Colors toolbox entry and add curated palette swatches - PR_26159_024-colors-toolbox-admin-visibility
1 parent 08958dd commit 7923226

5 files changed

Lines changed: 690 additions & 1004 deletions

File tree

Lines changed: 40 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,57 @@
1-
# PR_26159_024 Colors Toolbox Admin Visibility Report
1+
# PR_26159_024-colors-toolbox-admin-visibility Report
22

3-
Playwright impacted: Yes
3+
## Summary
44

5-
## Source Context
5+
Implemented the corrected Colors toolbox/admin visibility request:
66

7-
- PASS: Read `docs_build/dev/PROJECT_INSTRUCTIONS.md`.
8-
- PASS: Used the color palette conversation notes in `docs_build/dev/admin-notes/colos.txt` as source context. Relevant notes include the requested center section names (`Selected Swatches`, `Defined Swatch Selector`, `Swatch Type / Theme`) and generator concepts for palette type, colors, steps, contrast, saturation, hue shift, ROYGBIV, monochrome, and dynamic swatch resizing.
7+
- Restored Colors as a Ready toolbox item.
8+
- Preserved Admin unfiltered toolbox visibility and non-admin Ready-tool filtering.
9+
- Reworked Colors controls so Defined Swatch Selector owns Theme Collection, Palette Type, and Variant.
10+
- Reworked Swatch Type / Theme so it owns Colors, Steps, Contrast, Saturation, Hue Shift, Generate, and Reset only.
11+
- Removed the retired source selector UI entries and source selector controls from the Colors page.
12+
- Added curated base swatch arrays for every requested Theme Collection + Palette Type.
13+
- Moved the generated swatch grid into Selected Swatches and made it update live from dropdown/slider changes.
914

1015
## Requirement Checklist
1116

1217
| Requirement | Status | Evidence |
1318
| --- | --- | --- |
14-
| Add Colors back to `toolbox/index.html` using existing registration/list pattern. | PASS | `toolbox/toolRegistry.js` marks Colors `Ready`, `active`, and `visibleInToolsList`; `tests/playwright/tools/RootToolsFutureState.spec.mjs` expects Colors in the default Ready toolbox list. |
15-
| Admin role shows all toolbox tools with no filtering. | PASS | `toolbox/tools-page-accordions.js` reads `getSessionCurrent()` and bypasses creator/status filtering only for authenticated admin sessions; `ToolboxRoutePages.spec.mjs` asserts Admin sees Colors and non-Ready Fonts. |
16-
| Preserve non-admin filtering. | PASS | `ToolboxRoutePages.spec.mjs` asserts a normal user sees Ready Colors/Assets and still does not see non-Ready Fonts. |
17-
| Colors layout preserves left setup/input, center work surface, right output/status/logging. | PASS | `toolbox/colors/index.html` keeps the existing three-column `tool-workspace`; generator controls are in the left panel and preview is in the center panel. |
18-
| Center sections named Selected Swatches, Defined Swatch Selector, Swatch Type / Theme. | PASS | `toolbox/colors/index.html`; `PaletteToolMockRepository.spec.mjs` asserts all three section summaries. |
19-
| Palette Type dropdown has requested options. | PASS | `toolbox/colors/index.html`; `PaletteToolMockRepository.spec.mjs` asserts all option labels. |
20-
| Colors dropdown has requested values. | PASS | `toolbox/colors/index.html`; `PaletteToolMockRepository.spec.mjs` asserts all option labels. |
21-
| Steps dropdown has requested values. | PASS | `toolbox/colors/index.html`; `PaletteToolMockRepository.spec.mjs` asserts all option labels. |
22-
| Contrast, Saturation, Hue Shift sliders render with requested ranges/defaults. | PASS | `toolbox/colors/index.html`; `PaletteToolMockRepository.spec.mjs` asserts defaults and live updates. |
23-
| Generate and Reset buttons render. | PASS | `toolbox/colors/index.html`; `PaletteToolMockRepository.spec.mjs` clicks both controls and asserts status/reset results. |
24-
| Full means ROYGBIV. | PASS | `toolbox/colors/colors.js` uses `FULL_PALETTE_ANCHORS`; `PaletteToolMockRepository.spec.mjs` asserts Red, Orange, Yellow, Green, Blue, Indigo, Violet for the default Full row. |
25-
| Colors controls columns and Steps controls rows. | PASS | `toolbox/colors/colors.js` renders row and column data attributes; Playwright asserts row and swatch counts after control changes. |
26-
| Preview grid uses 100% available preview space and swatches shrink. | PASS | Reusable Theme V2 CSS in `assets/theme-v2/css/forms.css`; Playwright compares swatch bounding boxes before/after increasing rows/columns. |
27-
| Do not force top white or bottom black; generate useful tints/shades. | PASS | `generatorLightness()` clamps lightness away from 0/100; Playwright asserts top row is not all `#FFFFFF` and bottom row is not all `#000000`. |
28-
| Contrast 0/100 control light/dark distance without pure black/white. | PASS | `generatorLightness()` maps contrast to bounded lightness distance. |
29-
| Monochrome is its own Palette Type. | PASS | Dropdown includes `Monochrome`; generator has separate monochrome branch. |
30-
| Monochrome supports Warm Gray, Neutral Gray, Cool Gray, Blue Gray. | PASS | `MONOCHROME_FAMILIES` in `toolbox/colors/colors.js`; Playwright asserts all four families. |
31-
| Dropdown/slider changes update preview live. | PASS | `change`/`input` listeners in `toolbox/colors/colors.js`; Playwright changes hue shift and asserts first swatch color changes. |
32-
| Reset restores selected Palette Type defaults. | PASS | `resetPaletteGeneratorControls()` restores Contrast 40, Saturation 100, Hue Shift 0 without changing palette type/colors/steps. |
33-
| No inline script/style/event handlers. | PASS | Static scan: `rg -n "<script\\b(?![^>]*\\bsrc=)|<style\\b|\\sstyle=|\\son[a-z]+=" toolbox/colors/index.html -P` returned no matches. |
34-
| All JS/CSS external; no page-local CSS. | PASS | JS remains `toolbox/colors/colors.js`; reusable preview CSS was added to `assets/theme-v2/css/forms.css` as a Theme V2 palette-preview gap. |
35-
| Do not run full samples validation. | PASS | Full samples smoke skipped because no sample JSON or shared sample loader/framework changed. |
19+
| Read `docs_build/dev/PROJECT_INSTRUCTIONS.md` first | PASS | Read before edits. |
20+
| Restore Colors on `toolbox/index.html` | PASS | `toolbox/toolRegistry.js` keeps Colors `status: "Ready"` and `visibleInToolsList: true`; `ToolboxRoutePages.spec.mjs` passed creator/Admin visibility assertions. |
21+
| Admin role shows all tools unfiltered | PASS | `ToolboxRoutePages.spec.mjs` passed: Admin session sees Fonts and Colors; creator sees Colors but not Fonts. |
22+
| Non-admin roles keep existing filtering | PASS | `ToolboxRoutePages.spec.mjs` passed creator filtering assertions. |
23+
| Remove old color selector entries | PASS | Colors page no longer renders source selector/search/pin controls; static `rg` found no retired `color-xxx` selector tokens in touched Colors UI/spec files. |
24+
| Defined Swatch Selector owns Theme Collection, Palette Type, Variant | PASS | `toolbox/colors/index.html`; Palette Playwright validates the three controls in that section. |
25+
| Swatch Type / Theme owns only Colors, Steps, sliders, Generate, Reset | PASS | `toolbox/colors/index.html`; Palette Playwright validates control placement. |
26+
| Define curated base swatch arrays for every requested Theme Collection + Palette Type | PASS | `toolbox/colors/colors.js` `CURATED_PALETTE_COLLECTIONS`; Palette Playwright iterates every collection/type and verifies swatches render. |
27+
| Do not add options unless matching swatches exist | PASS | Dropdowns are generated from `CURATED_PALETTE_COLLECTIONS`; extra Sci-Fi `Space Station` was removed; Playwright asserts requested Sci-Fi type list only. |
28+
| Full variant uses curated base swatches | PASS | Preview interpolation reads selected `paletteType.swatches`; Full is the default no-transform variant. |
29+
| Reduced/theme variants generate from curated base swatches | PASS | Numeric variants set the Colors count; all variant transforms start from selected curated swatches. |
30+
| Selected Swatches shows actual generated grid | PASS | Preview container is under `[data-palette-project-accordion]`; Playwright asserts the generator accordion has no preview. |
31+
| Tints/shades avoid pure white/black extremes | PASS | Palette Playwright asserts top row lacks `#FFFFFF` and bottom row lacks `#000000`. |
32+
| Grid fills preview area and swatches shrink as count grows | PASS | Reused `palette-generator-preview` CSS; Playwright verifies swatch bounding boxes shrink from 8x8 to 16x16. |
33+
| Dropdown and slider changes update preview live | PASS | Playwright changes Hue Shift, Theme Collection, Palette Type, Variant, Colors, Steps, Contrast, Saturation and observes preview/status updates. |
34+
| No inline script/style/event handlers | PASS | Static `rg` check on `toolbox/colors/index.html` found no inline script/style/event-handler matches. |
35+
| Playwright impacted | PASS | Targeted Palette Tool, Toolbox route/admin visibility, and Workspace V2 lanes ran. |
3636

3737
## Validation
3838

39-
| Command / Lane | Status | Evidence |
40-
| --- | --- | --- |
41-
| `node --check toolbox/colors/colors.js; node --check toolbox/tools-page-accordions.js; node --check toolbox/toolRegistry.js; node --check tests/playwright/tools/PaletteToolMockRepository.spec.mjs; node --check tests/playwright/tools/ToolboxRoutePages.spec.mjs; node --check tests/playwright/tools/RootToolsFutureState.spec.mjs` | PASS | Changed-file syntax checks passed. |
42-
| `npx playwright test tests/playwright/tools/PaletteToolMockRepository.spec.mjs --project=playwright --timeout=180000` | PASS | 5 passed; validates Colors page runtime, generator controls, live preview, no console/page failures. |
43-
| `npx playwright test tests/playwright/tools/ToolboxRoutePages.spec.mjs --project=playwright` | PASS | 2 passed; validates tool route pages and Admin/non-admin toolbox visibility. |
44-
| `npm run test:workspace-v2` | PASS | 5 passed in `RootToolsFutureState.spec.mjs`; validates workspace-contract/toolbox surface expectations. |
45-
| `git diff --check` | PASS | No whitespace errors; line-ending warnings only. |
46-
| Static inline scan | PASS | No inline script/style/event handlers in `toolbox/colors/index.html`. |
47-
| Static browser import boundary scan | PASS | No touched Colors/toolbox browser file imports `src/dev-runtime`, mock repositories, `mock-db-store`, or static `toolRegistry.js` directly beyond the existing API client path. |
39+
| Command | Result |
40+
| --- | --- |
41+
| `node --check toolbox/colors/colors.js; node --check toolbox/toolRegistry.js; node --check tests/playwright/tools/PaletteToolMockRepository.spec.mjs; node --check tests/playwright/tools/ToolboxRoutePages.spec.mjs; node --check tests/playwright/tools/RootToolsFutureState.spec.mjs` | PASS |
42+
| `npx playwright test tests/playwright/tools/PaletteToolMockRepository.spec.mjs --project=playwright --timeout=180000` | PASS, 5/5 tests |
43+
| `npx playwright test tests/playwright/tools/ToolboxRoutePages.spec.mjs --project=playwright` | PASS, 2/2 tests |
44+
| `npm run test:workspace-v2` | PASS on rerun, 5/5 workspace-contract tests |
45+
| `git diff --check` | PASS |
46+
| `rg -n "<script\\b(?![^>]*\\bsrc=)&#124;<style\\b&#124;\\sstyle=&#124;\\son[a-z]+=" toolbox/colors/index.html -P` | PASS, no matches |
47+
| `rg -n "8-color set&#124;16-color set&#124;32-color set&#124;64-color set&#124;128-color set&#124;palette-colors008&#124;palette-colors016&#124;palette-colors032&#124;palette-colors064&#124;palette-colors128&#124;Monochrome" toolbox/colors/index.html toolbox/colors/colors.js tests/playwright/tools/PaletteToolMockRepository.spec.mjs` | PASS, no matches |
4848

4949
## Skipped Lanes
5050

51-
- Full samples validation: SKIP, no sample JSON or shared sample loader/framework changed.
52-
- Admin DB Viewer / login / Local DB lanes: SKIP, this PR did not touch admin DB viewer, login/session mode UI, persistence adapters, or DB routes.
53-
- Asset Tool runtime lane: SKIP, Asset Tool behavior was not modified.
51+
- Full samples validation: SKIP. The PR does not modify sample JSON or shared sample loader/framework behavior.
52+
- Broad full-suite Playwright: SKIP. Targeted Palette Tool, Toolbox visibility, and Workspace V2 lanes cover the touched behavior.
5453

5554
## Notes
5655

57-
- Early parallel Playwright attempts were discarded because multiple Playwright commands wrote to the same `tmp/test-results` artifact folder at once. Final validation was rerun sequentially and passed.
58-
- The only new CSS is reusable Theme V2 palette generator preview CSS in `assets/theme-v2/css/forms.css`; no page-local CSS was added.
56+
- A first `npm run test:workspace-v2` attempt hit a Playwright artifact/tracing ENOENT timeout. A direct workspace spec rerun passed 5/5, then the exact `npm run test:workspace-v2` command passed 5/5 on rerun.
57+
- No `start_of_day` files were modified.

0 commit comments

Comments
 (0)