Skip to content

Commit 0456413

Browse files
author
DavidQ
committed
Add palette-backed Color assets to Asset Manager V2 - PR_26126_092-asset-manager-v2-color-type-palette-picker
1 parent 20e9d37 commit 0456413

20 files changed

Lines changed: 2155 additions & 1426 deletions
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# PR_26126_092 Asset Manager V2 Color Asset Schema Notes
2+
3+
## Scope
4+
- Added `color` as a first-class Asset Manager V2 type.
5+
- Kept file-backed types as `audio`, `data`, `font`, `image`, `localization`, `shader`, and `video`.
6+
- Color assets use `kind: "hex"` and IDs shaped as `assets.color.<role>.<filenamePart>`.
7+
8+
## Schema Behavior
9+
- `tools/schemas/tools/asset-browser.schema.json` now accepts `assets.color.*.*` keys.
10+
- Color entries require `path`, `type`, `kind`, `role`, `source`, and `color`.
11+
- Color entries use `path: "palette://workspace/<palette-color-name-slug>"`.
12+
- Color metadata is strict and allows only `hex`, `name`, `symbol`, `source`, and `tags`.
13+
- `stretchOverride` remains blocked on color assets and remains scoped to `assets.image.bezel.*`.
14+
- Non-color assets continue to reject `color` metadata.
15+
16+
## Validator Behavior
17+
- `AssetSchemaValidator` validates color selections with the same payload path used by file-backed assets.
18+
- Color selection validation requires the active type to be `color`, the kind to be `hex`, and the selected form color metadata to match the active Workspace V2 palette swatch.
19+
- Workspace insertion writes validated color records only into `tools.asset-browser.assets`.
20+
21+
## Validation
22+
- `npm run test:workspace-v2` passed.
23+
- Workspace V2 insertion coverage validates `assets.color.hud.sky-blue` with `kind: "hex"` and palette swatch metadata.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# PR_26126_092 Asset Manager V2 Manual Validation Notes
2+
3+
## Commands
4+
- `node --check tools/asset-manager-v2/js/controls/AssetFormControl.js`
5+
- `node --check tools/asset-manager-v2/js/services/AssetSchemaValidator.js`
6+
- `node --check tools/asset-manager-v2/js/controls/AssetManagerShellControl.js`
7+
- `node --check tests/playwright/PreviewGeneratorV2Baseline.spec.mjs`
8+
- `node -e "JSON.parse(require('fs').readFileSync('tools/schemas/tools/asset-browser.schema.json','utf8')); console.log('schema json ok')"`
9+
- `npx playwright test tests/playwright/PreviewGeneratorV2Baseline.spec.mjs --project=playwright --reporter=list -g "Asset Manager V2"`
10+
- `npm run test:workspace-v2`
11+
12+
## Results
13+
- Focused Asset Manager V2 Playwright slice passed: 3 tests passed.
14+
- Required workspace-v2 Playwright gate passed: 10 tests passed.
15+
- `docs/dev/reports/playwright_v8_coverage_report.txt` was regenerated from the full workspace-v2 run.
16+
- The coverage report lists Asset Manager V2 coverage and labels Palette Manager V2 as `Palette Manager V2`.
17+
18+
## Manual Checks Covered By Tests
19+
- Type radio list is alphabetized and includes Audio, Color, Data, Font, Image, Localization, Shader, and Video.
20+
- `Pick Asset` uses the file picker for file-backed types and the palette picker for Color.
21+
- Color picker shows only Workspace V2 palette colors, provides 20px swatches, and has no arbitrary color input.
22+
- Color roles default to `hud`, remain user-changeable, regenerate IDs, and validate through Status.
23+
- Color assets validate against the asset schema and insert into `tools.asset-browser.assets`.
24+
- Sample JSON files were not modified.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# PR_26126_092 Asset Manager V2 Palette Picker Notes
2+
3+
## Picker Mode
4+
- The control label and button now read `Pick Asset`.
5+
- File-backed types keep using the file picker and the selected Type accept filter.
6+
- `Color` disables the file input and opens the palette picker instead.
7+
- Tool mode without a Workspace V2 palette reports the missing palette colors in Status only.
8+
9+
## Palette Source
10+
- Color picker swatches are read from the active Workspace V2 manifest at `tools["palette-browser"].swatches`.
11+
- The picker does not include an arbitrary color input.
12+
- Swatches render from the active palette only and use 20px visual swatches.
13+
14+
## Roles And Sorting
15+
- Color roles are `hud`, `text`, `background`, `border`, `accent`, `warning`, `success`, `danger`, `shadow`, and `highlight`.
16+
- The default Color role is `hud`.
17+
- Changing the Color role regenerates the asset ID and revalidates the selected palette color.
18+
- Sorting controls are available for Hue, Saturation, Brightness, Name, and Tag.
19+
20+
## Validation
21+
- Playwright validates the Type radio list is alphabetized with Color included.
22+
- Playwright validates file picker versus palette picker behavior, no arbitrary color input, 20px swatches, Name and Tag sorting, role changes, Status messages, and Workspace V2 insertion.
Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,42 @@
11
# git status --short
22
M docs/dev/reports/coverage_changed_js_guardrail.txt
33
M docs/dev/reports/playwright_v8_coverage_report.txt
4+
M src/shared/assets/assetPreviewHelpers.js
45
M tests/playwright/PreviewGeneratorV2Baseline.spec.mjs
6+
M tools/asset-manager-v2/README.md
57
M tools/asset-manager-v2/index.html
68
M tools/asset-manager-v2/js/AssetManagerV2App.js
79
M tools/asset-manager-v2/js/assetManagerMetadata.js
810
M tools/asset-manager-v2/js/bootstrap.js
9-
M tools/asset-manager-v2/js/controls/AssetCatalogControl.js
1011
M tools/asset-manager-v2/js/controls/AssetFormControl.js
12+
M tools/asset-manager-v2/js/controls/AssetManagerShellControl.js
1113
M tools/asset-manager-v2/js/services/AssetSchemaValidator.js
14+
M tools/asset-manager-v2/js/services/WorkspaceBridge.js
1215
M tools/asset-manager-v2/styles/assetManager.css
1316
M tools/schemas/tools/asset-browser.schema.json
14-
?? docs/dev/reports/PR_26126_091_asset_manager_v2_bezel_stretch_override_notes.md
15-
?? docs/dev/reports/PR_26126_091_asset_manager_v2_inspector_behavior_notes.md
16-
?? docs/dev/reports/PR_26126_091_asset_manager_v2_manual_validation_notes.md
17-
?? docs/dev/reports/PR_26126_091_asset_manager_v2_type_kind_schema_notes.md
18-
?? src/shared/assets/
17+
?? docs/dev/reports/PR_26126_092_asset_manager_v2_color_asset_schema_notes.md
18+
?? docs/dev/reports/PR_26126_092_asset_manager_v2_manual_validation_notes.md
19+
?? docs/dev/reports/PR_26126_092_asset_manager_v2_palette_picker_notes.md
1920

2021
# git ls-files --others --exclude-standard
21-
docs/dev/reports/PR_26126_091_asset_manager_v2_bezel_stretch_override_notes.md
22-
docs/dev/reports/PR_26126_091_asset_manager_v2_inspector_behavior_notes.md
23-
docs/dev/reports/PR_26126_091_asset_manager_v2_manual_validation_notes.md
24-
docs/dev/reports/PR_26126_091_asset_manager_v2_type_kind_schema_notes.md
25-
src/shared/assets/assetPreviewHelpers.js
22+
docs/dev/reports/PR_26126_092_asset_manager_v2_color_asset_schema_notes.md
23+
docs/dev/reports/PR_26126_092_asset_manager_v2_manual_validation_notes.md
24+
docs/dev/reports/PR_26126_092_asset_manager_v2_palette_picker_notes.md
2625

2726
# git diff --stat
28-
docs/dev/reports/coverage_changed_js_guardrail.txt | 13 +--
29-
docs/dev/reports/playwright_v8_coverage_report.txt | 34 +++---
30-
.../playwright/PreviewGeneratorV2Baseline.spec.mjs | 113 +++++++++++++++++--
31-
tools/asset-manager-v2/index.html | 8 +-
32-
tools/asset-manager-v2/js/AssetManagerV2App.js | 19 ++--
33-
tools/asset-manager-v2/js/assetManagerMetadata.js | 120 ++++++++++++++++-----
34-
tools/asset-manager-v2/js/bootstrap.js | 2 +
35-
.../js/controls/AssetCatalogControl.js | 13 ++-
36-
.../js/controls/AssetFormControl.js | 76 +++++++++----
37-
.../js/services/AssetSchemaValidator.js | 57 ++++++----
38-
tools/asset-manager-v2/styles/assetManager.css | 77 ++++++++++++-
39-
tools/schemas/tools/asset-browser.schema.json | 83 +++++++++++++-
40-
12 files changed, 496 insertions(+), 119 deletions(-)
27+
docs/dev/reports/coverage_changed_js_guardrail.txt | 14 +-
28+
docs/dev/reports/playwright_v8_coverage_report.txt | 38 ++--
29+
src/shared/assets/assetPreviewHelpers.js | 6 +
30+
.../playwright/PreviewGeneratorV2Baseline.spec.mjs | 166 +++++++++++++--
31+
tools/asset-manager-v2/README.md | 4 +-
32+
tools/asset-manager-v2/index.html | 45 ++--
33+
tools/asset-manager-v2/js/AssetManagerV2App.js | 42 ++++
34+
tools/asset-manager-v2/js/assetManagerMetadata.js | 54 +++--
35+
tools/asset-manager-v2/js/bootstrap.js | 3 +
36+
.../js/controls/AssetFormControl.js | 227 ++++++++++++++++++++-
37+
.../js/controls/AssetManagerShellControl.js | 2 +-
38+
.../js/services/AssetSchemaValidator.js | 61 +++++-
39+
.../js/services/WorkspaceBridge.js | 16 ++
40+
tools/asset-manager-v2/styles/assetManager.css | 74 +++++++
41+
tools/schemas/tools/asset-browser.schema.json | 115 ++++++++++-
42+
15 files changed, 762 insertions(+), 105 deletions(-)

0 commit comments

Comments
 (0)