Skip to content

Commit 4090ff3

Browse files
committed
Fix Toolbox Planned filter tile display - PR_26160_058-toolbox-planned-filter-tiles
1 parent b33d32e commit 4090ff3

5 files changed

Lines changed: 174 additions & 44 deletions

File tree

docs_build/dev/reports/coverage_changed_js_guardrail.txt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,15 @@ 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%) admin/tool-votes.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
910
(0%) src/dev-runtime/guest-seeds/tool-state-samples.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
1011
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
1112
(0%) src/dev-runtime/server/mock-api-router.mjs - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
12-
(0%) toolbox/toolRegistry.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
13-
(77%) assets/theme-v2/js/gamefoundry-partials.js - executed lines 547/547; executed functions 37/48
14-
(96%) toolbox/tools-page-accordions.js - executed lines 1033/1033; executed functions 108/113
15-
(100%) admin/tool-votes.js - executed lines 120/120; executed functions 16/16
16-
(100%) src/engine/api/toolbox-votes-api-client.js - executed lines 28/28; executed functions 4/4
13+
(50%) src/engine/api/toolbox-votes-api-client.js - executed lines 28/28; executed functions 2/4
14+
(85%) toolbox/tools-page-accordions.js - executed lines 1033/1033; executed functions 93/109
1715

1816
Guardrail warnings:
17+
(0%) admin/tool-votes.js - WARNING: changed runtime JS file missing from coverage; advisory only
1918
(0%) src/dev-runtime/guest-seeds/tool-state-samples.js - WARNING: changed runtime JS file missing from coverage; advisory only
2019
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: changed runtime JS file missing from coverage; advisory only
2120
(0%) src/dev-runtime/server/mock-api-router.mjs - WARNING: changed runtime JS file missing from coverage; advisory only
22-
(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 & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,51 +12,39 @@ 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-
(68%) Toolbox Index - exercised 9 runtime JS files
15+
(79%) Toolbox Index - exercised 3 runtime JS files
1616
(0%) Tool Template V2 - not exercised by this Playwright run
17-
(74%) Theme V2 Shared JS - exercised 2 runtime JS files
17+
(65%) Theme V2 Shared JS - exercised 1 runtime JS files
1818

1919
Changed runtime JS files covered:
20+
(0%) admin/tool-votes.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
2021
(0%) src/dev-runtime/guest-seeds/tool-state-samples.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
2122
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
2223
(0%) src/dev-runtime/server/mock-api-router.mjs - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
23-
(0%) toolbox/toolRegistry.js - WARNING: changed runtime JS file was not collected by Playwright V8 coverage; advisory only
24-
(77%) assets/theme-v2/js/gamefoundry-partials.js - executed lines 547/547; executed functions 37/48
25-
(96%) toolbox/tools-page-accordions.js - executed lines 1033/1033; executed functions 108/113
26-
(100%) admin/tool-votes.js - executed lines 120/120; executed functions 16/16
27-
(100%) src/engine/api/toolbox-votes-api-client.js - executed lines 28/28; executed functions 4/4
24+
(50%) src/engine/api/toolbox-votes-api-client.js - executed lines 28/28; executed functions 2/4
25+
(85%) toolbox/tools-page-accordions.js - executed lines 1033/1033; executed functions 93/109
2826

2927
Files with executed line/function counts where available:
3028
(38%) src/engine/api/session-api-client.js - executed lines 34/34; executed functions 3/8
31-
(55%) toolbox/colors/colors.js - executed lines 2147/2147; executed functions 114/206
32-
(55%) toolbox/project-journey/project-journey.js - executed lines 1003/1003; executed functions 54/99
33-
(58%) src/engine/api/server-api-client.js - executed lines 159/159; executed functions 11/19
34-
(64%) assets/theme-v2/js/tool-display-mode.js - executed lines 209/209; executed functions 9/14
35-
(71%) toolbox/assets/assets.js - executed lines 519/519; executed functions 42/59
36-
(77%) assets/theme-v2/js/gamefoundry-partials.js - executed lines 547/547; executed functions 37/48
37-
(85%) toolbox/tool-registry-api-client.js - executed lines 148/148; executed functions 23/27
38-
(96%) toolbox/tools-page-accordions.js - executed lines 1033/1033; executed functions 108/113
39-
(100%) admin/tool-votes.js - executed lines 120/120; executed functions 16/16
40-
(100%) src/engine/api/toolbox-votes-api-client.js - executed lines 28/28; executed functions 4/4
41-
(100%) toolbox/assets/assets-api-client.js - executed lines 17/17; executed functions 3/3
42-
(100%) toolbox/colors/palette-api-client.js - executed lines 19/19; executed functions 4/4
43-
(100%) toolbox/project-journey/project-journey-api-client.js - executed lines 12/12; executed functions 2/2
29+
(43%) toolbox/tool-registry-api-client.js - executed lines 148/148; executed functions 9/21
30+
(50%) src/engine/api/toolbox-votes-api-client.js - executed lines 28/28; executed functions 2/4
31+
(53%) src/engine/api/server-api-client.js - executed lines 159/159; executed functions 10/19
32+
(65%) assets/theme-v2/js/gamefoundry-partials.js - executed lines 547/547; executed functions 30/46
33+
(85%) toolbox/tools-page-accordions.js - executed lines 1033/1033; executed functions 93/109
4434
(100%) toolbox/project-workspace/project-workspace-api-client.js - executed lines 12/12; executed functions 2/2
4535

4636
Uncovered or low-coverage changed JS files:
37+
(0%) admin/tool-votes.js - WARNING: uncovered changed runtime JS file; advisory only
4738
(0%) src/dev-runtime/guest-seeds/tool-state-samples.js - WARNING: uncovered changed runtime JS file; advisory only
4839
(0%) src/dev-runtime/persistence/mock-db-store.js - WARNING: uncovered changed runtime JS file; advisory only
4940
(0%) src/dev-runtime/server/mock-api-router.mjs - WARNING: uncovered changed runtime JS file; advisory only
50-
(0%) toolbox/toolRegistry.js - WARNING: uncovered changed runtime JS file; advisory only
5141

5242
Changed JS files considered:
43+
(0%) admin/tool-votes.js - changed JS file not collected as browser runtime coverage
5344
(0%) src/dev-runtime/guest-seeds/tool-state-samples.js - changed JS file not collected as browser runtime coverage
5445
(0%) src/dev-runtime/persistence/mock-db-store.js - changed JS file not collected as browser runtime coverage
5546
(0%) src/dev-runtime/server/mock-api-router.mjs - changed JS file not collected as browser runtime coverage
5647
(0%) tests/helpers/playwrightV8CoverageReporter.mjs - changed JS file not collected as browser runtime coverage
5748
(0%) tests/playwright/tools/ToolboxRoutePages.spec.mjs - changed JS file not collected as browser runtime coverage
58-
(0%) toolbox/toolRegistry.js - changed JS file not collected as browser runtime coverage
59-
(77%) assets/theme-v2/js/gamefoundry-partials.js - changed JS file with browser V8 coverage
60-
(96%) toolbox/tools-page-accordions.js - changed JS file with browser V8 coverage
61-
(100%) admin/tool-votes.js - changed JS file with browser V8 coverage
62-
(100%) src/engine/api/toolbox-votes-api-client.js - changed JS file with browser V8 coverage
49+
(50%) src/engine/api/toolbox-votes-api-client.js - changed JS file with browser V8 coverage
50+
(85%) toolbox/tools-page-accordions.js - changed JS file with browser V8 coverage
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# PR_26160_058 Toolbox Planned Filter Tiles Report
2+
3+
## Branch Validation
4+
5+
| Check | Result | Evidence |
6+
| --- | --- | --- |
7+
| Current branch is `main` | PASS | `git branch --show-current` returned `main`. |
8+
| Local branches reported | PASS | `git branch --list` returned only `* main`. |
9+
10+
## Requirement Checklist
11+
12+
| Requirement | Status | Evidence |
13+
| --- | --- | --- |
14+
| Fix Build Path Planned filter so selecting Planned displays all planned tool tiles/rows | PASS | `toolbox/tools-page-accordions.js` now builds Build Path rows from all `visibleInToolsList` registry tools, matching the Planned count. |
15+
| Keep Planned count DB/registry-driven | PASS | Counts still come from registry-normalized release channels; Playwright asserts `Planned (28)`. |
16+
| Ensure filter matching uses same normalized status source for counts and visible tiles | PASS | Both counts and Build Path rows now map `registryTools.filter(visibleInToolsList).map(enrichTool)` and use `releaseChannel`. |
17+
| Preserve Complete as only default active filter | PASS | Build Path defaults remain `complete`; Playwright verifies Complete active and Planned/Wireframe/Beta inactive by default. |
18+
| Complete default shows Colors only | PASS | Focused Playwright verifies one complete Build Path row and `Colors` visible. |
19+
| Planned selected shows all planned tools matching count | PASS | Focused Playwright verifies `planned` rows count is `28` and every row has `data-build-path-release-channel="planned"`. |
20+
| Wireframe selected shows 4 tools | PASS | Focused Playwright verifies `wireframe` rows count is `4`. |
21+
| Beta selected shows 5 tools | PASS | Focused Playwright verifies `beta` rows count is `5`. |
22+
| Do not add new features or expand scope | PASS | Changed only Build Path row/filter behavior and targeted assertions/reports. |
23+
| No inline script/style/event handlers | PASS | Static `rg --pcre2` scan of `toolbox/index.html` found no inline scripts, styles, or event handlers. |
24+
25+
## Validation Performed
26+
27+
| Lane | Command | Result |
28+
| --- | --- | --- |
29+
| Branch guard | `git branch --show-current`; `git branch --list` | PASS |
30+
| Changed-file syntax | `node --check toolbox/tools-page-accordions.js`; `node --check tests/playwright/tools/ToolboxRoutePages.spec.mjs` | PASS |
31+
| Static diff check | `git diff --check` | PASS |
32+
| Inline HTML guard | `rg --pcre2 -n "<script(?![^>]+src=)|<style[\\s>]|\\son(?:click|change|input|submit|keydown|keyup|load)=" toolbox/index.html` | PASS, no matches |
33+
| Targeted Toolbox Build Path Playwright | `npx playwright test tests/playwright/tools/ToolboxRoutePages.spec.mjs -g "Build Path status filters" --reporter=line` | PASS, 1 passed |
34+
| Playwright V8 coverage | Generated by focused Playwright run via `workspaceV2CoverageReporter` | PASS, report written to `docs_build/dev/reports/playwright_v8_coverage_report.txt` |
35+
36+
## Impacted Lane
37+
38+
Targeted Toolbox Build Path status-filter lane only.
39+
40+
## Skipped Lanes
41+
42+
| Lane | Decision | Reason |
43+
| --- | --- | --- |
44+
| Full samples validation | SKIPPED | Samples were not changed and no shared sample loader/framework was touched. |
45+
| Broad Toolbox route smoke | SKIPPED | The focused Build Path status-filter test covers the requested behavior. |
46+
| Full app Playwright suite | SKIPPED | PR scope is limited to Build Path filter matching. |
47+
48+
## Manual Test Notes
49+
50+
1. Open `http://127.0.0.1:5501/toolbox/index.html`.
51+
2. Click `Build Path`.
52+
3. Verify Complete is the only active default filter and only Colors is listed.
53+
4. Click Planned and verify 28 planned rows are listed.
54+
5. Click Wireframe and verify 4 rows are listed.
55+
6. Click Beta and verify 5 rows are listed.
56+
57+
## Artifacts
58+
59+
- Codex review diff: `docs_build/dev/reports/codex_review.diff`
60+
- Changed files: `docs_build/dev/reports/codex_changed_files.txt`
61+
- V8 coverage: `docs_build/dev/reports/playwright_v8_coverage_report.txt`
62+
- Repo-structured ZIP: `tmp/PR_26160_058-toolbox-planned-filter-tiles_20260609_001_delta.zip`

tests/playwright/tools/ToolboxRoutePages.spec.mjs

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,88 @@ test("toolbox status kickers, filters, card order, and voting controls work from
392392
}
393393
});
394394

395+
test("toolbox Build Path status filters show registry-matched tool rows", async ({ page }) => {
396+
const server = await startRepoServer();
397+
const failedRequests = [];
398+
const pageErrors = [];
399+
const consoleErrors = [];
400+
401+
page.on("response", (response) => {
402+
if (response.status() >= 400) {
403+
failedRequests.push(`${response.status()} ${response.url()}`);
404+
}
405+
});
406+
page.on("requestfailed", (request) => {
407+
failedRequests.push(`FAILED ${request.url()}`);
408+
});
409+
page.on("pageerror", (error) => {
410+
const text = error.stack || error.message;
411+
if (!isBrowserExtensionNoise(text)) {
412+
pageErrors.push(error.message);
413+
}
414+
});
415+
page.on("console", (message) => {
416+
if (message.type() === "error" && !isBrowserExtensionNoise(message.text())) {
417+
consoleErrors.push(message.text());
418+
}
419+
});
420+
421+
async function expectBuildPathChannel(channel, expectedCount) {
422+
await expect(page.locator("[data-build-path-tool]")).toHaveCount(expectedCount);
423+
await expect(page.locator("[data-build-path-release-channel]")).toHaveCount(expectedCount);
424+
const releaseChannels = await page.locator("[data-build-path-release-channel]").evaluateAll((rows) => (
425+
rows.map((row) => row.getAttribute("data-build-path-release-channel"))
426+
));
427+
expect(releaseChannels.every((releaseChannel) => releaseChannel === channel)).toBe(true);
428+
}
429+
430+
async function selectBuildPathFilter(channel) {
431+
await page.locator(`[data-toolbox-status-filter='${channel}']`).click();
432+
for (const releaseChannel of ["planned", "wireframe", "beta", "complete"]) {
433+
await expect(page.locator(`[data-toolbox-status-filter='${releaseChannel}']`)).toHaveAttribute(
434+
"aria-pressed",
435+
String(releaseChannel === channel),
436+
);
437+
}
438+
}
439+
440+
try {
441+
await workspaceV2CoverageReporter.start(page);
442+
await setServerSession(server, MOCK_DB_KEYS.users.user1);
443+
await page.goto(`${server.baseUrl}/toolbox/index.html`, { waitUntil: "networkidle" });
444+
await page.locator("[data-tools-view='build-path']").click();
445+
446+
await expect(page.locator("[data-toolbox-status-filter]")).toHaveText([
447+
"Planned (28)",
448+
"Wireframe (4)",
449+
"Beta (5)",
450+
"Complete (1)",
451+
]);
452+
await expect(page.locator("[data-toolbox-status-filter='planned']")).toHaveAttribute("aria-pressed", "false");
453+
await expect(page.locator("[data-toolbox-status-filter='wireframe']")).toHaveAttribute("aria-pressed", "false");
454+
await expect(page.locator("[data-toolbox-status-filter='beta']")).toHaveAttribute("aria-pressed", "false");
455+
await expect(page.locator("[data-toolbox-status-filter='complete']")).toHaveAttribute("aria-pressed", "true");
456+
await expect(page.locator("[data-build-path-tool='Colors']")).toBeVisible();
457+
await expectBuildPathChannel("complete", 1);
458+
459+
await selectBuildPathFilter("planned");
460+
await expectBuildPathChannel("planned", 28);
461+
462+
await selectBuildPathFilter("wireframe");
463+
await expectBuildPathChannel("wireframe", 4);
464+
465+
await selectBuildPathFilter("beta");
466+
await expectBuildPathChannel("beta", 5);
467+
468+
expect(failedRequests).toEqual([]);
469+
expect(pageErrors).toEqual([]);
470+
expect(consoleErrors).toEqual([]);
471+
} finally {
472+
await workspaceV2CoverageReporter.stop(page);
473+
await server.close();
474+
}
475+
});
476+
395477
test("wireframe-only pages expose left center right accordion controls without runtime wiring", async ({ page }) => {
396478
const server = await startRepoServer();
397479
const failedRequests = [];

toolbox/tools-page-accordions.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -460,20 +460,17 @@ import { getSessionCurrent } from "../src/engine/api/session-api-client.js";
460460
}
461461

462462
function getBuildPathRows() {
463-
let order = 0;
464-
return buildPathGroups.flatMap((group) => group.tools.map((title) => {
465-
const tool = sourceToolByTitle(title);
466-
if (!tool) {
467-
return null;
468-
}
469-
order += 1;
470-
return {
471-
order,
463+
return registryTools
464+
.filter((tool) => tool.visibleInToolsList === true)
465+
.map((tool) => enrichTool(tool))
466+
.filter(isVisibleForStatusFilter)
467+
.sort((left, right) => (left.order ?? Number.MAX_SAFE_INTEGER) - (right.order ?? Number.MAX_SAFE_INTEGER) || left.title.localeCompare(right.title))
468+
.map((tool, index) => ({
469+
order: index + 1,
472470
status: tool.releaseChannel,
473471
statusLabel: tool.releaseChannelLabel,
474472
tool
475-
};
476-
}).filter(Boolean)).filter((row) => isVisibleForStatusFilter(row.tool));
473+
}));
477474
}
478475

479476
function createBuildPathSummary() {
@@ -673,7 +670,10 @@ import { getSessionCurrent } from "../src/engine/api/session-api-client.js";
673670
button.title = releaseChannelHelp(channel);
674671
button.textContent = `${releaseChannelLabel(channel)} (${counts[channel] || 0})`;
675672
button.addEventListener("click", () => {
676-
if (visibleReleaseChannels.has(channel)) {
673+
if (currentMode === "build-path") {
674+
visibleReleaseChannels.clear();
675+
visibleReleaseChannels.add(channel);
676+
} else if (visibleReleaseChannels.has(channel)) {
677677
visibleReleaseChannels.delete(channel);
678678
} else {
679679
visibleReleaseChannels.add(channel);

0 commit comments

Comments
 (0)