Skip to content

Commit 139a5fd

Browse files
author
DavidQ
committed
Remove Collision Inspector V2 custom template restyling and rely on shared Tool Starter CSS - PR_26139_009-collision-inspector-css-template-only
1 parent 4ca0110 commit 139a5fd

4 files changed

Lines changed: 81 additions & 390 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# PR_26139_009-collision-inspector-css-template-only
2+
3+
## Scope
4+
- Added the official First-Class Tool Starter V2 stylesheet to Collision Inspector V2.
5+
- Removed Collision Inspector V2 CSS rules that restyled Tool Starter/template foundations.
6+
- Kept only tool-specific Collision Inspector layout, result, canvas, legend, scroll, and fullscreen rules.
7+
- Preserved A/B rotate inputs, fixed three-decimal Origins output, scale normalization, and shared engine collision behavior from PR_26139_008.
8+
9+
## Template CSS Cleanup
10+
- Removed local `:root` theme variable declarations from `tools/collision-inspector-v2/styles/collisionInspectorV2.css`.
11+
- Removed local body/page shell styling.
12+
- Removed local global `button`, `input`, `select`, and `textarea` styling.
13+
- Removed local Tool Starter header, menu, panel, field, and output base styling.
14+
- Removed local accordion base styling.
15+
- Collision Inspector V2 now consumes `../templates-v2/styles/toolStarter.css` as the visual source of truth.
16+
17+
## Remaining Tool-Specific CSS
18+
- Equal-height open accordion groups for the left and right Collision Inspector panels.
19+
- Manifest summary, result badge, metrics, canvas viewport, canvas physical-size normalization, legend markers, scroll containers, and fullscreen Collision Inspector grid placement.
20+
- These rules are scoped to `collision-inspector-v2` selectors or specific tool element IDs.
21+
22+
## Validation
23+
- PASS: `node --check tests/playwright/tools/CollisionInspectorV2.spec.mjs`
24+
- PASS: `npx playwright test tests/playwright/tools/CollisionInspectorV2.spec.mjs --project=playwright --workers=1 --reporter=list`
25+
- Validates the template stylesheet link is present.
26+
- Validates Collision Inspector V2 uses Tool Starter structure/classes.
27+
- Validates Collision Inspector CSS does not redefine `:root`, body/page shell, global controls, Tool Starter base selectors, or accordion base selectors.
28+
- Validates left/right accordions still share vertical space evenly.
29+
- Validates A/B rotate inputs, fixed Origins output, scale normalization, collision modes, drag collision, zoom, logs accordion, missing dimensions failure, and workspace launch behavior.
30+
- PASS: `npm run build:manifest`
31+
- This repo does not define a plain `npm run build`; `build:manifest` is the available build script.
32+
- Removed generated `docs/build` output after validation.
33+
- PASS: `git diff --check`
34+
- Only CRLF working-copy warnings were reported.
35+
36+
## Full Samples Smoke Test
37+
- Skipped as requested. This PR is limited to Collision Inspector V2 CSS/template alignment and targeted visual/layout validation.
38+
39+
## Changed Files
40+
- `tools/collision-inspector-v2/index.html`
41+
- `tools/collision-inspector-v2/styles/collisionInspectorV2.css`
42+
- `tests/playwright/tools/CollisionInspectorV2.spec.mjs`

tests/playwright/tools/CollisionInspectorV2.spec.mjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ test.describe("Collision Inspector V2", () => {
4343
try {
4444
await page.goto(`${server.baseUrl}/tools/collision-inspector-v2/index.html?manifestPath=/games/Asteroids/game.manifest.json`, { waitUntil: "networkidle" });
4545
await expect(page.locator("body.tools-platform-tool-page[data-tool-id='collision-inspector-v2']")).toBeVisible();
46+
await expect(page.locator("link[href='../templates-v2/styles/toolStarter.css']")).toHaveCount(1);
4647
await expect(page.locator(".tool-starter__header[data-tool-starter-header]")).toBeVisible();
4748
await expect(page.locator("nav.tool-starter__menu.tool-starter__tool__menu")).toBeVisible();
4849
await expect(page.locator("nav.tool-starter__menu.tool-starter__workspace__menu")).toBeHidden();
@@ -56,6 +57,16 @@ test.describe("Collision Inspector V2", () => {
5657
await expect(page.locator("#collisionManifestInput")).toBeVisible();
5758
await expect(page.locator("label[for='objectARotationInput']")).toContainText("Object A Rotate");
5859
await expect(page.locator("label[for='objectBRotationInput']")).toContainText("Object B Rotate");
60+
const collisionCss = (await readFile(join(server.repoRoot, "tools", "collision-inspector-v2", "styles", "collisionInspectorV2.css"), "utf8")).replace(/\r\n/g, "\n");
61+
expect(collisionCss).not.toContain(":root {");
62+
expect(collisionCss).not.toMatch(/--tool-starter-[a-z-]+:/);
63+
expect(collisionCss).not.toMatch(/(^|\n)\s*body(?:\[|\.|\s|,|\{)/);
64+
expect(collisionCss).not.toMatch(/(^|\n)\s*button\s*(?:,|\{)/);
65+
expect(collisionCss).not.toMatch(/(^|\n)\s*input\s*(?:,|\{)/);
66+
expect(collisionCss).not.toMatch(/(^|\n)\s*select\s*(?:,|\{)/);
67+
expect(collisionCss).not.toMatch(/(^|\n)\s*textarea\s*(?:,|\{)/);
68+
expect(collisionCss).not.toMatch(/(^|\n)\s*\.tool-starter__(?:header|menu|panel|field|output)\b/);
69+
expect(collisionCss).not.toMatch(/(^|\n)\s*\.accordion-v2(?:[\s.#:{]|$)/);
5970

6071
await expect(page.locator("#manifestSummary")).toContainText("Asteroids");
6172
await expect(page.locator("#manifestSummary")).toContainText("7 objects loaded");

tools/collision-inspector-v2/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<link rel="stylesheet" href="../../src/engine/theme/main.css">
88
<link rel="stylesheet" href="../../src/engine/ui/hubCommon.css">
99
<link rel="stylesheet" href="../../src/engine/theme/accordionV2/accordionV2.css">
10+
<link rel="stylesheet" href="../templates-v2/styles/toolStarter.css">
1011
<link rel="stylesheet" href="./styles/collisionInspectorV2.css">
1112
<script type="module" src="./js/bootstrap.js"></script>
1213
</head>

0 commit comments

Comments
 (0)