Skip to content

Commit 88602fa

Browse files
committed
Clean Toolbox card status display, add port guard, and add wireframe tool pages - PR_26160_055-toolbox-wireframe-and-port-guard
1 parent a3bc401 commit 88602fa

14 files changed

Lines changed: 869 additions & 105 deletions

File tree

assets/theme-v2/css/status.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,10 @@
4848
padding: var(--space-3) var(--space-10);
4949
text-shadow: 0 1px 2px var(--shadow-color-strong)
5050
}
51+
52+
.swatch-label.swatch-cyan,
53+
.swatch-label.swatch-gold,
54+
.swatch-label.swatch-green {
55+
color: var(--bg);
56+
text-shadow: none
57+
}

assets/theme-v2/js/gamefoundry-partials.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,28 @@
11
(function () {
2+
const localDevExpectedPort = "5501";
3+
const localDevHostnames = new Set(["127.0.0.1", "localhost", "::1"]);
4+
5+
function shouldRedirectLocalDevPort() {
6+
return window.location.protocol === "http:" &&
7+
localDevHostnames.has(window.location.hostname) &&
8+
window.location.port !== localDevExpectedPort &&
9+
window.navigator?.webdriver !== true;
10+
}
11+
12+
function redirectLocalDevPort() {
13+
if (!shouldRedirectLocalDevPort()) {
14+
return false;
15+
}
16+
const target = new URL(window.location.href);
17+
target.port = localDevExpectedPort;
18+
window.location.replace(target.href);
19+
return true;
20+
}
21+
22+
if (redirectLocalDevPort()) {
23+
return;
24+
}
25+
226
const routeMap = {
327
home: "index.html",
428
toolbox: "toolbox/index.html",

assets/theme-v2/js/tool-display-mode.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@
2626
return publicAssetRoot + "/image-missing.svg";
2727
}
2828

29+
const cleanPath = source.split("#")[0].split("?")[0].replace(/\\/g, "/");
30+
const assetIndex = cleanPath.indexOf("/assets/theme-v2/images/");
31+
if (assetIndex >= 0) {
32+
return cleanPath.slice(assetIndex);
33+
}
34+
if (cleanPath.indexOf("assets/theme-v2/images/") === 0) {
35+
return "/" + cleanPath;
36+
}
37+
2938
return publicAssetRoot + "/" + folder + "/" + fileName;
3039
}
3140

docs_build/dev/reports/coverage_changed_js_guardrail.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ Missing changed runtime JS files are WARN, not FAIL.
66
Source: Playwright/Chromium built-in V8 coverage from the active Playwright run.
77

88
Changed runtime JS files considered:
9-
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
109
(0%) toolbox/toolRegistry.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
11-
(75%) toolbox/tools-page-accordions.js - executed lines 991/991; executed functions 72/96
10+
(65%) assets/theme-v2/js/gamefoundry-partials.js - executed lines 545/545; executed functions 30/46
11+
(75%) toolbox/tools-page-accordions.js - executed lines 1054/1054; executed functions 77/103
12+
(93%) assets/theme-v2/js/tool-display-mode.js - executed lines 209/209; executed functions 13/14
1213

1314
Guardrail warnings:
14-
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: changed runtime JS file missing from coverage; advisory only
1515
(0%) toolbox/toolRegistry.js - WARNING: changed runtime JS file missing from coverage; advisory only

docs_build/dev/reports/playwright_v8_coverage_report.txt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,36 @@ Note: entry percentages use function coverage when available, otherwise line cov
1212
Note: coverage entries are aggregated across every page/tool where coverageReporter.start(page) and coverageReporter.stop(page) ran.
1313

1414
Exercised tool entry points detected:
15-
(67%) Toolbox Index - exercised 8 runtime JS files
15+
(80%) Toolbox Index - exercised 8 runtime JS files
1616
(0%) Tool Template V2 - not exercised by this Playwright run
17-
(64%) Theme V2 Shared JS - exercised 2 runtime JS files
17+
(72%) Theme V2 Shared JS - exercised 2 runtime JS files
1818

1919
Changed runtime JS files covered:
20-
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
2120
(0%) toolbox/toolRegistry.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
22-
(75%) toolbox/tools-page-accordions.js - executed lines 991/991; executed functions 72/96
21+
(65%) assets/theme-v2/js/gamefoundry-partials.js - executed lines 545/545; executed functions 30/46
22+
(75%) toolbox/tools-page-accordions.js - executed lines 1054/1054; executed functions 77/103
23+
(93%) assets/theme-v2/js/tool-display-mode.js - executed lines 209/209; executed functions 13/14
2324

2425
Files with executed line/function counts where available:
2526
(38%) src/engine/api/session-api-client.js - executed lines 34/34; executed functions 3/8
26-
(55%) toolbox/colors/colors.js - executed lines 2147/2147; executed functions 114/206
27-
(58%) src/engine/api/server-api-client.js - executed lines 159/159; executed functions 11/19
28-
(64%) assets/theme-v2/js/gamefoundry-partials.js - executed lines 525/525; executed functions 28/44
29-
(64%) assets/theme-v2/js/tool-display-mode.js - executed lines 201/201; executed functions 9/14
27+
(53%) src/engine/api/server-api-client.js - executed lines 159/159; executed functions 10/19
28+
(65%) assets/theme-v2/js/gamefoundry-partials.js - executed lines 545/545; executed functions 30/46
3029
(71%) toolbox/project-workspace/project-workspace.js - executed lines 264/264; executed functions 17/24
31-
(75%) toolbox/tools-page-accordions.js - executed lines 991/991; executed functions 72/96
32-
(89%) toolbox/tool-registry-api-client.js - executed lines 148/148; executed functions 24/27
30+
(75%) toolbox/tools-page-accordions.js - executed lines 1054/1054; executed functions 77/103
31+
(78%) toolbox/game-configuration/game-configuration.js - executed lines 169/169; executed functions 14/18
3332
(91%) toolbox/game-design/game-design.js - executed lines 242/242; executed functions 20/22
34-
(100%) toolbox/colors/palette-api-client.js - executed lines 19/19; executed functions 4/4
33+
(93%) assets/theme-v2/js/tool-display-mode.js - executed lines 209/209; executed functions 13/14
34+
(96%) toolbox/tool-registry-api-client.js - executed lines 148/148; executed functions 26/27
35+
(100%) toolbox/game-configuration/game-configuration-api-client.js - executed lines 10/10; executed functions 2/2
3536
(100%) toolbox/game-design/game-design-api-client.js - executed lines 12/12; executed functions 2/2
3637
(100%) toolbox/project-workspace/project-workspace-api-client.js - executed lines 12/12; executed functions 2/2
3738

3839
Uncovered or low-coverage changed JS files:
39-
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: uncovered changed runtime JS file; advisory only
4040
(0%) toolbox/toolRegistry.js - WARNING: uncovered changed runtime JS file; advisory only
4141

4242
Changed JS files considered:
43-
(0%) src/dev-runtime/persistence/mock-db-store.js - changed JS file not collected as browser runtime coverage
44-
(0%) tests/playwright/tools/RootToolsFutureState.spec.mjs - changed JS file not collected as browser runtime coverage
4543
(0%) tests/playwright/tools/ToolboxRoutePages.spec.mjs - changed JS file not collected as browser runtime coverage
4644
(0%) toolbox/toolRegistry.js - changed JS file not collected as browser runtime coverage
45+
(65%) assets/theme-v2/js/gamefoundry-partials.js - changed JS file with browser V8 coverage
4746
(75%) toolbox/tools-page-accordions.js - changed JS file with browser V8 coverage
47+
(93%) assets/theme-v2/js/tool-display-mode.js - changed JS file with browser V8 coverage
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# PR_26160_055 Toolbox Wireframe And Port Guard Report
2+
3+
## Branch Validation
4+
5+
| Check | Expected | Actual | Status |
6+
| --- | --- | --- | --- |
7+
| Current git branch before changes | `main` | `main` | PASS |
8+
9+
## Requirement Checklist
10+
11+
| Requirement | Status | Evidence |
12+
| --- | --- | --- |
13+
| Correct Toolbox item states to exactly `planned`, `wireframe`, `beta`, `complete` | PASS | `toolbox/toolRegistry.js` defines `TOOL_RELEASE_CHANNELS` as `planned`, `wireframe`, `beta`, `complete`; `toolbox/tools-page-accordions.js` renders filters in that order. Node audit found no active release channels outside the allowed set. |
14+
| Keep existing groupings such as AI, Design, Audio, Assets, Build, System, Community, and Admin | PASS | `toolbox/tools-page-accordions.js` keeps group badges via `data-toolbox-group-badge` and separate state badges via `data-toolbox-state-badge`. |
15+
| Toolbox card content order is badge/action, group/state, feedback, then plan details | PASS | `tests/playwright/tools/ToolboxRoutePages.spec.mjs` asserts the Build Game action row order and card body order. |
16+
| Remove incorrect state treatment for group labels such as Play, AI, Design, and Audio while preserving them as groups | PASS | Group labels remain rendered through `createGroupLabel`; state labels are rendered separately through `createStateLabel`. Playwright asserts Design group label and Complete state badge coexist separately. |
17+
| Feedback Up/Down vote counts render and each user can vote one direction | PASS | `createToolVoteControls` stores per-tool voter direction and updates Up/Down counts; Playwright verifies Up -> Down changes the same user vote instead of adding both. |
18+
| Add dev-only port guard redirecting non-5501 localhost access to port 5501 | PASS | `assets/theme-v2/js/gamefoundry-partials.js` redirects localhost/127.0.0.1/::1 HTTP pages to port `5501` for non-Playwright human sessions; Playwright validates the redirect with `navigator.webdriver` set to false. |
19+
| Create wireframe-only pages for Achievements, Build Game, Saved Data, and Languages | PASS | Added full wireframe pages at `toolbox/achievements/index.html`, `toolbox/build-game/index.html`, `toolbox/saved-data/index.html`, and `toolbox/languages/index.html`. |
20+
| New wireframe pages include left, center, and right accordion panels with required controls | PASS | Playwright verifies each page has left/center/right columns, center accordions, and visible form controls. |
21+
| New wireframe controls are not wired to runtime code | PASS | Wireframe pages use static HTML controls and only shared Theme V2 scripts. No page-specific runtime wiring was added. |
22+
| No inline script, inline style, or inline event handlers | PASS | `rg -n "<script(?![^>]+src=)|<style[\\s>]|\\son(?:click|change|input|submit|keydown|keyup|load)=" -P ...` returned no matches. |
23+
24+
## Impacted Lane
25+
26+
- Toolbox/page validation.
27+
- Toolbox navigation/display behavior.
28+
- Shared Theme V2 display-mode image resolution.
29+
30+
## Validation Evidence
31+
32+
| Command | Result |
33+
| --- | --- |
34+
| `node --check assets/theme-v2/js/gamefoundry-partials.js; node --check assets/theme-v2/js/tool-display-mode.js; node --check toolbox/toolRegistry.js; node --check toolbox/tools-page-accordions.js; node --check tests/playwright/tools/ToolboxRoutePages.spec.mjs` | PASS |
35+
| `node scripts/validate-tool-registry.mjs` | PASS |
36+
| `rg -n "<script(?![^>]+src=)|<style[\\s>]|\\son(?:click|change|input|submit|keydown|keyup|load)=" -P toolbox/achievements/index.html toolbox/build-game/index.html toolbox/saved-data/index.html toolbox/languages/index.html toolbox/index.html` | PASS, no matches |
37+
| `git diff --check -- assets/theme-v2/css/status.css assets/theme-v2/js/gamefoundry-partials.js assets/theme-v2/js/tool-display-mode.js tests/playwright/tools/ToolboxRoutePages.spec.mjs toolbox/achievements/index.html toolbox/build-game/index.html toolbox/index.html toolbox/languages/index.html toolbox/saved-data/index.html toolbox/toolRegistry.js toolbox/tools-page-accordions.js` | PASS, line-ending warnings only |
38+
| `npx playwright test tests/playwright/tools/ToolboxRoutePages.spec.mjs --reporter=line` | PASS, 5/5 |
39+
| `npx playwright test tests/playwright/tools/ToolDisplayModeNavigation.spec.mjs --reporter=line` | PASS, 5/5 |
40+
41+
## Skipped Lanes
42+
43+
| Lane | Reason |
44+
| --- | --- |
45+
| Full samples validation | Explicitly skipped per request; no sample loader or shared sample framework changed. |
46+
| Full test suite | Not required for this targeted Toolbox/page PR. |
47+
| Non-Toolbox runtime lanes | Not affected; the PR only changes Toolbox registry/rendering, four static wireframe pages, Theme V2 display-mode image resolution, and the shared local dev port guard. |
48+
49+
## Manual Test Notes
50+
51+
- Verified branch before changes was `main`.
52+
- Verified effective active release-channel values with a Node registry audit: `planned`, `wireframe`, `beta`, and `complete` only.
53+
- Verified group labels remain separate from state badges by DOM/data attributes.
54+
- Verified the port guard is dev/local only and redirects human localhost sessions to `5501`; automated Playwright sessions are not redirected unless the test explicitly simulates a human browser.
55+
- The shared display-mode image resolver now respects explicit Theme V2 image paths such as `/assets/theme-v2/images/tools/build-game.png` before falling back to legacy folder resolution.
56+

0 commit comments

Comments
 (0)