Skip to content

Commit fe34a77

Browse files
committed
Standardize tool form table layout width behavior - PR_26156_121-tool-form-table-layout-standard
1 parent 6f6cb03 commit fe34a77

7 files changed

Lines changed: 142 additions & 11 deletions

File tree

assets/theme-v2/css/tables.css

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,25 @@ td {
3535
text-transform: uppercase;
3636
letter-spacing: var(--letter-spacing-brand)
3737
}
38+
39+
.tool-form-table {
40+
width: 100%
41+
}
42+
43+
.tool-form-table th[scope="row"] {
44+
width: 1%;
45+
white-space: nowrap;
46+
text-align: right;
47+
vertical-align: top
48+
}
49+
50+
.tool-form-table td {
51+
width: auto
52+
}
53+
54+
.tool-form-table input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
55+
.tool-form-table textarea,
56+
.tool-form-table select {
57+
box-sizing: border-box;
58+
width: 100%
59+
}

docs_build/dev/codex_commands.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,3 +671,31 @@ Required reports:
671671
- `docs_build/dev/reports/testing_lane_execution_report.md`
672672
- `docs_build/dev/reports/codex_changed_files.txt`
673673
- `docs_build/dev/reports/codex_review.diff`
674+
675+
676+
## PR_26156_121
677+
678+
Changes:
679+
- Read `docs_build/dev/PROJECT_INSTRUCTIONS.md`.
680+
- Added reusable `.tool-form-table` Theme V2 CSS in `assets/theme-v2/css/tables.css`.
681+
- Updated `toolbox/game-design/index.html` Project Design table to opt into `data-table tool-form-table`.
682+
- Kept Project Design labels compact and right-aligned through the reusable Theme V2 table pattern.
683+
- Kept Project Design input controls stretching across the available input column through the reusable Theme V2 table pattern.
684+
- Set both Project Design textarea controls to `rows="4"`.
685+
- Added targeted Game Design Playwright/MSJ coverage for layout width, compact/right-aligned labels, input-column fill, and textarea rows.
686+
- Did not add inline styles, style blocks, script blocks, inline event handlers, page-local CSS, or tool-local CSS.
687+
- Did not modify unrelated Game Design sections.
688+
- Did not modify `start_of_day`.
689+
690+
Validation:
691+
- `node --check tests/playwright/tools/GameDesignMockRepository.spec.mjs`
692+
- `npm run test:lane:game-design`
693+
- Scoped `git diff --check` for changed implementation/test/report files.
694+
- Targeted changed-file scan confirmed no inline styles, style blocks, inline scripts, inline event handlers, or `start_of_day` file changes were introduced.
695+
- Full samples smoke: skipped by request.
696+
697+
Required reports:
698+
- `docs_build/dev/reports/tool-form-table-layout-standard-report.md`
699+
- `docs_build/dev/reports/testing_lane_execution_report.md`
700+
- `docs_build/dev/reports/codex_changed_files.txt`
701+
- `docs_build/dev/reports/codex_review.diff`

docs_build/dev/commit_comment.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Convert Game Design Project Design form to Theme V2 table - PR_26156_120-game-design-project-design-table
1+
Add reusable Theme V2 tool form table layout - PR_26156_121-tool-form-table-layout-standard

docs_build/dev/reports/testing_lane_execution_report.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Testing Lane Execution Report
22

3-
Generated: 2026-06-05T12:57:13.655Z
3+
Generated: 2026-06-05T13:05:49.934Z
44
Dry run: No
55

66
## Summary
@@ -9,7 +9,7 @@ PASS: 1
99
WARN: 0
1010
FAIL: 0
1111
SKIP: 13
12-
Total lane elapsed time: 15.67s
12+
Total lane elapsed time: 16.48s
1313
Actual browser launches: 1
1414

1515
## Full Samples Smoke
@@ -107,7 +107,7 @@ Prevented Workspace lane reruns: 0
107107
| --- | --- | --- | --- | --- | --- | --- |
108108
| workspace-contract | SKIP | 0ms | 0 | Lane was not selected for this targeted run. | Root tools future-state navigation and Tool Template V2 contract | repo-served root tools page; Tool Template V2 future-state page; Theme V2 shared partials and assets |
109109
| project-workspace | SKIP | 0ms | 0 | Lane was not selected for this targeted run. | Project Workspace mock repository, Project Workspace UI, and Toolbox Progress/Build Path project-state bridge | repo-served Project Workspace page; repo-served Toolbox page with role simulation; in-memory SQL-shaped mock project repository |
110-
| game-design | PASS | 15.67s | 1 | Game Design rebuild slice validates the active project context, design save/update, actionable validation, capability demo authoring, and Toolbox progress handoff without exercising unrelated toolbox routes. | Game Design mock repository, project purpose flow, validation overlay, capability demo authoring, and Toolbox progress handoff | repo-served Game Design page; repo-served Toolbox Progress and Build Path views; in-memory SQL-shaped Game Design mock repository; Project Workspace mock project context |
110+
| game-design | PASS | 16.48s | 1 | Game Design rebuild slice validates the active project context, design save/update, actionable validation, capability demo authoring, and Toolbox progress handoff without exercising unrelated toolbox routes. | Game Design mock repository, project purpose flow, validation overlay, capability demo authoring, and Toolbox progress handoff | repo-served Game Design page; repo-served Toolbox Progress and Build Path views; in-memory SQL-shaped Game Design mock repository; Project Workspace mock project context |
111111
| game-configuration | SKIP | 0ms | 0 | Lane was not selected for this targeted run. | Game Configuration mock repository, Game Design handoff, configuration validation, user-facing output, and Toolbox progress handoff | repo-served Game Configuration page; repo-served Game Design page for handoff checks; repo-served Toolbox Progress and Build Path views; in-memory SQL-shaped Game Configuration mock repository; Game Design mock repository handoff |
112112
| build-path | SKIP | 0ms | 0 | Lane was not selected for this targeted run. | Toolbox Build Path simplification, workflow status table, and Admin Tools Progress navigation | repo-served Toolbox page; repo-served Admin Tools Progress page; Project Workspace mock project context; Toolbox role simulation |
113113
| tools-progress | SKIP | 0ms | 0 | Lane was not selected for this targeted run. | Admin Tools Progress hydration, Toolbox Group view color model, and Project Build Path separation | repo-served Admin Tools Progress page; repo-served Toolbox Group view; Toolbox registry build sequence; Project Build Path workflow table |
@@ -124,10 +124,10 @@ Prevented Workspace lane reruns: 0
124124

125125
| Lane | Duration | Test |
126126
| --- | --- | --- |
127-
| game-design | 3.20s | tests\playwright\tools\GameDesignMockRepository.spec.mjs:185:1 > Toolbox Build Path view shows the Game Design handoff |
128-
| game-design | 2.00s | tests\playwright\tools\GameDesignMockRepository.spec.mjs:80:1 > Game Design saves and updates design fields against the active project |
129-
| game-design | 1.70s | tests\playwright\tools\GameDesignMockRepository.spec.mjs:55:1 > Game Design shows an actionable overlay when project context is missing |
130-
| game-design | 1.60s | tests\playwright\tools\GameDesignMockRepository.spec.mjs:159:1 > Game Design authors capability demos as Project Workspace projects |
127+
| game-design | 3.70s | tests\playwright\tools\GameDesignMockRepository.spec.mjs:218:1 > Toolbox Build Path view shows the Game Design handoff |
128+
| game-design | 2.10s | tests\playwright\tools\GameDesignMockRepository.spec.mjs:80:1 > Game Design saves and updates design fields against the active project |
129+
| game-design | 1.80s | tests\playwright\tools\GameDesignMockRepository.spec.mjs:55:1 > Game Design shows an actionable overlay when project context is missing |
130+
| game-design | 1.50s | tests\playwright\tools\GameDesignMockRepository.spec.mjs:192:1 > Game Design authors capability demos as Project Workspace projects |
131131

132132
## Commands
133133

@@ -138,7 +138,7 @@ Prevented Workspace lane reruns: 0
138138
- SKIP
139139

140140
### game-design
141-
- PASS 15.67s C:\nvm4w\nodejs\node.exe C:\Users\davidq\Documents\GitHub\HTML-JavaScript-Gaming\node_modules\@playwright\test\cli.js test tests/playwright/tools/GameDesignMockRepository.spec.mjs --project=playwright --workers=1 --reporter=list
141+
- PASS 16.48s C:\nvm4w\nodejs\node.exe C:\Users\davidq\Documents\GitHub\HTML-JavaScript-Gaming\node_modules\@playwright\test\cli.js test tests/playwright/tools/GameDesignMockRepository.spec.mjs --project=playwright --workers=1 --reporter=list
142142

143143
### game-configuration
144144
- SKIP
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# PR_26156_121 Tool Form Table Layout Standard Report
2+
3+
## Scope
4+
5+
- Read `docs_build/dev/PROJECT_INSTRUCTIONS.md` first.
6+
- Updated `toolbox/game-design/index.html` Design Fields > Project Design form layout only.
7+
- Promoted the missing table/form behavior into reusable Theme V2 CSS under `assets/theme-v2/css/tables.css`.
8+
- Updated targeted Game Design Playwright/MSJ coverage for the reusable layout class and browser-measured layout behavior.
9+
- Did not modify unrelated Game Design sections.
10+
- Did not modify `start_of_day`.
11+
12+
## Reusable Theme V2 Pattern
13+
14+
- Added `.tool-form-table` as an opt-in table/form pattern for tool pages.
15+
- The reusable expectation for all tools is:
16+
- form tables use available panel width
17+
- row-header label cells stay compact
18+
- row-header labels align right
19+
- input cells fill remaining table width
20+
- select, textarea, and non-special input controls stretch to the available input-column width
21+
- The class is opt-in and does not change existing `.data-table` behavior unless a table also declares `.tool-form-table`.
22+
23+
## Game Design Changes
24+
25+
- Updated Project Design table class from `data-table` to `data-table tool-form-table`.
26+
- Set `gameDesignCapabilityNotes` from `rows="3"` to `rows="4"`.
27+
- Kept `gameDesignSummary` at `rows="4"`.
28+
- Preserved existing field names, control IDs, data hooks, labels, validation hooks, values, and form behavior.
29+
30+
## Validation Notes
31+
32+
- Impacted lane: `game-design`.
33+
- Shared Theme V2 CSS changed, but the new CSS is opt-in and only `toolbox/game-design/index.html` consumes it in this PR.
34+
- Skipped lanes: all other lanes, because no existing global table behavior was changed and no other tool opted into `.tool-form-table`.
35+
- Ran `node --check tests/playwright/tools/GameDesignMockRepository.spec.mjs`.
36+
- Ran `npm run test:lane:game-design`.
37+
- Ran scoped `git diff --check` for changed implementation/test/report files.
38+
- Ran a changed-file static scan confirming no inline styles, style blocks, inline scripts, inline event handlers, or `start_of_day` file changes were introduced.
39+
- Full samples smoke: skipped by request.
40+
41+
## Manual Test Notes
42+
43+
- Verified by targeted Playwright that Project Design uses `.tool-form-table`.
44+
- Verified the table width uses the available wrapper/panel width.
45+
- Verified the label column is compact and computed `text-align` is `right`.
46+
- Verified the select and textarea controls stretch across the input column.
47+
- Verified both Project Design textarea controls expose `rows="4"`.
48+
- Verified existing form controls still accept input and Save Game Design still updates the active project.

tests/playwright/tools/GameDesignMockRepository.spec.mjs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ test("Game Design saves and updates design fields against the active project", a
9191
const projectDesignTable = page.locator("[data-game-design-project-design-table]");
9292
await expect(projectDesignTable).toBeVisible();
9393
await expect(projectDesignTable).toHaveClass(/data-table/);
94+
await expect(projectDesignTable).toHaveClass(/tool-form-table/);
9495
await expect(projectDesignTable.locator("tbody tr")).toHaveCount(5);
9596
await expect(projectDesignTable.locator("th[scope='row'] label")).toHaveText([
9697
"Game Type",
@@ -117,6 +118,38 @@ test("Game Design saves and updates design fields against the active project", a
117118
{ cellCount: 2, controlId: "gameDesignSummary", controlTag: "textarea", labelFor: "gameDesignSummary", labelText: "Design Summary" },
118119
{ cellCount: 2, controlId: "gameDesignCapabilityNotes", controlTag: "textarea", labelFor: "gameDesignCapabilityNotes", labelText: "Capability Demo Notes" }
119120
]);
121+
await expect(page.locator("#gameDesignSummary")).toHaveAttribute("rows", "4");
122+
await expect(page.locator("#gameDesignCapabilityNotes")).toHaveAttribute("rows", "4");
123+
const projectDesignLayout = await projectDesignTable.evaluate((table) => {
124+
const wrapper = table.closest(".table-wrapper");
125+
const firstRow = table.querySelector("tbody tr");
126+
const labelCell = firstRow?.querySelector("th");
127+
const inputCell = firstRow?.querySelector("td");
128+
const select = firstRow?.querySelector("select");
129+
const textarea = table.querySelector("textarea");
130+
const tableBox = table.getBoundingClientRect();
131+
const wrapperBox = wrapper?.getBoundingClientRect();
132+
const labelBox = labelCell?.getBoundingClientRect();
133+
const inputBox = inputCell?.getBoundingClientRect();
134+
const selectBox = select?.getBoundingClientRect();
135+
const textareaBox = textarea?.getBoundingClientRect();
136+
return {
137+
controlColumnIsDominant: Boolean(labelBox && inputBox && inputBox.width > labelBox.width),
138+
labelColumnIsCompact: Boolean(labelBox && tableBox && labelBox.width < tableBox.width * 0.4),
139+
labelTextAlign: labelCell ? getComputedStyle(labelCell).textAlign : "",
140+
selectFillsInputColumn: Boolean(selectBox && inputBox && selectBox.width >= inputBox.width - 32),
141+
tableUsesWrapperWidth: Boolean(tableBox && wrapperBox && tableBox.width >= wrapperBox.width - 2),
142+
textareaFillsInputColumn: Boolean(textareaBox && inputBox && textareaBox.width >= inputBox.width - 32)
143+
};
144+
});
145+
expect(projectDesignLayout).toEqual({
146+
controlColumnIsDominant: true,
147+
labelColumnIsCompact: true,
148+
labelTextAlign: "right",
149+
selectFillsInputColumn: true,
150+
tableUsesWrapperWidth: true,
151+
textareaFillsInputColumn: true
152+
});
120153
await expect(page.locator("[data-game-design-output] pre, [data-game-design-output] code")).toHaveCount(0);
121154
await expect(page.locator("[data-game-design-output]")).toContainText("Design Summary");
122155
await expect(page.locator("[data-game-design-output]")).toContainText("Validation Status");

toolbox/game-design/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ <h3>Project Design</h3>
7171
</div>
7272
<form class="content-stack" data-game-design-form>
7373
<div class="table-wrapper">
74-
<table class="data-table" aria-label="Project Design fields" data-game-design-project-design-table>
74+
<table class="data-table tool-form-table" aria-label="Project Design fields" data-game-design-project-design-table>
7575
<tbody>
7676
<tr>
7777
<th scope="row"><label for="gameDesignType">Game Type</label></th>
@@ -91,7 +91,7 @@ <h3>Project Design</h3>
9191
</tr>
9292
<tr>
9393
<th scope="row"><label for="gameDesignCapabilityNotes">Capability Demo Notes</label></th>
94-
<td><textarea id="gameDesignCapabilityNotes" rows="3" data-game-design-capability-notes placeholder="Optional notes when this project demonstrates a specific capability."></textarea></td>
94+
<td><textarea id="gameDesignCapabilityNotes" rows="4" data-game-design-capability-notes placeholder="Optional notes when this project demonstrates a specific capability."></textarea></td>
9595
</tr>
9696
</tbody>
9797
</table>

0 commit comments

Comments
 (0)