Skip to content

Commit 8af1fbc

Browse files
committed
Improve disabled checkbox readability using Theme V2 styling - PR_26162_048-controls-checkbox-state-styling
1 parent f52bc10 commit 8af1fbc

8 files changed

Lines changed: 305 additions & 297 deletions

File tree

assets/theme-v2/css/colors.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@
7272
--forgebot-stage-background: radial-gradient(circle at 50% 55%, rgba(255, 122, 0, .25), var(--transparent) 48%), linear-gradient(145deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .025));
7373
--button-primary-background: linear-gradient(135deg, var(--orange), var(--button-primary-end));
7474
--button-cyan-background: linear-gradient(135deg, var(--button-cyan-start), var(--button-cyan-end));
75+
--checkbox-disabled-background: color-mix(in srgb, var(--white) 72%, var(--steel-gray));
76+
--checkbox-disabled-border: color-mix(in srgb, var(--iron-black) 28%, var(--steel-gray));
77+
--checkbox-disabled-check: var(--iron-black);
7578
--text: #f5f7fb;
7679
--muted: #aeb6c2;
7780
--orange: var(--molten-orange);

assets/theme-v2/css/forms.css

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,32 @@ input[type="radio"] {
106106
padding: var(--space-0)
107107
}
108108

109+
input[type="checkbox"]:disabled {
110+
appearance: none;
111+
box-sizing: border-box;
112+
display: inline-grid;
113+
place-content: center;
114+
border: var(--border-width-sm) solid var(--checkbox-disabled-border);
115+
border-radius: var(--radius-xs);
116+
background: var(--checkbox-disabled-background);
117+
opacity: 1;
118+
cursor: not-allowed
119+
}
120+
121+
input[type="checkbox"]:disabled::before {
122+
content: "";
123+
width: calc(var(--icon-size-sm) * .58);
124+
height: calc(var(--icon-size-sm) * .58);
125+
background: var(--checkbox-disabled-check);
126+
clip-path: polygon(14% 44%, 0 58%, 38% 96%, 100% 20%, 86% 8%, 36% 66%);
127+
transform: scale(0);
128+
transform-origin: center
129+
}
130+
131+
input[type="checkbox"]:checked:disabled::before {
132+
transform: scale(1)
133+
}
134+
109135
input[type="hidden"] {
110136
display: none
111137
}
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
# git status --short
2-
M docs_build/dev/reports/coverage_changed_js_guardrail.txt
2+
M assets/theme-v2/css/colors.css
3+
M assets/theme-v2/css/forms.css
4+
M docs_build/dev/reports/coverage_changed_js_guardrail.txt
35
M docs_build/dev/reports/playwright_v8_coverage_report.txt
46
M tests/playwright/tools/InputMappingV2Tool.spec.mjs
5-
M toolbox/controls/controls.js
6-
?? docs_build/dev/reports/controls-edit-row-in-place-fix-report.md
7+
?? docs_build/dev/reports/controls-checkbox-state-styling-report.md
78

89
# git ls-files --others --exclude-standard
9-
docs_build/dev/reports/controls-edit-row-in-place-fix-report.md
10+
docs_build/dev/reports/controls-checkbox-state-styling-report.md
1011

1112
# git diff --stat
12-
.../dev/reports/coverage_changed_js_guardrail.txt | 4 +-
13-
.../dev/reports/playwright_v8_coverage_report.txt | 14 ++-
14-
tests/playwright/tools/InputMappingV2Tool.spec.mjs | 116 +++++++++++++++++++++
15-
toolbox/controls/controls.js | 14 ++-
16-
4 files changed, 130 insertions(+), 18 deletions(-)
13+
assets/theme-v2/css/colors.css | 3 +++
14+
assets/theme-v2/css/forms.css | 26 +++++++++++++++++++
15+
.../dev/reports/coverage_changed_js_guardrail.txt | 3 +--
16+
.../dev/reports/playwright_v8_coverage_report.txt | 29 ++++++----------------
17+
tests/playwright/tools/InputMappingV2Tool.spec.mjs | 29 ++++++++++++++++++++++
18+
5 files changed, 66 insertions(+), 24 deletions(-)

docs_build/dev/reports/codex_review.diff

Lines changed: 172 additions & 264 deletions
Large diffs are not rendered by default.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# PR_26162_048-controls-checkbox-state-styling
2+
3+
## Branch Validation
4+
- PASS: current branch is `main`.
5+
- Expected branch: `main`.
6+
7+
## Requirement Checklist
8+
- PASS: Current enabled checkbox styling is unchanged. The new CSS is scoped to `input[type="checkbox"]:disabled` only.
9+
- PASS: Disabled checkboxes use a lighter gray Theme V2 background through `--checkbox-disabled-background`.
10+
- PASS: Disabled checked checkboxes use a black Theme V2 checkmark through `--checkbox-disabled-check`.
11+
- PASS: Disabled checkbox visibility/readability is preserved with `opacity: 1`.
12+
- PASS: Styling is implemented through reusable Theme V2 CSS in `assets/theme-v2/css/colors.css` and `assets/theme-v2/css/forms.css`.
13+
- PASS: No page-local CSS, inline styles, or tool-specific styling was added.
14+
- PASS: The pattern applies to the Controls Enabled, D, H, U, and DC columns because those cells render standard disabled checkboxes.
15+
- PASS: Future Theme V2 disabled Controls checkboxes using the same standard checkbox pattern inherit the styling.
16+
17+
## Changed Files
18+
- `assets/theme-v2/css/colors.css`
19+
- `assets/theme-v2/css/forms.css`
20+
- `tests/playwright/tools/InputMappingV2Tool.spec.mjs`
21+
- `docs_build/dev/reports/coverage_changed_js_guardrail.txt`
22+
- `docs_build/dev/reports/playwright_v8_coverage_report.txt`
23+
- `docs_build/dev/reports/controls-checkbox-state-styling-report.md`
24+
25+
## Impacted Lanes
26+
- Theme V2 shared forms styling.
27+
- Toolbox Controls runtime visual validation.
28+
- Playwright impacted: Yes.
29+
30+
## Validation Performed
31+
- PASS: `node --check tests/playwright/tools/InputMappingV2Tool.spec.mjs`
32+
- PASS: `git diff --check`
33+
- PASS: `npx playwright test tests/playwright/tools/InputMappingV2Tool.spec.mjs --grep "Toolbox Controls"`
34+
- WARN: `npm run check:style-system-guard` reported existing `missing-page:toolbox/localization/index.html`; no issue was reported for this PR's Theme V2 CSS or Controls page.
35+
36+
## Playwright Result
37+
- PASS: Targeted Controls Playwright test passed, including disabled checkbox rendered style checks for lighter background, black checked icon, and full opacity.
38+
39+
## V8 Coverage
40+
- Generated: `docs_build/dev/reports/playwright_v8_coverage_report.txt`
41+
- Note: This PR changes Theme V2 CSS and Playwright assertions, not runtime JavaScript. The coverage helper still reports advisory browser runtime coverage for the current repository HEAD.
42+
43+
## Skipped Lanes
44+
- Full samples validation skipped: samples are not in scope and no sample JSON or runtime sample behavior changed.
45+
- Full workspace suite skipped: this PR only changes reusable disabled checkbox styling and targeted Controls coverage validates the affected surface.
46+
- Broad visual sweep skipped: requested scope is Controls checkbox state styling, and the implementation is reusable Theme V2 CSS without page-local styling.
47+
48+
## Manual Validation Steps
49+
1. Open `/toolbox/controls/index.html`.
50+
2. Confirm the Game Controls table renders the Enabled, D, H, U, and DC checkbox columns.
51+
3. Confirm disabled unchecked checkboxes use a light gray fill and remain readable.
52+
4. Confirm disabled checked checkboxes use the same light gray fill with a black checkmark.
53+
5. Confirm enabled/editable checkbox behavior still uses the existing checkbox styling.
54+
55+
## Samples Decision
56+
- SKIP: Full samples validation was not run because this PR does not touch samples, sample JSON, game runtime, or sample launch behavior.

docs_build/dev/reports/coverage_changed_js_guardrail.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ 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-
(95%) toolbox/controls/controls.js - current PR changed runtime JS file with browser V8 coverage; executed lines 546/546; executed functions 57/60
10-
(89%) src/engine/input/NormalizedInputRegistry.js - reporter HEAD-baseline file with browser V8 coverage; not part of the current PR diff; advisory only
9+
(67%) toolbox/controls/controls.js - executed lines 546/546; executed functions 35/52
1110

1211
Guardrail warnings:
1312
(100%) none - no changed runtime JS coverage warnings

docs_build/dev/reports/playwright_v8_coverage_report.txt

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,40 +12,25 @@ 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-
(89%) Toolbox Index - exercised 3 runtime JS files
15+
(71%) Toolbox Index - exercised 3 runtime JS files
1616
(0%) Tool Template V2 - not exercised by this Playwright run
17-
(62%) Theme V2 Shared JS - exercised 2 runtime JS files
17+
(58%) Theme V2 Shared JS - exercised 2 runtime JS files
1818

1919
Changed runtime JS files covered:
20-
(95%) toolbox/controls/controls.js - current PR changed runtime JS file with browser V8 coverage; executed lines 546/546; executed functions 57/60
21-
(89%) src/engine/input/NormalizedInputRegistry.js - reporter HEAD-baseline file with browser V8 coverage; not part of the current PR diff; advisory only
20+
(67%) toolbox/controls/controls.js - executed lines 546/546; executed functions 35/52
2221

2322
Files with executed line/function counts where available:
24-
(11%) src/engine/input/InputMappingManifest.js - executed lines 78/78; executed functions 1/9
25-
(23%) src/engine/input/InputComboState.js - executed lines 173/173; executed functions 3/13
26-
(30%) src/engine/input/InputService.js - executed lines 451/451; executed functions 20/66
27-
(33%) src/engine/input/InputMap.js - executed lines 62/62; executed functions 3/9
28-
(40%) src/engine/input/MouseState.js - executed lines 57/57; executed functions 4/10
29-
(41%) src/engine/input/GamepadInputClassifier.js - executed lines 412/412; executed functions 14/34
30-
(43%) src/engine/input/KeyboardState.js - executed lines 34/34; executed functions 3/7
31-
(50%) src/engine/input/InputCaptureService.js - executed lines 163/163; executed functions 7/14
23+
(29%) src/engine/input/NormalizedInputRegistry.js - executed lines 321/321; executed functions 6/21
3224
(53%) src/engine/api/server-api-client.js - executed lines 159/159; executed functions 10/19
33-
(59%) src/engine/input/PointerDragState.js - executed lines 225/225; executed functions 13/22
34-
(60%) src/engine/input/InputCapabilityDescriptors.js - executed lines 261/261; executed functions 9/15
35-
(61%) assets/theme-v2/js/gamefoundry-partials.js - executed lines 625/625; executed functions 33/54
25+
(57%) assets/theme-v2/js/gamefoundry-partials.js - executed lines 625/625; executed functions 30/53
3626
(64%) assets/theme-v2/js/tool-display-mode.js - executed lines 209/209; executed functions 9/14
27+
(67%) toolbox/controls/controls.js - executed lines 546/546; executed functions 35/52
3728
(75%) toolbox/tool-registry-api-client.js - executed lines 152/152; executed functions 21/28
38-
(80%) src/engine/input/GamepadState.js - executed lines 100/100; executed functions 16/20
39-
(89%) src/engine/input/NormalizedInputRegistry.js - executed lines 321/321; executed functions 24/27
40-
(94%) account/user-controls-page.js - executed lines 961/961; executed functions 111/118
41-
(95%) toolbox/controls/controls.js - executed lines 546/546; executed functions 57/60
42-
(100%) account/user-controls.js - executed lines 2/2; executed functions 1/1
4329
(100%) toolbox/controls/controls-api-client.js - executed lines 12/12; executed functions 2/2
4430

4531
Uncovered or low-coverage changed JS files:
4632
(100%) none - no low-coverage changed runtime JS files
4733

4834
Changed JS files considered:
4935
(0%) tests/playwright/tools/InputMappingV2Tool.spec.mjs - changed JS file not collected as browser runtime coverage
50-
(89%) src/engine/input/NormalizedInputRegistry.js - reporter HEAD-baseline file with browser V8 coverage; not part of the current PR diff
51-
(95%) toolbox/controls/controls.js - current PR changed runtime JS file with browser V8 coverage
36+
(67%) toolbox/controls/controls.js - changed JS file with browser V8 coverage

tests/playwright/tools/InputMappingV2Tool.spec.mjs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,35 @@ test("Toolbox Controls shows game controls only and keeps presets wireframe safe
260260
await expect(primaryRow.locator("input[aria-label='U']")).not.toBeChecked();
261261
await expect(primaryRow.locator("input[aria-label='DC']")).not.toBeChecked();
262262
await expect(primaryRow.locator("td:has(input[aria-label='D'])")).toHaveAttribute("data-input-event-checked", "true");
263+
await expect(primaryRow.locator("input[aria-label='D']")).toBeDisabled();
264+
await expect(primaryRow.locator("input[aria-label='H']")).toBeDisabled();
265+
266+
const checkedDisabledCheckboxStyle = await primaryRow.locator("input[aria-label='D']").evaluate((input) => {
267+
const checkboxStyle = window.getComputedStyle(input);
268+
const checkStyle = window.getComputedStyle(input, "::before");
269+
return {
270+
backgroundColor: checkboxStyle.backgroundColor,
271+
checkBackgroundColor: checkStyle.backgroundColor,
272+
checkTransform: checkStyle.transform,
273+
opacity: checkboxStyle.opacity,
274+
};
275+
});
276+
const uncheckedDisabledCheckboxStyle = await primaryRow.locator("input[aria-label='H']").evaluate((input) => {
277+
const checkboxStyle = window.getComputedStyle(input);
278+
const checkStyle = window.getComputedStyle(input, "::before");
279+
return {
280+
backgroundColor: checkboxStyle.backgroundColor,
281+
checkTransform: checkStyle.transform,
282+
opacity: checkboxStyle.opacity,
283+
};
284+
});
285+
expect(checkedDisabledCheckboxStyle.backgroundColor).toBe(uncheckedDisabledCheckboxStyle.backgroundColor);
286+
expect(checkedDisabledCheckboxStyle.backgroundColor).not.toBe("rgba(0, 0, 0, 0)");
287+
expect(checkedDisabledCheckboxStyle.checkBackgroundColor).toBe("rgb(18, 18, 18)");
288+
expect(checkedDisabledCheckboxStyle.checkTransform).not.toBe("matrix(0, 0, 0, 0, 0, 0)");
289+
expect(checkedDisabledCheckboxStyle.opacity).toBe("1");
290+
expect(uncheckedDisabledCheckboxStyle.checkTransform).toBe("matrix(0, 0, 0, 0, 0, 0)");
291+
expect(uncheckedDisabledCheckboxStyle.opacity).toBe("1");
263292

264293
const aimRightRow = page.locator("[data-input-mapping-row]").filter({ hasText: "Aim Right" }).first();
265294
await expect(aimRightRow.locator("td").nth(0).locator("input")).not.toBeChecked();

0 commit comments

Comments
 (0)