Skip to content

Commit a74d82e

Browse files
author
DavidQ
committed
games index: remove JSON/roundtrip tool sections for all cards, keep workspace link only, and render Engine Classes Used from metadata
1 parent f471961 commit a74d82e

2 files changed

Lines changed: 65 additions & 17 deletions

File tree

games/index.render.js

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,8 @@ function buildRows(metadata, pinnedSet, toolLabelMap, toolRegistryMap) {
211211
}
212212
const classValues = [...new Set(asArray(game?.classValues).map((value) => normalize(value)).filter(Boolean))]
213213
.sort((a, b) => a.localeCompare(b, undefined, { sensitivity: "base" }));
214+
const engineClasses = [...new Set(asArray(game?.engineClassesUsed).map((value) => normalize(value)).filter(Boolean))]
215+
.sort((a, b) => a.localeCompare(b, undefined, { sensitivity: "base" }));
214216
const tags = [...new Set(asArray(game?.tags).map((value) => normalizeTag(value)).filter(Boolean))]
215217
.sort((a, b) => a.localeCompare(b, undefined, { sensitivity: "base" }));
216218
const href = normalizeGameHref(game?.href);
@@ -229,6 +231,7 @@ function buildRows(metadata, pinnedSet, toolLabelMap, toolRegistryMap) {
229231
level,
230232
status: normalize(game?.status) || "planned",
231233
classValues,
234+
engineClasses,
232235
toolTokens,
233236
roundtripLinks,
234237
tags,
@@ -323,26 +326,12 @@ function renderCard(row, instanceKey = "main") {
323326
row.debugShowcase ? badge("game-badge--debug-showcase", "Debug Showcase") : ""
324327
].filter(Boolean).join("");
325328

326-
const classText = row.classValues.length > 0 ? row.classValues.map((value) => value.split("/").at(-1) || value).join(", ") : "none";
329+
const classEntries = row.engineClasses;
327330
const tagText = row.tags.length > 0 ? row.tags.join(", ") : "none";
328331
const workspaceSection = row.workspaceHref
329332
? `
330333
<section class="game-tool-roundtrip">
331-
<h4>Open with Workspace Manager</h4>
332334
<p><a href="${escapeHtml(row.workspaceHref)}">Open with Workspace Manager</a></p>
333-
<h4>JSON Input</h4>
334-
<p>Paste JSON to inspect arbitrary state payloads.</p>
335-
</section>
336-
`
337-
: "";
338-
const roundtripSection = Array.isArray(row.roundtripLinks) && row.roundtripLinks.length > 0
339-
? `
340-
<section class="game-tool-roundtrip">
341-
<h4>Tool Roundtrip Links</h4>
342-
<p>Open game-related tools with workspace context and a return path back to Games.</p>
343-
<ul>
344-
${row.roundtripLinks.map((entry) => `<li><a href="${escapeHtml(entry.href)}">${escapeHtml(entry.label)}</a></li>`).join("")}
345-
</ul>
346335
</section>
347336
`
348337
: "";
@@ -353,9 +342,13 @@ function renderCard(row, instanceKey = "main") {
353342
${previewHtml}
354343
<p>${escapeHtml(row.description)}</p>
355344
${workspaceSection}
356-
${roundtripSection}
357-
<p>Classes: ${escapeHtml(classText)}</p>
358345
<p>Tags: ${escapeHtml(tagText)}</p>
346+
<section class="game-tool-roundtrip">
347+
<h4>Engine Classes Used</h4>
348+
${classEntries.length > 0
349+
? `<ul>${classEntries.map((value) => `<li>${escapeHtml(value)}</li>`).join("")}</ul>`
350+
: "<p>none</p>"}
351+
</section>
359352
${row.requiresService ? '<p class="game-service-note">Requires background service.</p>' : ""}
360353
`;
361354
return article;

games/metadata/games.index.metadata.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
"classValues": [
1111
"games/motion/basic"
1212
],
13+
"engineClassesUsed": [
14+
"engine/core/Engine",
15+
"engine/input/index/InputService",
16+
"engine/theme/index/Theme",
17+
"engine/theme/index/ThemeTokens"
18+
],
1319
"tags": [
1420
"arcade",
1521
"motion",
@@ -79,6 +85,12 @@
7985
"toolId": "replay-visualizer",
8086
"presetPath": "/samples/phase-07/0708/sample-0708-replay-visualizer.json"
8187
}
88+
],
89+
"engineClassesUsed": [
90+
"engine/core/Engine",
91+
"engine/input/index/InputService",
92+
"engine/theme/index/Theme",
93+
"engine/theme/index/ThemeTokens"
8294
]
8395
},
8496
{
@@ -119,6 +131,12 @@
119131
"toolId": "state-inspector",
120132
"presetPath": "/samples/phase-02/0205/sample-0205-state-inspector.json"
121133
}
134+
],
135+
"engineClassesUsed": [
136+
"engine/core/Engine",
137+
"engine/input/index/InputService",
138+
"engine/theme/index/Theme",
139+
"engine/theme/index/ThemeTokens"
122140
]
123141
},
124142
{
@@ -158,6 +176,12 @@
158176
"toolId": "physics-sandbox",
159177
"presetPath": "/samples/phase-03/0303/sample-0303-physics-sandbox.json"
160178
}
179+
],
180+
"engineClassesUsed": [
181+
"engine/core/Engine",
182+
"engine/input/index/InputService",
183+
"engine/theme/index/Theme",
184+
"engine/theme/index/ThemeTokens"
161185
]
162186
},
163187
{
@@ -198,6 +222,12 @@
198222
"toolId": "replay-visualizer",
199223
"presetPath": "/samples/phase-07/0708/sample-0708-replay-visualizer.json"
200224
}
225+
],
226+
"engineClassesUsed": [
227+
"engine/core/Engine",
228+
"engine/input/index/InputService",
229+
"engine/theme/index/Theme",
230+
"engine/theme/index/ThemeTokens"
201231
]
202232
},
203233
{
@@ -276,6 +306,12 @@
276306
"toolId": "asset-pipeline-tool",
277307
"presetPath": "/samples/phase-14/1413/sample-1413-asset-pipeline-tool.json"
278308
}
309+
],
310+
"engineClassesUsed": [
311+
"engine/core/Engine",
312+
"engine/input/index/InputService",
313+
"engine/theme/index/Theme",
314+
"engine/theme/index/ThemeTokens"
279315
]
280316
},
281317
{
@@ -315,6 +351,13 @@
315351
"toolId": "state-inspector",
316352
"presetPath": "/samples/phase-02/0205/sample-0205-state-inspector.json"
317353
}
354+
],
355+
"engineClassesUsed": [
356+
"engine/core/Engine",
357+
"engine/input/index/ActionInputMap",
358+
"engine/input/index/ActionInputService",
359+
"engine/theme/index/Theme",
360+
"engine/theme/index/ThemeTokens"
318361
]
319362
},
320363
{
@@ -354,6 +397,12 @@
354397
"toolId": "performance-profiler",
355398
"presetPath": "/samples/phase-13/1319/sample-1319-performance-profiler.json"
356399
}
400+
],
401+
"engineClassesUsed": [
402+
"engine/core/Engine",
403+
"engine/input/index/InputService",
404+
"engine/theme/index/Theme",
405+
"engine/theme/index/ThemeTokens"
357406
]
358407
},
359408
{
@@ -393,6 +442,12 @@
393442
"toolId": "state-inspector",
394443
"presetPath": "/samples/phase-02/0205/sample-0205-state-inspector.json"
395444
}
445+
],
446+
"engineClassesUsed": [
447+
"engine/core/Engine",
448+
"engine/input/index/InputService",
449+
"engine/theme/index/Theme",
450+
"engine/theme/index/ThemeTokens"
396451
]
397452
},
398453
{

0 commit comments

Comments
 (0)