Skip to content

Commit 2b1f438

Browse files
committed
Add Assets source selection with real upload filename handling - PR_26163_072-assets-source-upload-reference-details
1 parent a63adb6 commit 2b1f438

7 files changed

Lines changed: 523 additions & 257 deletions

File tree

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# PR_26163_072-assets-source-upload-reference-details
2+
3+
## Branch Validation
4+
- PASS: current branch is `main`.
5+
- Expected branch: `main`.
6+
7+
## Impacted Lanes
8+
- Toolbox Assets runtime lane.
9+
- Assets mock DB repository lane.
10+
- Targeted Playwright lane: `tests/playwright/tools/AssetToolMockRepository.spec.mjs`.
11+
- Workspace contract lane via legacy command `npm run test:workspace-v2`.
12+
13+
## Requirement Checklist
14+
- PASS: `docs_build/dev/PROJECT_INSTRUCTIONS.md` was read before implementation.
15+
- PASS: `toolbox/assets/index.html` remains external-JS/external-CSS only; no inline script/style/event handlers were added.
16+
- PASS: asset add/edit rows expose Source selection where supported.
17+
- PASS: Upload source shows a file picker, not a free-text File field.
18+
- PASS: Images Upload file selection updates the visible File detail with the selected filename.
19+
- PASS: Audio Upload file selection updates the visible File detail with the selected filename.
20+
- PASS: Fonts Upload file selection updates the visible File detail with the selected filename.
21+
- PASS: Images show Reference as an option after a valid same-type reference source exists.
22+
- PASS: Fonts show Upload only until a valid reference source exists.
23+
- PASS: Reference source shows a Reference selector instead of an upload picker.
24+
- PASS: missing reference sources fail visibly with `No valid reference source exists.` and save is blocked.
25+
- PASS: upload save without a selected file fails visibly with `Choose an upload file before saving.`
26+
- PASS: generated fake filenames were removed from the catalog asset path; `catalogFileNameForName` no longer exists.
27+
- PASS: Source does not silently switch between Upload and Reference; changes happen through the Source dropdown.
28+
- PASS: active MVP asset types remain Images, Audio, Fonts, Sprites, Vectors, Palette References, and Data.
29+
- PASS: Projectile remains absent from usage dropdown values.
30+
- PASS: shared Tags type-ahead behavior is preserved.
31+
- PASS: user-owned asset records remain scoped to the owning user.
32+
- PASS: scope stayed limited to Assets source/upload/reference behavior, targeted tests, and required reports.
33+
34+
## Changed Files
35+
- `toolbox/assets/assets.js`
36+
- `src/dev-runtime/persistence/tool-repositories/assets-mock-repository.js`
37+
- `tests/playwright/tools/AssetToolMockRepository.spec.mjs`
38+
- `docs_build/dev/reports/playwright_v8_coverage_report.txt`
39+
- `docs_build/dev/reports/PR_26163_072-assets-source-upload-reference-details.md`
40+
- `docs_build/dev/reports/codex_review.diff`
41+
- `docs_build/dev/reports/codex_changed_files.txt`
42+
43+
## Validation Performed
44+
- PASS: `node --check toolbox/assets/assets.js`
45+
- PASS: `node --check src/dev-runtime/persistence/tool-repositories/assets-mock-repository.js`
46+
- PASS: `node --check tests/playwright/tools/AssetToolMockRepository.spec.mjs`
47+
- PASS: `npx playwright test tests/playwright/tools/AssetToolMockRepository.spec.mjs --reporter=line --workers=1`
48+
- Result: 3 passed.
49+
- PASS: `npm run test:workspace-v2`
50+
- Result: 5 passed.
51+
52+
## Playwright Result
53+
- PASS: targeted Assets Playwright validates source dropdowns, upload file selection, reference selector behavior, missing reference failure, upload-without-file failure, shared Tags type-ahead, owner scope, and absence of Projectile.
54+
55+
## V8 Coverage
56+
- WARN/PASS: browser runtime coverage for `toolbox/assets/assets.js` was collected at 94%.
57+
- WARN: `src/dev-runtime/persistence/tool-repositories/assets-mock-repository.js` is exercised through Node-side repository assertions and API-backed browser behavior, but is not browser-collected V8 runtime code.
58+
- Details: `docs_build/dev/reports/playwright_v8_coverage_report.txt`.
59+
60+
## Skipped Lanes
61+
- Samples validation: SKIP. Samples are explicitly out of scope; this PR only changes the Assets tool source/upload/reference behavior and its mock repository contract.
62+
- Full samples smoke: SKIP. The request explicitly says not to run full samples smoke.
63+
- Broad unrelated toolbox lanes: SKIP. No shared navigation, tool registry, auth, sample JSON, or production runtime behavior changed.
64+
65+
## Manual Validation Steps
66+
1. Open `toolbox/assets/index.html`.
67+
2. Reset Asset Library.
68+
3. In Images, click Add Images, confirm Source defaults to Upload and the File cell shows an upload picker.
69+
4. Try Save without selecting a file and confirm a visible failure.
70+
5. Select an image file and confirm the File detail shows the filename.
71+
6. Save, then add another Images row and confirm Reference appears as a Source option.
72+
7. Select Reference and confirm a Reference selector appears instead of an upload picker.
73+
8. Open Audio and Fonts add rows and confirm Upload file selection displays the selected filename.
74+
9. Open Palette References add row with no palette source and confirm the missing reference failure is visible.
75+
76+
## Samples Decision
77+
- SKIP: no sample JSON alignment, sample runtime, or sample smoke behavior is in scope for PR_26163_072.
Lines changed: 7 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,7 @@
1-
# git status --short
2-
M docs_build/dev/admin-notes/PS_commands.txt
3-
M docs_build/dev/reports/coverage_changed_js_guardrail.txt
4-
M docs_build/dev/reports/dependency_gating_report.md
5-
M docs_build/dev/reports/dependency_hydration_reuse_report.md
6-
M docs_build/dev/reports/execution_graph_reuse_report.md
7-
M docs_build/dev/reports/failure_fingerprint_report.md
8-
M docs_build/dev/reports/filesystem_scan_reduction_report.md
9-
M docs_build/dev/reports/incremental_validation_report.md
10-
M docs_build/dev/reports/lane_compilation_report.md
11-
M docs_build/dev/reports/lane_deduplication_report.md
12-
M docs_build/dev/reports/lane_input_validation_report.md
13-
M docs_build/dev/reports/lane_manifests/workspace-contract.json
14-
M docs_build/dev/reports/lane_runtime_optimization_report.md
15-
M docs_build/dev/reports/lane_snapshot_report.md
16-
M docs_build/dev/reports/lane_snapshots/workspace-contract.json
17-
M docs_build/dev/reports/lane_warm_start_report.md
18-
M docs_build/dev/reports/lane_warm_starts/workspace-contract.json
19-
M docs_build/dev/reports/monolith_trigger_removal_report.md
20-
M docs_build/dev/reports/persistent_lane_manifest_report.md
21-
M docs_build/dev/reports/playwright_discovery_ownership_report.md
22-
M docs_build/dev/reports/playwright_discovery_scope_report.md
23-
M docs_build/dev/reports/playwright_structure_audit.md
24-
M docs_build/dev/reports/playwright_v8_coverage_report.txt
25-
M docs_build/dev/reports/retry_suppression_report.md
26-
M docs_build/dev/reports/slow_path_pruning_report.md
27-
M docs_build/dev/reports/static_validation_report.md
28-
M docs_build/dev/reports/targeted_file_manifest_report.md
29-
M docs_build/dev/reports/test_cleanup_performance_report.md
30-
M docs_build/dev/reports/test_cleanup_routing_report.md
31-
M docs_build/dev/reports/testing_lane_execution_report.md
32-
M docs_build/dev/reports/validation_cache_report.md
33-
M docs_build/dev/reports/zero_browser_preflight_report.md
34-
M src/dev-runtime/guest-seeds/tool-metadata-inventory.js
35-
M src/dev-runtime/persistence/mock-db-store.js
36-
M src/dev-runtime/persistence/tool-repositories/assets-mock-repository.js
37-
M src/dev-runtime/persistence/tool-repositories/tags-mock-repository.js
38-
M tests/playwright/tools/AssetToolMockRepository.spec.mjs
39-
M tests/playwright/tools/TagsTool.spec.mjs
40-
M toolbox/assets/assets.js
41-
M toolbox/tags/index.html
42-
?? assets/theme-v2/images/badges/tags-1024.png
43-
?? assets/theme-v2/images/badges/tags.png
44-
?? assets/theme-v2/images/tools/tags-1024.png
45-
?? assets/theme-v2/images/tools/tags.png
46-
?? docs_build/dev/reports/PR_26163_071-tags-assets-completion-fixes.md
47-
?? docs_build/tools-images-generated/tags.txt
48-
49-
# git ls-files --others --exclude-standard
50-
assets/theme-v2/images/badges/tags-1024.png
51-
assets/theme-v2/images/badges/tags.png
52-
assets/theme-v2/images/tools/tags-1024.png
53-
assets/theme-v2/images/tools/tags.png
54-
docs_build/dev/reports/PR_26163_071-tags-assets-completion-fixes.md
55-
docs_build/tools-images-generated/tags.txt
56-
57-
# git diff --stat
58-
docs_build/dev/admin-notes/PS_commands.txt | 4 +-
59-
.../dev/reports/coverage_changed_js_guardrail.txt | 2 +-
60-
docs_build/dev/reports/dependency_gating_report.md | 2 +-
61-
.../reports/dependency_hydration_reuse_report.md | 12 +-
62-
.../dev/reports/execution_graph_reuse_report.md | 16 +-
63-
.../dev/reports/failure_fingerprint_report.md | 2 +-
64-
.../reports/filesystem_scan_reduction_report.md | 2 +-
65-
.../dev/reports/incremental_validation_report.md | 14 +-
66-
docs_build/dev/reports/lane_compilation_report.md | 2 +-
67-
.../dev/reports/lane_deduplication_report.md | 2 +-
68-
.../dev/reports/lane_input_validation_report.md | 2 +-
69-
.../reports/lane_manifests/workspace-contract.json | 10 +-
70-
.../reports/lane_runtime_optimization_report.md | 14 +-
71-
docs_build/dev/reports/lane_snapshot_report.md | 12 +-
72-
.../reports/lane_snapshots/workspace-contract.json | 22 +-
73-
docs_build/dev/reports/lane_warm_start_report.md | 12 +-
74-
.../lane_warm_starts/workspace-contract.json | 16 +-
75-
.../dev/reports/monolith_trigger_removal_report.md | 2 +-
76-
.../dev/reports/persistent_lane_manifest_report.md | 12 +-
77-
.../playwright_discovery_ownership_report.md | 2 +-
78-
.../reports/playwright_discovery_scope_report.md | 2 +-
79-
.../dev/reports/playwright_structure_audit.md | 2 +-
80-
.../dev/reports/playwright_v8_coverage_report.txt | 14 +-
81-
docs_build/dev/reports/retry_suppression_report.md | 2 +-
82-
docs_build/dev/reports/slow_path_pruning_report.md | 16 +-
83-
docs_build/dev/reports/static_validation_report.md | 12 +-
84-
.../dev/reports/targeted_file_manifest_report.md | 8 +-
85-
.../dev/reports/test_cleanup_performance_report.md | 22 +-
86-
.../dev/reports/test_cleanup_routing_report.md | 2 +-
87-
.../dev/reports/testing_lane_execution_report.md | 52 ++---
88-
docs_build/dev/reports/validation_cache_report.md | 30 +--
89-
.../dev/reports/zero_browser_preflight_report.md | 10 +-
90-
.../guest-seeds/tool-metadata-inventory.js | 6 +-
91-
src/dev-runtime/persistence/mock-db-store.js | 2 +-
92-
.../tool-repositories/assets-mock-repository.js | 228 ++++++++-------------
93-
.../tool-repositories/tags-mock-repository.js | 1 +
94-
.../tools/AssetToolMockRepository.spec.mjs | 56 ++++-
95-
tests/playwright/tools/TagsTool.spec.mjs | 27 +++
96-
toolbox/assets/assets.js | 92 +++++++--
97-
toolbox/tags/index.html | 11 +-
98-
40 files changed, 417 insertions(+), 340 deletions(-)
1+
docs_build/dev/reports/PR_26163_072-assets-source-upload-reference-details.md
2+
docs_build/dev/reports/codex_review.diff
3+
docs_build/dev/reports/playwright_v8_coverage_report.txt
4+
src/dev-runtime/persistence/tool-repositories/assets-mock-repository.js
5+
tests/playwright/tools/AssetToolMockRepository.spec.mjs
6+
toolbox/assets/assets.js
7+
docs_build/dev/reports/codex_changed_files.txt
-6.5 KB
Binary file not shown.
Lines changed: 9 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,14 @@
11
Playwright V8 Coverage Report
22

3-
PR: generated by current Playwright run.
4-
Coverage source: Playwright/Chromium built-in V8 coverage.
5-
Coverage scope: all repo-relative browser JavaScript collected by Playwright/Chromium V8 coverage.
3+
PR: PR_26163_072-assets-source-upload-reference-details
4+
Coverage source: targeted Playwright/Chromium V8 coverage from tests/playwright/tools/AssetToolMockRepository.spec.mjs.
65
Dependencies: no new npm packages.
7-
Thresholds: none enforced.
8-
Note: coverage is an advisory baseline only for this PR.
9-
Note: missing changed runtime JS coverage is reported as WARN, not FAIL.
10-
Note: line counts are V8 range-based and advisory; function counts show partial module exercise where available.
11-
Note: entry percentages use function coverage when available, otherwise line coverage.
12-
Note: coverage entries are aggregated across every page/tool where coverageReporter.start(page) and coverageReporter.stop(page) ran.
6+
Thresholds: none enforced; coverage is advisory.
7+
Result: WARN only for dev-runtime code that is exercised by tests but not collectible by browser V8 runtime coverage.
138

14-
Exercised tool entry points detected:
15-
(84%) Toolbox Index - exercised 7 runtime JS files
16-
(0%) Tool Template V2 - not exercised by this Playwright run
17-
(57%) Theme V2 Shared JS - exercised 2 runtime JS files
9+
Changed runtime JavaScript files:
10+
(94%) toolbox/assets/assets.js - covered by targeted Assets Playwright; V8 reported executed lines 704/704 and executed functions 67/71.
11+
(0%) src/dev-runtime/persistence/tool-repositories/assets-mock-repository.js - WARN: dev-runtime repository code is exercised by Node-side repository assertions and browser behavior through the API adapter, but it is not browser runtime JavaScript collected by Playwright V8 coverage.
1812

19-
Changed runtime JS files covered:
20-
(0%) src/dev-runtime/guest-seeds/tool-metadata-inventory.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
21-
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
22-
(0%) src/dev-runtime/persistence/tool-repositories/assets-mock-repository.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
23-
(0%) src/dev-runtime/persistence/tool-repositories/tags-mock-repository.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
24-
(0%) src/dev-runtime/server/mock-api-router.mjs - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
25-
(67%) toolbox/assets/assets-api-client.js - executed lines 19/19; executed functions 2/3
26-
(96%) toolbox/assets/assets.js - executed lines 533/533; executed functions 52/54
27-
(100%) toolbox/tags/tags-api-client.js - executed lines 10/10; executed functions 2/2
28-
(100%) toolbox/tags/tags.js - executed lines 242/242; executed functions 19/19
29-
30-
Files with executed line/function counts where available:
31-
(33%) src/engine/api/toolbox-votes-api-client.js - executed lines 46/46; executed functions 2/6
32-
(38%) src/engine/api/session-api-client.js - executed lines 34/34; executed functions 3/8
33-
(53%) src/engine/api/server-api-client.js - executed lines 159/159; executed functions 10/19
34-
(56%) assets/theme-v2/js/gamefoundry-partials.js - executed lines 650/650; executed functions 30/54
35-
(64%) assets/theme-v2/js/tool-display-mode.js - executed lines 209/209; executed functions 9/14
36-
(67%) toolbox/assets/assets-api-client.js - executed lines 19/19; executed functions 2/3
37-
(75%) toolbox/tools-page-accordions.js - executed lines 965/965; executed functions 77/103
38-
(86%) toolbox/tool-registry-api-client.js - executed lines 152/152; executed functions 24/28
39-
(96%) toolbox/assets/assets.js - executed lines 533/533; executed functions 52/54
40-
(100%) toolbox/game-workspace/game-workspace-api-client.js - executed lines 12/12; executed functions 2/2
41-
(100%) toolbox/tags/tags-api-client.js - executed lines 10/10; executed functions 2/2
42-
(100%) toolbox/tags/tags.js - executed lines 242/242; executed functions 19/19
43-
44-
Uncovered or low-coverage changed JS files:
45-
(0%) src/dev-runtime/guest-seeds/tool-metadata-inventory.js - WARNING: uncovered changed runtime JS file; advisory only
46-
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: uncovered changed runtime JS file; advisory only
47-
(0%) src/dev-runtime/persistence/tool-repositories/assets-mock-repository.js - WARNING: uncovered changed runtime JS file; advisory only
48-
(0%) src/dev-runtime/persistence/tool-repositories/tags-mock-repository.js - WARNING: uncovered changed runtime JS file; advisory only
49-
(0%) src/dev-runtime/server/mock-api-router.mjs - WARNING: uncovered changed runtime JS file; advisory only
50-
51-
Changed JS files considered:
52-
(0%) src/dev-runtime/guest-seeds/tool-metadata-inventory.js - changed JS file not collected as browser runtime coverage
53-
(0%) src/dev-runtime/persistence/mock-db-store.js - changed JS file not collected as browser runtime coverage
54-
(0%) src/dev-runtime/persistence/tool-repositories/assets-mock-repository.js - changed JS file not collected as browser runtime coverage
55-
(0%) src/dev-runtime/persistence/tool-repositories/tags-mock-repository.js - changed JS file not collected as browser runtime coverage
56-
(0%) src/dev-runtime/server/mock-api-router.mjs - changed JS file not collected as browser runtime coverage
57-
(0%) tests/playwright/tools/AssetToolMockRepository.spec.mjs - changed JS file not collected as browser runtime coverage
58-
(0%) tests/playwright/tools/BuildPathProgressSimplification.spec.mjs - changed JS file not collected as browser runtime coverage
59-
(0%) tests/playwright/tools/RootToolsFutureState.spec.mjs - changed JS file not collected as browser runtime coverage
60-
(0%) tests/playwright/tools/TagsTool.spec.mjs - changed JS file not collected as browser runtime coverage
61-
(0%) tests/playwright/tools/ToolboxAdminMetadataSsot.spec.mjs - changed JS file not collected as browser runtime coverage
62-
(0%) tests/playwright/tools/ToolboxRoutePages.spec.mjs - changed JS file not collected as browser runtime coverage
63-
(67%) toolbox/assets/assets-api-client.js - changed JS file with browser V8 coverage
64-
(96%) toolbox/assets/assets.js - changed JS file with browser V8 coverage
65-
(100%) toolbox/tags/tags-api-client.js - changed JS file with browser V8 coverage
66-
(100%) toolbox/tags/tags.js - changed JS file with browser V8 coverage
13+
Changed non-runtime validation files:
14+
(0%) tests/playwright/tools/AssetToolMockRepository.spec.mjs - Playwright spec updated for PR072 behavior; test files are not browser runtime coverage targets.

0 commit comments

Comments
 (0)