Skip to content

Commit a193194

Browse files
committed
Restore Asset import dropdown values and fix import form layout - PR_26156_148-150-asset-import-dropdown-layout-fix
1 parent 289b7a8 commit a193194

9 files changed

Lines changed: 237 additions & 58 deletions

File tree

assets/theme-v2/css/tables.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,14 @@ td {
4848
}
4949

5050
.tool-form-table td {
51+
min-width: 12rem;
5152
width: auto
5253
}
5354

55+
.tool-form-table td[colspan] {
56+
min-width: 0
57+
}
58+
5459
.tool-form-table input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
5560
.tool-form-table textarea,
5661
.tool-form-table select {

docs_build/dev/codex_commands.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,3 +1035,38 @@ Required reports:
10351035
- `docs_build/dev/reports/testing_lane_execution_report.md`
10361036
- `docs_build/dev/reports/codex_changed_files.txt`
10371037
- `docs_build/dev/reports/codex_review.diff`
1038+
1039+
1040+
## PR_26156_148-150
1041+
1042+
Changes:
1043+
- Read `docs_build/dev/PROJECT_INSTRUCTIONS.md`.
1044+
- Read `archive/v1-v2/tools/old_asset-manager-v2/js/assetManagerMetadata.js` as behavior reference only.
1045+
- Restored Asset Role to Usage dropdown relationships for Audio, Color, Data, Font, Image, Localization, Shader, and Video.
1046+
- Removed the generic mixed usage dropdown source from the active Asset Tool repository.
1047+
- Updated Asset runtime wiring so changing Asset Role refreshes Usage options.
1048+
- Updated import validation so Usage must belong to the selected Asset Role.
1049+
- Fixed Import Asset form layout:
1050+
- `Asset Role` and `Storage Path` labels render on two lines.
1051+
- File picker remains in the File row.
1052+
- Upload help text moved into a separate `colspan="2"` row.
1053+
- Added a reusable Theme V2 `tool-form-table` value-cell minimum width in `assets/theme-v2/css/tables.css` after Playwright proved the existing shared pattern still allowed squashed selects.
1054+
- Updated targeted Asset Tool Playwright coverage for dropdown options and layout usability.
1055+
- Did not add page-local CSS, tool-local CSS, inline styles, style blocks, script blocks, or inline event handlers.
1056+
- Did not modify archived V1/V2 files.
1057+
- Did not modify `start_of_day`.
1058+
1059+
Validation:
1060+
- `node --check toolbox/assets/assets-mock-repository.js`
1061+
- `node --check toolbox/assets/assets.js`
1062+
- `node --check tests/playwright/tools/AssetToolMockRepository.spec.mjs`
1063+
- `node ./scripts/run-targeted-test-lanes.mjs --lane asset-tool`
1064+
- `git diff --check`
1065+
- Supplemental static checks for generic usage values and inline styling/handlers.
1066+
- Full samples smoke: skipped by request and because samples were not changed.
1067+
1068+
Required reports:
1069+
- `docs_build/dev/reports/asset-import-dropdown-layout-fix-report.md`
1070+
- `docs_build/dev/reports/testing_lane_execution_report.md`
1071+
- `docs_build/dev/reports/codex_changed_files.txt`
1072+
- `docs_build/dev/reports/codex_review.diff`

docs_build/dev/commit_comment.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Add project-owned Asset roles and upload workflow - PR_26156_142-147
1+
Fix Asset import role dropdown and form layout - PR_26156_148-150
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# PR_26156_148-150 Asset Import Dropdown and Layout Fix Report
2+
3+
Generated: 2026-06-05
4+
5+
## Scope
6+
7+
Stacked PRs:
8+
- `PR_26156_148-asset-import-dropdown-layout-fix`
9+
- `PR_26156_149-asset-import-help-row-fix`
10+
- `PR_26156_150-asset-import-validation-coverage`
11+
12+
Read `docs_build/dev/PROJECT_INSTRUCTIONS.md` first.
13+
14+
Reference use:
15+
- Read `archive/v1-v2/tools/old_asset-manager-v2/js/assetManagerMetadata.js`.
16+
- Used it only to confirm the role-to-usage relationship.
17+
- Did not copy archive/reference code.
18+
- Did not modify archived V1/V2 files.
19+
20+
## PR_26156_148 Dropdown Values
21+
22+
Restored the Asset Role to Usage relationship in `toolbox/assets/assets-mock-repository.js`:
23+
24+
| Asset Role | Usage options |
25+
| --- | --- |
26+
| Audio | sound, music |
27+
| Color | hud, text, background, border, accent, warning, success, danger, shadow, highlight |
28+
| Data | config, table |
29+
| Font | ui, display |
30+
| Image | sprite, background, bezel, preview, ui |
31+
| Localization | strings, dialogue |
32+
| Shader | fragment, vertex, compute |
33+
| Video | cutscene, loop |
34+
35+
Implementation notes:
36+
- Added `usageRoles` to each active Asset role definition.
37+
- Added `ASSET_USAGE_BY_ROLE` as the active role-to-usage source.
38+
- Removed the generic mixed `ASSET_USAGE_ROLES` dropdown source.
39+
- Updated `toolbox/assets/assets.js` so changing Asset Role refreshes Usage options immediately.
40+
- Validation now checks Usage against the selected Asset Role instead of a mixed global list.
41+
42+
## PR_26156_149 Import Form Layout
43+
44+
Updated `toolbox/assets/index.html`:
45+
- `Asset Role` label renders as two lines.
46+
- `Storage Path` label renders as two lines.
47+
- File label and file picker remain in the same row.
48+
- Upload explanatory text moved below the file row.
49+
- Upload help row spans both columns.
50+
- File input keeps `aria-describedby="assetToolFileHelp"`.
51+
52+
Theme V2 gap:
53+
- Existing `.tool-form-table` made controls `width: 100%`, but browser validation showed the left-panel table could still shrink select controls to about 74px.
54+
- Added a reusable Theme V2 rule in `assets/theme-v2/css/tables.css`:
55+
- normal form value cells get a reusable `12rem` minimum width
56+
- `colspan` helper rows opt out so help text can span naturally
57+
- No page-local CSS, tool-local CSS, inline styles, or style blocks were added.
58+
59+
## PR_26156_150 Validation Coverage
60+
61+
Updated `tests/playwright/tools/AssetToolMockRepository.spec.mjs`:
62+
- Validates each Asset Role exposes its exact Usage options.
63+
- Validates changing Asset Role changes Usage options.
64+
- Validates two-line labels are present for Asset Role and Storage Path.
65+
- Validates upload help text uses a `colspan="2"` table row.
66+
- Validates file picker remains in the File row.
67+
- Validates import form controls stay usable at narrow left-panel width.
68+
- Existing upload/preview/failure coverage was updated to use role-specific usage values.
69+
70+
## Validation
71+
72+
Impacted lane:
73+
- `asset-tool`
74+
75+
Executed:
76+
- `node --check toolbox/assets/assets-mock-repository.js`
77+
- `node --check toolbox/assets/assets.js`
78+
- `node --check tests/playwright/tools/AssetToolMockRepository.spec.mjs`
79+
- `node ./scripts/run-targeted-test-lanes.mjs --lane asset-tool`
80+
- `git diff --check`
81+
- `rg -n 'ASSET_USAGE_ROLES|usage:\s*"(Sprite|Music|UI|Sound Effect|Background|Character|World|Font|Data|Tile)"' toolbox/assets tests/playwright/tools/AssetToolMockRepository.spec.mjs`
82+
- `rg -n '<style|style=|onclick=|onchange=|oninput=|<script' toolbox/assets/index.html toolbox/assets/assets.js`
83+
84+
Results:
85+
- Asset Tool lane: PASS, 5 tests.
86+
- `git diff --check`: PASS. Git reported line-ending warnings only for edited files.
87+
- Generic usage source check: PASS, no matches.
88+
- Inline style/event-handler check: PASS; only expected external `src` script tags were found.
89+
90+
Skipped lanes:
91+
- Full samples smoke skipped by request and because no sample JSON, sample loader, or sample runtime framework behavior changed.
92+
- Project Workspace, Game Design, Game Configuration, Build Path, Tools Progress, tool navigation, tool images, tool runtime, engine, integration, games, and samples lanes were skipped because this stack only changed Asset Tool dropdown/layout behavior plus a reusable Theme V2 form-table rule validated by the Asset Tool lane.

docs_build/dev/reports/testing_lane_execution_report.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# Testing Lane Execution Report
22

3-
Generated: 2026-06-05T17:56:30.265Z
3+
Generated: 2026-06-05T18:27:22.138Z
44
Dry run: No
55

66
## Summary
77

8-
PASS: 2
8+
PASS: 1
99
WARN: 0
1010
FAIL: 0
11-
SKIP: 13
12-
Total lane elapsed time: 53.48s
13-
Actual browser launches: 2
11+
SKIP: 14
12+
Total lane elapsed time: 14.98s
13+
Actual browser launches: 1
1414

1515
## Full Samples Smoke
1616

@@ -21,7 +21,7 @@ Reason: Skipped because changed files do not modify sample JSON or shared sample
2121

2222
Status: PASS
2323
Reason: Runner preflight and Playwright structure audit passed before expensive lane execution.
24-
Command: C:\nvm4w\nodejs\node.exe scripts/audit-playwright-test-locations.mjs --discovery-report docs_build/dev/reports/playwright_discovery_ownership_report.md --scope-report docs_build/dev/reports/playwright_discovery_scope_report.md --scan-report docs_build/dev/reports/filesystem_scan_reduction_report.md --lanes asset-tool,project-workspace --targets tests/playwright/tools/AssetToolMockRepository.spec.mjs,tests/playwright/tools/ProjectWorkspaceMockRepository.spec.mjs --helpers tests/helpers/playwrightRepoServer.mjs,tests/helpers/playwrightStorageIsolation.mjs,tests/helpers/playwrightV8CoverageReporter.mjs,tests/helpers/workspaceV2CoverageReporter.mjs
24+
Command: C:\nvm4w\nodejs\node.exe scripts/audit-playwright-test-locations.mjs --discovery-report docs_build/dev/reports/playwright_discovery_ownership_report.md --scope-report docs_build/dev/reports/playwright_discovery_scope_report.md --scan-report docs_build/dev/reports/filesystem_scan_reduction_report.md --lanes asset-tool --targets tests/playwright/tools/AssetToolMockRepository.spec.mjs --helpers tests/helpers/playwrightRepoServer.mjs,tests/helpers/playwrightStorageIsolation.mjs,tests/helpers/playwrightV8CoverageReporter.mjs,tests/helpers/workspaceV2CoverageReporter.mjs
2525
Details: none
2626

2727
## Dependency Gate
@@ -32,15 +32,15 @@ Reason: No deterministic dependency failures before runtime.
3232
## Runtime Scheduling
3333

3434
Status: PASS
35-
Scheduled lane order: project-workspace, asset-tool
36-
Reused runtime sessions: 1
35+
Scheduled lane order: asset-tool
36+
Reused runtime sessions: 0
3737
Reused lane snapshots: 1
3838
Reused warm-start lanes: 1
3939
Reused dependency hydration: 1
4040
Prevented graph rebuilds: 1
4141
Prevented redundant initialization: 1
4242
Prevented redundant browser launches: 0
43-
Prevented redundant lane execution: 13
43+
Prevented redundant lane execution: 14
4444

4545
## Validation Cache
4646

@@ -61,39 +61,39 @@ Prevented broad lane escalation: 0
6161
## Discovery Scope
6262

6363
Status: PASS
64-
Target files: tests/playwright/tools/AssetToolMockRepository.spec.mjs, tests/playwright/tools/ProjectWorkspaceMockRepository.spec.mjs
64+
Target files: tests/playwright/tools/AssetToolMockRepository.spec.mjs
6565
Required shared helpers: tests/helpers/playwrightRepoServer.mjs, tests/helpers/playwrightStorageIsolation.mjs, tests/helpers/playwrightV8CoverageReporter.mjs, tests/helpers/workspaceV2CoverageReporter.mjs
6666
Required fixtures: none
67-
Targeted file/helper reads: 5
67+
Targeted file/helper reads: 0
6868
Cached discovery reuse: Yes
6969
Prevented fallback expansion: Yes; no ownership or scope blocker widened into broad discovery.
7070

7171
## Targeted File Manifests
7272

7373
Status: PASS
74-
Generated manifests: asset-tool:PASS, project-workspace:PASS
74+
Generated manifests: asset-tool:PASS
7575
Prevented discovery expansion: Yes
76-
Prevented redundant scans: 3
77-
Persistent manifest events: asset-tool:INVALIDATED, project-workspace:REUSED
76+
Prevented redundant scans: 0
77+
Persistent manifest events: asset-tool:REUSED
7878

7979
## Warm-Start Reuse
8080

8181
Status: PASS
82-
Warm-start events: asset-tool:INVALIDATED, project-workspace:REUSED
83-
Dependency hydration events: asset-tool:INVALIDATED, project-workspace:REUSED
82+
Warm-start events: asset-tool:REUSED
83+
Dependency hydration events: asset-tool:REUSED
8484
Prevented redundant initialization: 1
85-
Prevented helper resolution passes: 2
85+
Prevented helper resolution passes: 4
8686
Prevented fixture ownership traversal: 0
8787

8888
## Lane Snapshots
8989

9090
Status: PASS
91-
Snapshot events: asset-tool:INVALIDATED, project-workspace:REUSED
91+
Snapshot events: asset-tool:REUSED
9292
Reused snapshots: 1
93-
Invalidated snapshots: 1
93+
Invalidated snapshots: 0
9494
Prevented graph rebuilds: 1
9595
Prevented redundant dependency traversal: 1
96-
Prevented fixture/helper graph assembly: 2
96+
Prevented fixture/helper graph assembly: 4
9797

9898
## Lane Deduplication
9999

@@ -106,10 +106,10 @@ Prevented Workspace lane reruns: 0
106106
| Lane | Status | Elapsed | Browser Launches | Executed/Skipped Reason | Affected Surface | Fixtures / Inputs |
107107
| --- | --- | --- | --- | --- | --- | --- |
108108
| workspace-contract | SKIP | 0ms | 0 | Lane was not selected for this targeted run. | Root tools future-state navigation and Tool Template V2 contract | repo-served root tools page; Tool Template V2 future-state page; Theme V2 shared partials and assets |
109-
| project-workspace | PASS | 38.66s | 1 | Project Workspace rebuild slice validates mock users/projects/project_members data actions, project lifecycle controls, and project-driven Progress/Build Path copy without exercising unrelated toolbox routes. | Project Workspace mock repository, Project Workspace UI, and Toolbox Progress/Build Path project-state bridge | repo-served Project Workspace page; repo-served Toolbox page with role simulation; in-memory SQL-shaped mock project repository |
109+
| project-workspace | SKIP | 0ms | 0 | Lane was not selected for this targeted run. | Project Workspace mock repository, Project Workspace UI, and Toolbox Progress/Build Path project-state bridge | repo-served Project Workspace page; repo-served Toolbox page with role simulation; in-memory SQL-shaped mock project repository |
110110
| game-design | SKIP | 0ms | 0 | Lane was not selected for this targeted run. | Game Design mock repository, project purpose flow, validation overlay, capability demo authoring, and Toolbox progress handoff | repo-served Game Design page; repo-served Toolbox Progress and Build Path views; in-memory SQL-shaped Game Design mock repository; Project Workspace mock project context |
111111
| game-configuration | SKIP | 0ms | 0 | Lane was not selected for this targeted run. | Game Configuration mock repository, Game Design handoff, configuration validation, user-facing output, and Toolbox progress handoff | repo-served Game Configuration page; repo-served Game Design page for handoff checks; repo-served Toolbox Progress and Build Path views; in-memory SQL-shaped Game Configuration mock repository; Game Design mock repository handoff |
112-
| asset-tool | PASS | 14.82s | 1 | Asset Tool rebuild slice validates SQL-shaped asset tables, ready Game Configuration handoff, import/preview workflow, and visible validation errors without exercising unrelated toolbox routes. | Asset Tool mock repository, Game Configuration readiness handoff, library records, import preview, and visible failure handling | repo-served Assets page; in-memory SQL-shaped Asset Tool mock repository; Game Configuration mock repository handoff; file-name/path-based import preview |
112+
| asset-tool | PASS | 14.98s | 1 | Asset Tool rebuild slice validates SQL-shaped asset tables, ready Game Configuration handoff, import/preview workflow, and visible validation errors without exercising unrelated toolbox routes. | Asset Tool mock repository, Game Configuration readiness handoff, library records, import preview, and visible failure handling | repo-served Assets page; in-memory SQL-shaped Asset Tool mock repository; Game Configuration mock repository handoff; file-name/path-based import preview |
113113
| build-path | SKIP | 0ms | 0 | Lane was not selected for this targeted run. | Toolbox Build Path simplification, workflow status table, and Admin Tools Progress navigation | repo-served Toolbox page; repo-served Admin Tools Progress page; Project Workspace mock project context; Toolbox role simulation |
114114
| tools-progress | SKIP | 0ms | 0 | Lane was not selected for this targeted run. | Admin Tools Progress hydration, Toolbox Group view color model, and Project Build Path separation | repo-served Admin Tools Progress page; repo-served Toolbox Group view; Toolbox registry build sequence; Project Build Path workflow table |
115115
| tool-navigation | SKIP | 0ms | 0 | Lane was not selected for this targeted run. | Admin Tools Progress tool route links, Tool Display Mode build-order previous/next controls, and Toolbox group fallback routing | repo-served Admin Tools Progress page; repo-served Project Workspace, Game Design, and Game Configuration tool pages; repo-served Toolbox Group view with URL-selected accordion; Toolbox registry build sequence and route metadata |
@@ -125,19 +125,19 @@ Prevented Workspace lane reruns: 0
125125

126126
| Lane | Duration | Test |
127127
| --- | --- | --- |
128-
| project-workspace | 7.60s | tests\playwright\tools\ProjectWorkspaceMockRepository.spec.mjs:259:1 > representative Toolbox tool pages use the wide Theme V2 layout |
129-
| project-workspace | 5.50s | tests\playwright\tools\ProjectWorkspaceMockRepository.spec.mjs:376:1 > Toolbox member-role filters focus tools without exposing admin-only controls |
130-
| project-workspace | 4.60s | tests\playwright\tools\ProjectWorkspaceMockRepository.spec.mjs:326:1 > Toolbox Project Data controls are admin-only and drive mock Build Path state |
131-
| asset-tool | 3.00s | tests\playwright\tools\AssetToolMockRepository.spec.mjs:214:1 > Asset upload failures are visible and project context is required |
132-
| project-workspace | 2.70s | tests\playwright\tools\ProjectWorkspaceMockRepository.spec.mjs:96:1 > Project Workspace displays and edits project purpose and member role |
128+
| asset-tool | 2.80s | tests\playwright\tools\AssetToolMockRepository.spec.mjs:250:1 > Asset upload failures are visible and project context is required |
129+
| asset-tool | 2.30s | tests\playwright\tools\AssetToolMockRepository.spec.mjs:196:1 > Image, video, and audio uploads create project-owned metadata and previews |
130+
| asset-tool | 1.90s | tests\playwright\tools\AssetToolMockRepository.spec.mjs:161:1 > Asset Role changes update Usage options and import form layout stays usable |
131+
| asset-tool | 1.70s | tests\playwright\tools\AssetToolMockRepository.spec.mjs:119:1 > Assets page lists all asset roles and starts from active project context |
132+
| asset-tool | 485ms | tests\playwright\tools\AssetToolMockRepository.spec.mjs:75:1 > Asset Tool repository exposes SQL-shaped role, storage, and metadata ownership |
133133

134134
## Commands
135135

136136
### workspace-contract
137137
- SKIP
138138

139139
### project-workspace
140-
- PASS 38.66s C:\nvm4w\nodejs\node.exe C:\Users\davidq\Documents\GitHub\HTML-JavaScript-Gaming\node_modules\@playwright\test\cli.js test tests/playwright/tools/ProjectWorkspaceMockRepository.spec.mjs --project=playwright --workers=1 --reporter=list
140+
- SKIP
141141

142142
### game-design
143143
- SKIP
@@ -146,7 +146,7 @@ Prevented Workspace lane reruns: 0
146146
- SKIP
147147

148148
### asset-tool
149-
- PASS 14.82s C:\nvm4w\nodejs\node.exe C:\Users\davidq\Documents\GitHub\HTML-JavaScript-Gaming\node_modules\@playwright\test\cli.js test tests/playwright/tools/AssetToolMockRepository.spec.mjs --project=playwright --workers=1 --reporter=list
149+
- PASS 14.97s C:\nvm4w\nodejs\node.exe C:\Users\davidq\Documents\GitHub\HTML-JavaScript-Gaming\node_modules\@playwright\test\cli.js test tests/playwright/tools/AssetToolMockRepository.spec.mjs --project=playwright --workers=1 --reporter=list
150150

151151
### build-path
152152
- SKIP

0 commit comments

Comments
 (0)