Skip to content

Commit 749a720

Browse files
committed
Align account aside toggle behavior with Toolbox template left column - PR_26163_056-account-aside-template-toggle-alignment
1 parent 4655d7f commit 749a720

7 files changed

Lines changed: 474 additions & 170 deletions

File tree

assets/theme-v2/css/layout.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,10 @@ body.tool-focus-mode .tool-workspace--table-scroll-focus .tool-table-scroll-regi
387387
min-width: var(--space-0)
388388
}
389389

390+
.account-panel.is-left-collapsed {
391+
grid-template-columns: var(--tool-column-collapsed-width) minmax(var(--space-0), 1fr)
392+
}
393+
390394
.account-panel--fill {
391395
align-items: stretch;
392396
min-height: 100%
@@ -841,6 +845,10 @@ body.tool-focus-mode .tool-workspace--table-scroll-focus .tool-table-scroll-regi
841845
grid-row: auto
842846
}
843847

848+
.account-panel.is-left-collapsed {
849+
grid-template-columns: var(--one-column)
850+
}
851+
844852
.tool-column.is-collapsed .tool-column-header {
845853
height: auto;
846854
min-height: var(--space-0);

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,33 @@
568568
});
569569
}
570570

571+
function wireAccountSideNavigationCollapse(root) {
572+
const header = root.querySelector(".tool-column-header");
573+
if (!header || header.querySelector(".horizontal-accordion-toggle")) return;
574+
575+
const title = header.querySelector("h2, h3");
576+
const label = title ? title.textContent.trim() : "Account";
577+
const button = document.createElement("button");
578+
button.type = "button";
579+
button.className = "horizontal-accordion-toggle horizontal-accordion-toggle--left";
580+
button.dataset.accountSideNavCollapse = "";
581+
button.setAttribute("aria-label", "Collapse " + label);
582+
button.setAttribute("aria-expanded", "true");
583+
button.textContent = "<";
584+
header.insertBefore(button, header.firstChild);
585+
586+
button.addEventListener("click", function () {
587+
const collapsed = root.classList.toggle("is-collapsed");
588+
const accountPanel = root.closest(".account-panel");
589+
if (accountPanel) {
590+
accountPanel.classList.toggle("is-left-collapsed", collapsed);
591+
}
592+
button.textContent = collapsed ? ">" : "<";
593+
button.setAttribute("aria-expanded", collapsed ? "false" : "true");
594+
button.setAttribute("aria-label", (collapsed ? "Expand " : "Collapse ") + label);
595+
});
596+
}
597+
571598
function wireReturnToTop(root) {
572599
const button = root.querySelector("[data-return-to-top]");
573600
if (!button) return;
@@ -625,6 +652,7 @@
625652
wireAccountLogout(element);
626653
} else if (partialName === "account-side-nav") {
627654
markActiveAccountSideNavigation(element);
655+
wireAccountSideNavigationCollapse(element);
628656
} else if (partialName === "footer") {
629657
wireReturnToTop(element);
630658
}
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# PR_26163_056-account-aside-template-toggle-alignment
2+
3+
## Branch Validation
4+
5+
- Current branch: `main`
6+
- Expected branch: `main`
7+
- Branch validation: PASS
8+
9+
## Requirement Checklist
10+
11+
- PASS - Read `docs_build/dev/PROJECT_INSTRUCTIONS.md` before implementation.
12+
- PASS - Created PR scope `PR_26163_056-account-aside-template-toggle-alignment`.
13+
- PASS - Inspected `toolbox/_tool_template-v2/index.html` and current Toolbox left column behavior.
14+
- PASS - Mirrored the Toolbox left column collapse pattern for `account/user-controls.html` through the shared account side-nav partial wiring.
15+
- PASS - Added the missing right-side header toggle button beside the Account left-column heading.
16+
- PASS - Toggle collapses and expands the Account left column using the existing `horizontal-accordion-toggle`, `is-collapsed`, and `is-left-collapsed` class pattern.
17+
- PASS - Account Pages and Account Guidance remain stacked top/bottom in one vertical accordion stack.
18+
- PASS - Center column uses the remaining available width when the left column is expanded and when collapsed.
19+
- PASS - Existing Theme V2/tool accordion classes and shared partial behavior are reused.
20+
- PASS - No new accordion system was created.
21+
- PASS - No page-local CSS or inline styles were added.
22+
23+
## Changed Files
24+
25+
- `assets/theme-v2/css/layout.css`
26+
- `assets/theme-v2/js/gamefoundry-partials.js`
27+
- `tests/playwright/tools/InputMappingV2Tool.spec.mjs`
28+
- `docs_build/dev/reports/playwright_v8_coverage_report.txt`
29+
- `docs_build/dev/reports/PR_26163_056-account-aside-template-toggle-alignment.md`
30+
- `docs_build/dev/reports/codex_review.diff`
31+
- `docs_build/dev/reports/codex_changed_files.txt`
32+
33+
## Implementation Notes
34+
35+
- `toolbox/_tool_template-v2/index.html` uses `tool-workspace`, `tool-column`, `tool-column-header`, and `accordion-stack` for side columns.
36+
- Toolbox collapse behavior is injected by `assets/theme-v2/js/tool-display-mode.js` with `horizontal-accordion-toggle`, `is-collapsed`, and workspace `is-left-collapsed` classes.
37+
- Account pages do not host ToolDisplayMode, so the account side-nav partial is wired by `assets/theme-v2/js/gamefoundry-partials.js` using the same toggle class names, aria states, text indicators, and collapse classes.
38+
- `assets/theme-v2/css/layout.css` now includes `.account-panel.is-left-collapsed` so the account center card expands into the available space when the Account side column collapses.
39+
- The existing `assets/theme-v2/partials/account-side-nav.html` stacked left-column structure remains the account side-nav source of truth.
40+
41+
## Impacted Lanes
42+
43+
- Account/User Controls layout lane.
44+
- Theme V2 shared partial runtime lane.
45+
- Theme V2 account-panel layout lane.
46+
- Targeted Playwright account navigation lane.
47+
- Workspace V2 validation lane.
48+
49+
## Skipped Lanes
50+
51+
- Full samples smoke: SKIP. This PR does not change samples, sample JSON contracts, game runtime behavior, or sample launch paths; the user explicitly requested not to run full samples smoke.
52+
- Engine lane: SKIP. No engine or input runtime behavior changed.
53+
- Database/auth lane: SKIP. No DB, auth, or account persistence contracts changed.
54+
55+
## Validation Performed
56+
57+
- PASS - Branch check: `git branch --show-current` returned `main`.
58+
- PASS - Syntax check: `node --check tests/playwright/tools/InputMappingV2Tool.spec.mjs`.
59+
- PASS - Syntax check: `node --check assets/theme-v2/js/gamefoundry-partials.js`.
60+
- PASS - Static patch check: `git diff --check -- assets/theme-v2/js/gamefoundry-partials.js assets/theme-v2/css/layout.css tests/playwright/tools/InputMappingV2Tool.spec.mjs assets/theme-v2/partials/account-side-nav.html`.
61+
- PASS - Targeted Playwright: `npx playwright test tests/playwright/tools/InputMappingV2Tool.spec.mjs --grep "Account navigation"` passed 1 test.
62+
- PASS - Workspace V2 validation: `npm run test:workspace-v2` passed 5 tests.
63+
- PASS - Final targeted Playwright rerun generated changed-runtime-JS V8 coverage.
64+
65+
## Playwright Result
66+
67+
- PASS - Account left column mirrors Toolbox template side-column structure.
68+
- PASS - Account left column header includes the right-side collapse/expand toggle button.
69+
- PASS - Toggle collapses and expands the Account left column.
70+
- PASS - Account Pages appears above Account Guidance.
71+
- PASS - Center column fills remaining available width in expanded state.
72+
- PASS - Center column fills remaining available width in collapsed state.
73+
74+
## Coverage
75+
76+
- PASS - Playwright V8 coverage report produced at `docs_build/dev/reports/playwright_v8_coverage_report.txt`.
77+
- PASS - Changed runtime JS coverage collected for `assets/theme-v2/js/gamefoundry-partials.js`: 63% function coverage, with no low-coverage changed runtime JS warning.
78+
79+
## Search Evidence
80+
81+
- PASS - `rg -n "horizontal-accordion-toggle|is-left-collapsed|tool-column-header|tool-workspace" toolbox/_tool_template-v2/index.html assets/theme-v2/js/tool-display-mode.js assets/theme-v2/css/layout.css assets/theme-v2/css/accordion.css assets/theme-v2/css/panels.css` confirms the existing Toolbox/template collapse class pattern.
82+
- PASS - `rg -n "wireAccountSideNavigationCollapse|accountSideNavCollapse|is-left-collapsed|horizontal-accordion-toggle|tool-column-header|data-account-side-nav-accordion-layout|style=|<style|onclick=" assets/theme-v2/js/gamefoundry-partials.js assets/theme-v2/css/layout.css assets/theme-v2/partials/account-side-nav.html account/user-controls.html tests/playwright/tools/InputMappingV2Tool.spec.mjs` confirms the account wiring uses existing Theme V2 classes and no page-local style or inline handler additions.
83+
84+
## Manual Validation Steps
85+
86+
1. Open `/account/user-controls.html`.
87+
2. Confirm the left Account side column shows the Account heading with a collapse toggle button to the right.
88+
3. Confirm Account Pages appears above Account Guidance in the left accordion stack.
89+
4. Click the Account toggle and confirm the left column collapses.
90+
5. Confirm the User Controls center card fills the remaining available width.
91+
6. Click the Account toggle again and confirm the left column expands.
92+
7. Collapse/reopen Account Pages and Account Guidance to confirm accordion behavior still works.
93+
94+
## Samples Validation Decision
95+
96+
- SKIP - Full samples smoke was not run because this PR is scoped to account layout/partial toggle wiring and shared Theme V2 runtime, with no samples or game runtime changes.
97+
98+
## Completion
99+
100+
- PASS - Every requested item was implemented, validated, and explicitly marked PASS or documented as skipped where applicable.
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
assets/theme-v2/css/layout.css
2-
assets/theme-v2/partials/account-side-nav.html
2+
assets/theme-v2/js/gamefoundry-partials.js
33
tests/playwright/tools/InputMappingV2Tool.spec.mjs
4-
docs_build/dev/reports/PR_26163_055-account-aside-left-column-accordion-fix.md
4+
docs_build/dev/reports/playwright_v8_coverage_report.txt
5+
docs_build/dev/reports/PR_26163_056-account-aside-template-toggle-alignment.md
56
docs_build/dev/reports/codex_review.diff
67
docs_build/dev/reports/codex_changed_files.txt

0 commit comments

Comments
 (0)