Skip to content

Commit e000f0f

Browse files
author
DavidQ
committed
Add asset selection and details panel to Asset Manager V2 without mutating payload - PR_11_318
1 parent 417d962 commit e000f0f

9 files changed

Lines changed: 226 additions & 19 deletions

File tree

docs/dev/codex_commands.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,3 +166,10 @@ PR_11_317
166166
```bash
167167
npx @openai/codex run --model gpt-5.3-codex --reasoning medium "Implement PR_11_317: Clarify Workspace V2 Asset Manager launcher with explicit no-session vs active-session state while preserving session-routed launch behavior."
168168
```
169+
170+
---
171+
PR_11_318
172+
173+
```bash
174+
npx @openai/codex run --model gpt-5.3-codex --reasoning medium "Implement PR_11_318: Add Asset Manager V2 row selection + details panel with UI-only selection state and no payload mutation."
175+
```

docs/dev/commit_comment.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Clarify Workspace V2 Asset Manager launcher session/no-session state and prevent no-session confusion - PR 11.317
1+
Add Asset Manager V2 asset row selection and details panel with UI-only state - PR 11.318
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# PR_11_318 Report
2+
3+
## Purpose
4+
Add asset selection + details panel behavior in Asset Manager V2 with UI-only state.
5+
6+
## Files Changed
7+
- `tools/asset-manager-v2/index.html`
8+
- `tools/asset-manager-v2/index.js`
9+
- `docs/pr/PR_11_318_ASSET_MANAGER_SELECTION_DETAILS/PLAN_PR.md`
10+
- `docs/pr/PR_11_318_ASSET_MANAGER_SELECTION_DETAILS/BUILD_PR.md`
11+
- `docs/dev/reports/PR_11_318_report.md`
12+
- `docs/dev/codex_commands.md`
13+
- `docs/dev/commit_comment.txt`
14+
15+
## Implementation Summary
16+
- Clicking an asset row now selects it.
17+
- Selected row is visibly highlighted.
18+
- Selected details panel shows:
19+
- id
20+
- label
21+
- kind
22+
- path
23+
- No selection state uses persistence/session writes.
24+
- Default non-selection message is preserved exactly:
25+
- `Select an asset entry to inspect its session metadata.`
26+
27+
## Validation Commands
28+
- `node --check tools/asset-manager-v2/index.js` -> **PASS**
29+
30+
## Full Samples Smoke Decision
31+
- **Skipped** full samples smoke.
32+
- Reason: change is limited to `asset-manager-v2` UI behavior and validated with targeted syntax check.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# BUILD_PR_11_318
2+
3+
## Implementation
4+
- Added a minimal selected-asset details panel in `tools/asset-manager-v2/index.html`:
5+
- `id`
6+
- `label`
7+
- `kind`
8+
- `path`
9+
- default message: `Select an asset entry to inspect its session metadata.`
10+
- Updated `tools/asset-manager-v2/index.js`:
11+
- added UI-only selection state: `selectedAssetId`
12+
- clicking an asset row now selects it and updates details panel
13+
- selected row is visually highlighted (pressed + border/background)
14+
- selection is cleared on empty/invalid states
15+
- no selection data is written to payload/session persistence
16+
17+
## Validation
18+
- `node --check tools/asset-manager-v2/index.js`
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# PLAN_PR_11_318
2+
3+
## Purpose
4+
Add selection UX to Asset Manager V2 so users can select an asset row and inspect explicit details without mutating session payload data.
5+
6+
## Scope
7+
- `tools/asset-manager-v2/index.html`
8+
- `tools/asset-manager-v2/index.js`
9+
- `docs/dev/reports/PR_11_318_report.md`
10+
- `docs/dev/codex_commands.md`
11+
- `docs/dev/commit_comment.txt`
12+
13+
## Steps
14+
1. Add minimal details panel fields for id/label/kind/path.
15+
2. Track selected asset id in UI-only runtime state.
16+
3. Highlight selected asset row visually.
17+
4. Show exact default message when nothing is selected.
18+
5. Keep selection state non-persistent and payload/session unchanged by selection.
19+
6. Run targeted syntax validation for changed JS.

package-lock.json

Lines changed: 71 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,27 @@
1919
},
2020
"dependencies": {
2121
"ws": "^8.20.0"
22+
},
23+
"name": "html-javascript-gaming",
24+
"version": "1.0.0",
25+
"description": "> Learn, build, and scale 2D → 3D browser games with a structured engine, integrated tools, and progressive samples.",
26+
"main": "index.js",
27+
"directories": {
28+
"doc": "docs",
29+
"test": "tests"
30+
},
31+
"repository": {
32+
"type": "git",
33+
"url": "git+https://github.com/ToolboxAid/HTML-JavaScript-Gaming.git"
34+
},
35+
"keywords": [],
36+
"author": "",
37+
"license": "ISC",
38+
"bugs": {
39+
"url": "https://github.com/ToolboxAid/HTML-JavaScript-Gaming/issues"
40+
},
41+
"homepage": "https://github.com/ToolboxAid/HTML-JavaScript-Gaming#readme",
42+
"devDependencies": {
43+
"@playwright/test": "^1.59.1"
2244
}
2345
}

tools/asset-manager-v2/index.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,13 @@ <h3 id="assetBrowserV2Title">No assets loaded</h3>
4646
<div id="assetBrowserV2InvalidState" hidden>Asset Manager V2 session data is invalid. Re-open the tool from a valid host session.</div>
4747
<div id="assetBrowserV2ValidState" hidden>
4848
<div id="assetBrowserV2State">Asset Manager V2 loaded the session asset catalog.</div>
49-
<pre id="assetBrowserV2Preview" aria-label="Asset Manager V2 preview"></pre>
49+
<section aria-label="Asset Manager V2 selected asset details">
50+
<p id="assetBrowserV2DetailsMessage">Select an asset entry to inspect its session metadata.</p>
51+
<p><strong>id:</strong> <span id="assetBrowserV2DetailId">-</span></p>
52+
<p><strong>label:</strong> <span id="assetBrowserV2DetailLabel">-</span></p>
53+
<p><strong>kind:</strong> <span id="assetBrowserV2DetailKind">-</span></p>
54+
<p><strong>path:</strong> <span id="assetBrowserV2DetailPath">-</span></p>
55+
</section>
5056
</div>
5157
</section>
5258
<aside class="asset-manager-v2-panel" data-menu-workspace>

tools/asset-manager-v2/index.js

Lines changed: 49 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class AssetBrowserV2 {
99
this.openSvgAssetStudioV2 = this.openSvgAssetStudioV2.bind(this);
1010
this.addAssetEntry = this.addAssetEntry.bind(this);
1111
this.currentSessionContext = null;
12+
this.selectedAssetId = "";
1213
this.handleNavigationState = this.handleNavigationState.bind(this);
1314
window.addEventListener("popstate", this.handleNavigationState);
1415
window.addEventListener("pageshow", this.handleNavigationState);
@@ -127,6 +128,26 @@ class AssetBrowserV2 {
127128
document.getElementById("assetManagerV2ActionStatus").textContent = message;
128129
}
129130

131+
clearSelectedAssetDetails() {
132+
document.getElementById("assetBrowserV2DetailsMessage").textContent = "Select an asset entry to inspect its session metadata.";
133+
document.getElementById("assetBrowserV2DetailId").textContent = "-";
134+
document.getElementById("assetBrowserV2DetailLabel").textContent = "-";
135+
document.getElementById("assetBrowserV2DetailKind").textContent = "-";
136+
document.getElementById("assetBrowserV2DetailPath").textContent = "-";
137+
}
138+
139+
renderSelectedAssetDetails(assetEntry) {
140+
if (!assetEntry) {
141+
this.clearSelectedAssetDetails();
142+
return;
143+
}
144+
document.getElementById("assetBrowserV2DetailsMessage").textContent = "Selected asset details.";
145+
document.getElementById("assetBrowserV2DetailId").textContent = assetEntry.id.trim();
146+
document.getElementById("assetBrowserV2DetailLabel").textContent = assetEntry.label.trim();
147+
document.getElementById("assetBrowserV2DetailKind").textContent = assetEntry.kind.trim();
148+
document.getElementById("assetBrowserV2DetailPath").textContent = assetEntry.path.trim();
149+
}
150+
130151
normalizedAssetEntryFromForm() {
131152
const id = typeof document.getElementById("assetManagerV2AddId").value === "string" ? document.getElementById("assetManagerV2AddId").value.trim() : "";
132153
const label = typeof document.getElementById("assetManagerV2AddLabel").value === "string" ? document.getElementById("assetManagerV2AddLabel").value.trim() : "";
@@ -150,6 +171,17 @@ class AssetBrowserV2 {
150171
document.getElementById("assetManagerV2AddPath").value = "";
151172
}
152173

174+
selectedAssetEntryFromCatalogEntries(entries) {
175+
if (!Array.isArray(entries)) {
176+
return null;
177+
}
178+
if (typeof this.selectedAssetId !== "string" || !this.selectedAssetId.trim()) {
179+
return null;
180+
}
181+
const selectedAssetEntry = entries.find((entry) => entry && typeof entry === "object" && !Array.isArray(entry) && typeof entry.id === "string" && entry.id.trim() === this.selectedAssetId);
182+
return selectedAssetEntry || null;
183+
}
184+
153185
addAssetEntry() {
154186
if (!this.currentSessionContext || typeof this.currentSessionContext !== "object" || Array.isArray(this.currentSessionContext)) {
155187
this.setActionStatus("Add blocked. No valid Asset Manager V2 session is loaded.");
@@ -372,6 +404,10 @@ class AssetBrowserV2 {
372404
document.getElementById("assetBrowserV2InvalidState").hidden = true;
373405
document.getElementById("assetBrowserV2ValidState").hidden = false;
374406
this.currentSessionContext = this.cloneSessionValue(sessionContext);
407+
const selectedAssetEntry = this.selectedAssetEntryFromCatalogEntries(assetCatalog.entries);
408+
if (!selectedAssetEntry) {
409+
this.selectedAssetId = "";
410+
}
375411

376412
document.getElementById("assetBrowserV2List").replaceChildren();
377413
assetCatalog.entries.forEach((entry) => {
@@ -386,28 +422,23 @@ class AssetBrowserV2 {
386422
assetMeta.textContent = `${entry.kind.trim()} | ${entry.path.trim()}`;
387423
assetItem.append(assetName, assetMeta);
388424
removeButton.textContent = `Remove ${entry.id.trim()}`;
425+
const entryIsSelected = typeof this.selectedAssetId === "string" && this.selectedAssetId.trim() === entry.id.trim();
426+
assetItem.setAttribute("aria-pressed", entryIsSelected ? "true" : "false");
427+
assetItem.style.borderWidth = entryIsSelected ? "2px" : "";
428+
assetItem.style.borderStyle = entryIsSelected ? "solid" : "";
429+
assetItem.style.borderColor = entryIsSelected ? "#1f6feb" : "";
430+
assetItem.style.backgroundColor = entryIsSelected ? "#dbeafe" : "";
389431
assetItem.addEventListener("click", () => {
390-
document.getElementById("assetBrowserV2Preview").textContent = JSON.stringify(
391-
{
392-
id: entry.id.trim(),
393-
label: entry.label.trim(),
394-
kind: entry.kind.trim(),
395-
path: entry.path.trim()
396-
},
397-
null,
398-
2
399-
);
432+
this.selectedAssetId = entry.id.trim();
433+
this.renderCatalog(assetCatalog, sessionContext);
400434
});
401435
removeButton.addEventListener("click", () => {
402436
this.removeAssetEntryById(entry.id.trim());
403437
});
404438
assetRow.append(assetItem, removeButton);
405439
document.getElementById("assetBrowserV2List").appendChild(assetRow);
406440
});
407-
408-
document.getElementById("assetBrowserV2Preview").textContent = assetCatalog.entries.length === 0
409-
? "No assets are available in this session catalog."
410-
: "Select an asset entry to inspect its session metadata.";
441+
this.renderSelectedAssetDetails(this.selectedAssetEntryFromCatalogEntries(assetCatalog.entries));
411442
}
412443

413444
renderMissing(message) {
@@ -422,7 +453,8 @@ class AssetBrowserV2 {
422453
document.getElementById("assetBrowserV2InvalidState").hidden = true;
423454
document.getElementById("assetBrowserV2ValidState").hidden = true;
424455
document.getElementById("assetBrowserV2List").replaceChildren();
425-
document.getElementById("assetBrowserV2Preview").textContent = "";
456+
this.selectedAssetId = "";
457+
this.clearSelectedAssetDetails();
426458
this.currentSessionContext = null;
427459
this.setActionStatus("No asset action yet.");
428460
}
@@ -439,7 +471,8 @@ class AssetBrowserV2 {
439471
document.getElementById("assetBrowserV2InvalidState").hidden = false;
440472
document.getElementById("assetBrowserV2ValidState").hidden = true;
441473
document.getElementById("assetBrowserV2List").replaceChildren();
442-
document.getElementById("assetBrowserV2Preview").textContent = "";
474+
this.selectedAssetId = "";
475+
this.clearSelectedAssetDetails();
443476
this.currentSessionContext = null;
444477
this.setActionStatus("No asset action yet.");
445478
}

0 commit comments

Comments
 (0)