Skip to content

Commit e2a45e1

Browse files
author
DavidQ
committed
Refactor Palette Manager V2 into class-based controls and centralize read-only palettes in engine palette list - PR_26124_027-palette-manager-clean-class-architecture
1 parent ce31541 commit e2a45e1

20 files changed

Lines changed: 2242 additions & 4821 deletions
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# PR_26124_027 Palette Manager Clean Class Architecture
2+
3+
## Summary
4+
- Rebuilt `tools/palette-manager-v2/main.js` as bootstrap/orchestration only.
5+
- Split Palette Manager behavior into class-based controls:
6+
- `PaletteEditorControl`
7+
- `UserPaletteControl`
8+
- `SourcePaletteBrowserControl`
9+
- `PaletteImportExportControl`
10+
- `PaletteValidationErrorControl`
11+
- Added `tools/common/PaletteUsageService.js` as the reusable swatch usage boundary. It returns `false` and does not scan samples or games.
12+
- Moved source palette authority to `src/engine/paletteList.js` through frozen `SOURCE_PALETTES`.
13+
- Deleted `src/engine/paletteDefaults.js` and confirmed no active runtime references remain.
14+
15+
## Contract Notes
16+
- Runtime tool id remains `palette-manager-v2`.
17+
- Published output key remains `tools.palette-browser`.
18+
- User palette shape remains:
19+
20+
```json
21+
{
22+
"swatches": [
23+
{
24+
"symbol": "R",
25+
"hex": "#FF0000",
26+
"name": "Red",
27+
"source": "user"
28+
}
29+
]
30+
}
31+
```
32+
33+
## Validation
34+
- `node --check` passed for changed Palette Manager, common, and palette engine JavaScript files.
35+
- Palette source VM check passed: `SOURCE_PALETTES` exposes `crayola`, `w3c`, and `javascript`; source arrays are frozen; legacy `palettesList.crayola032` remains available.
36+
- `node scripts/validate-active-tools-surface.mjs` passed.
37+
- `node scripts/validate-project-system.mjs` failed on pre-existing project-system surface issues outside this PR scope.
38+
- `git diff --check` passed with line-ending warnings only.
39+
- Playwright remains intentionally skipped/removed as V2-only surface.
40+
41+
## Package
42+
- Delta ZIP: `tmp/PR_26124_027-palette-manager-clean-class-architecture_delta.zip`
Lines changed: 32 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,37 @@
11
# git status --short
2-
D .github/workflows/workspace-v2-playwright.yml
3-
M docs/design/tools/TOOLS_REENGINEERING_INDEX.md
4-
D docs/design/tools/palette-browser/REENGINEERING_DESIGN.md
5-
M docs/dev/reports/codex_changed_files.txt
2+
M docs/dev/reports/codex_changed_files.txt
63
M docs/dev/reports/codex_review.diff
4+
M docs/dev/reports/project_system_validation.txt
75
M docs/dev/roadmaps/MASTER_ROADMAP_TOOLS.md
8-
M package.json
9-
M scripts/audit-sample-json-ownership.mjs
10-
D scripts/run-workspace-v2-playwright-gate.mjs
11-
M scripts/sync-tool-hints-from-workspace-manager.mjs
12-
D scripts/update-tool-completion-audit-from-playwright.mjs
13-
M scripts/validate-active-tools-surface.mjs
14-
M scripts/validate-project-system.mjs
15-
D tests/asset-manager.spec.js
16-
D tests/playwright/tool-validation/workspace-v2.tool-validation.spec.js
17-
D tests/playwright/workspace-v2.validation.spec.js
18-
M tests/tools/AssetUsageIntegration.test.mjs
19-
M tests/tools/ToolEntryLaunchContract.test.mjs
20-
M tests/tools/ToolLayoutDockingControlNormalization.test.mjs
21-
M tests/tools/ToolWorkspaceSchemaManifestBoundaries.test.mjs
22-
D tests/ui/workspace-v2.asset-manager.spec.js
23-
D "tools/Palette Browser/README.md"
24-
D "tools/Palette Browser/assets/images/preview.svg"
25-
D "tools/Palette Browser/how_to_use.html"
26-
D "tools/Palette Browser/index.html"
27-
D "tools/Palette Browser/main.js"
28-
D "tools/Palette Browser/paletteBrowser.css"
29-
M tools/dev/checkSharedExtractionGuard.baseline.json
30-
M tools/shared/assetUsageIntegration.js
31-
M tools/shared/documentModeGuards.js
32-
M tools/shared/platformShell.js
33-
M tools/shared/projectSystemAdapters.js
34-
M tools/shared/projectToolIntegration.js
35-
M tools/shared/toolLoadDiagnostics.js
36-
M tools/templates/starter-project-template/config/starter.project.json
37-
M tools/toolRegistry.js
38-
?? docs/design/tools/palette-manager-v2/
39-
?? docs/dev/reports/PR_26124_026_report.md
40-
?? tools/palette-manager-v2/
6+
D src/engine/paletteDefaults.js
7+
M src/engine/paletteList.js
8+
M tools/palette-manager-v2/README.md
9+
M tools/palette-manager-v2/index.html
10+
M tools/palette-manager-v2/main.js
11+
?? docs/dev/reports/PR_26124_027_report.md
12+
?? tools/common/
13+
?? tools/palette-manager-v2/controls/
14+
?? tools/palette-manager-v2/modules/
4115

42-
# git diff --stat
43-
.github/workflows/workspace-v2-playwright.yml | 39 -
44-
docs/design/tools/TOOLS_REENGINEERING_INDEX.md | 6 +-
45-
.../tools/palette-browser/REENGINEERING_DESIGN.md | 134 ---
46-
docs/dev/roadmaps/MASTER_ROADMAP_TOOLS.md | 7 +-
47-
package.json | 2 -
48-
scripts/audit-sample-json-ownership.mjs | 6 +-
49-
scripts/run-workspace-v2-playwright-gate.mjs | 72 --
50-
scripts/sync-tool-hints-from-workspace-manager.mjs | 2 +-
51-
...pdate-tool-completion-audit-from-playwright.mjs | 216 -----
52-
scripts/validate-active-tools-surface.mjs | 5 +-
53-
scripts/validate-project-system.mjs | 6 +-
54-
tests/asset-manager.spec.js | 24 -
55-
.../workspace-v2.tool-validation.spec.js | 208 ----
56-
tests/playwright/workspace-v2.validation.spec.js | 252 -----
57-
tests/tools/AssetUsageIntegration.test.mjs | 2 +-
58-
tests/tools/ToolEntryLaunchContract.test.mjs | 8 +-
59-
.../ToolLayoutDockingControlNormalization.test.mjs | 4 +-
60-
.../ToolWorkspaceSchemaManifestBoundaries.test.mjs | 12 +-
61-
tests/ui/workspace-v2.asset-manager.spec.js | 118 ---
62-
tools/Palette Browser/README.md | 22 -
63-
tools/Palette Browser/assets/images/preview.svg | 84 --
64-
tools/Palette Browser/how_to_use.html | 71 --
65-
tools/Palette Browser/index.html | 90 --
66-
tools/Palette Browser/main.js | 1023 --------------------
67-
tools/Palette Browser/paletteBrowser.css | 254 -----
68-
tools/dev/checkSharedExtractionGuard.baseline.json | 10 -
69-
tools/shared/assetUsageIntegration.js | 12 +-
70-
tools/shared/documentModeGuards.js | 4 +-
71-
tools/shared/platformShell.js | 19 +-
72-
tools/shared/projectSystemAdapters.js | 25 +-
73-
tools/shared/projectToolIntegration.js | 16 +-
74-
tools/shared/toolLoadDiagnostics.js | 8 +-
75-
.../config/starter.project.json | 4 +-
76-
tools/toolRegistry.js | 18 +-
77-
34 files changed, 68 insertions(+), 2715 deletions(-)
16+
# git diff --stat (excluding codex review artifacts)
17+
docs/dev/reports/project_system_validation.txt | 9 +-
18+
docs/dev/roadmaps/MASTER_ROADMAP_TOOLS.md | 4 +-
19+
src/engine/paletteDefaults.js | 19 -
20+
src/engine/paletteList.js | 54 +++
21+
tools/palette-manager-v2/README.md | 1 +
22+
tools/palette-manager-v2/index.html | 1 +
23+
tools/palette-manager-v2/main.js | 565 +------------------------
24+
7 files changed, 86 insertions(+), 567 deletions(-)
7825

79-
# untracked files included in codex_review.diff
80-
docs/design/tools/palette-manager-v2/REENGINEERING_DESIGN.md
81-
docs/dev/reports/PR_26124_026_report.md
82-
tools/palette-manager-v2/how_to_use.html
83-
tools/palette-manager-v2/index.html
84-
tools/palette-manager-v2/main.js
85-
tools/palette-manager-v2/paletteManagerV2.css
86-
tools/palette-manager-v2/README.md
26+
# untracked file additions
27+
docs/dev/reports/PR_26124_027_report.md | 42 +
28+
tools/common/PaletteUsageService.js | 5 +
29+
tools/palette-manager-v2/controls/PaletteEditorControl.js | 55 +
30+
tools/palette-manager-v2/controls/PaletteImportExportControl.js | 75 +
31+
tools/palette-manager-v2/controls/PaletteValidationErrorControl.js | 20 +
32+
tools/palette-manager-v2/controls/SourcePaletteBrowserControl.js | 67 +
33+
tools/palette-manager-v2/controls/UserPaletteControl.js | 34 +
34+
tools/palette-manager-v2/modules/PaletteManagerApp.js | 323 +
35+
tools/palette-manager-v2/modules/PaletteValidationService.js | 65 +
36+
tools/palette-manager-v2/modules/SwatchRow.js | 46 +
37+
tools/palette-manager-v2/modules/paletteUtils.js | 30 +

0 commit comments

Comments
 (0)