|
| 1 | +# PR_26163_053-account-controls-user-scope-and-aside-stack |
| 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_053-account-controls-user-scope-and-aside-stack`. |
| 13 | +- PASS - Account side nav accordions now stack top/bottom in one aside column. Evidence: `assets/theme-v2/partials/account-side-nav.html` uses `class="accordion-stack"` and `data-account-side-nav-accordion-layout="stacked"`. |
| 14 | +- PASS - Account Pages and Account Guidance stack top/bottom. Evidence: targeted Playwright measures both accordions with matching x-position and Guidance below Pages. |
| 15 | +- PASS - User Controls profiles created by one user are not visible or editable by another user. Evidence: targeted Playwright creates User 1 and User 2 profiles, then verifies each user sees only their own profile. |
| 16 | +- PASS - Logout clears active user runtime state. Evidence: `account/user-controls-page.js` listens for session user/mode changes, clears capture state, reloads profiles and selected device from the active session, and clears profile UI when signed out. |
| 17 | +- PASS - User-control profiles are stored/read by user ownership through database adapter tables. Evidence: `input-mapping-mock-repository.js` filters `player_controller_profiles` and `selected_input_devices` by the active `playerId`. |
| 18 | +- PASS - Scope stayed limited to account side-nav layout, account/user-controls profile ownership/session behavior, targeted tests, and required reports. |
| 19 | + |
| 20 | +## Changed Files |
| 21 | + |
| 22 | +- `account/user-controls-page.js` |
| 23 | +- `assets/theme-v2/partials/account-side-nav.html` |
| 24 | +- `src/dev-runtime/persistence/tool-repositories/input-mapping-mock-repository.js` |
| 25 | +- `src/dev-runtime/server/mock-api-router.mjs` |
| 26 | +- `tests/playwright/tools/InputMappingV2Tool.spec.mjs` |
| 27 | +- `docs_build/dev/reports/playwright_v8_coverage_report.txt` |
| 28 | +- `docs_build/dev/reports/PR_26163_053-account-controls-user-scope-and-aside-stack.md` |
| 29 | +- `docs_build/dev/reports/codex_review.diff` |
| 30 | +- `docs_build/dev/reports/codex_changed_files.txt` |
| 31 | + |
| 32 | +## Implementation Notes |
| 33 | + |
| 34 | +- `account-side-nav.html` now uses the same single-column accordion stack pattern as the working Toolbox side menu pattern. |
| 35 | +- `account/user-controls-page.js` reads the current session user, refuses profile persistence when no user is active, clears stale UI state on logout/session changes, and reloads User Controls data for the new active user. |
| 36 | +- `input-mapping-mock-repository.js` no longer falls back to User 1 for user-owned controller profile writes. User-owned writes require an active user, while game-owned mapping/custom-action audit fields use the Forge Bot audit user when unauthenticated. |
| 37 | +- `mock-api-router.mjs` passes the active session user as a live getter so existing repository instances resolve ownership against the current session. |
| 38 | + |
| 39 | +## Search Evidence |
| 40 | + |
| 41 | +- PASS - `rg -n "left-right|data-account-side-nav-accordion-layout" assets/theme-v2/partials/account-side-nav.html tests/playwright/tools/InputMappingV2Tool.spec.mjs` shows the active account side nav layout as `stacked`, with no active `left-right` account-side-nav partial usage. |
| 42 | +- PASS - `rg -n "<style|style=|onclick=|onchange=|oninput=|onsubmit=" assets/theme-v2/partials/account-side-nav.html account/user-controls.html account/user-controls-page.js` returned no matches. |
| 43 | +- PASS - `rg -n "Login required to save User Controls profiles|Signed out\\. User Controls profile data cleared" src/dev-runtime/persistence/tool-repositories/input-mapping-mock-repository.js account/user-controls-page.js` confirms signed-out profile writes and stale signed-out UI state are handled explicitly. |
| 44 | + |
| 45 | +## Impacted Lanes |
| 46 | + |
| 47 | +- Account/User Controls runtime lane. |
| 48 | +- Account side-nav Theme V2 partial lane. |
| 49 | +- Dev-runtime mock DB repository/session ownership lane. |
| 50 | +- Targeted Playwright account and controls lane. |
| 51 | +- Workspace V2 validation lane. |
| 52 | + |
| 53 | +## Skipped Lanes |
| 54 | + |
| 55 | +- Full samples smoke: SKIP. The 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. |
| 56 | +- Engine core lane: SKIP. No `src/engine/input` or runtime engine behavior changed. |
| 57 | +- Broad visual regression lane: SKIP. The layout change is isolated to the account side-nav partial and covered by targeted Playwright assertions. |
| 58 | + |
| 59 | +## Validation Performed |
| 60 | + |
| 61 | +- PASS - Branch check: `git branch --show-current` returned `main`. |
| 62 | +- PASS - Syntax check: `node --check account/user-controls-page.js`. |
| 63 | +- PASS - Syntax check: `node --check src/dev-runtime/persistence/tool-repositories/input-mapping-mock-repository.js`. |
| 64 | +- PASS - Syntax check: `node --check src/dev-runtime/server/mock-api-router.mjs`. |
| 65 | +- PASS - Syntax check: `node --check tests/playwright/tools/InputMappingV2Tool.spec.mjs`. |
| 66 | +- PASS - Whitespace/static patch check: `git diff --check -- <changed files>`. |
| 67 | +- PASS - Targeted Playwright: `npx playwright test tests/playwright/tools/InputMappingV2Tool.spec.mjs --grep "User Controls|Account navigation"` passed 3 tests. |
| 68 | +- PASS - Workspace V2 validation: `npm run test:workspace-v2` passed 5 tests. |
| 69 | +- PASS/WARN - Playwright V8 coverage report produced at `docs_build/dev/reports/playwright_v8_coverage_report.txt`. |
| 70 | + |
| 71 | +## Playwright Result |
| 72 | + |
| 73 | +- PASS - Targeted Account/User Controls and Account Navigation coverage passed. |
| 74 | +- PASS - `npm run test:workspace-v2` passed. |
| 75 | + |
| 76 | +## V8 Coverage |
| 77 | + |
| 78 | +- PASS - Browser runtime coverage collected for `account/user-controls-page.js`: 93% function coverage reported. |
| 79 | +- WARN - `src/dev-runtime/persistence/tool-repositories/input-mapping-mock-repository.js` and `src/dev-runtime/server/mock-api-router.mjs` are Node/dev-runtime files and are not collected by browser V8 coverage. Their behavior is covered by the targeted Playwright/API flow and workspace validation. |
| 80 | + |
| 81 | +## Manual Validation Steps |
| 82 | + |
| 83 | +1. Open `/account/user-controls.html` as User 1. |
| 84 | +2. Confirm Account Pages and Account Guidance appear stacked vertically in the side nav. |
| 85 | +3. Create a User Controls profile for User 1 and save it. |
| 86 | +4. Log out and confirm the User Controls profile UI clears. |
| 87 | +5. Log in as User 2 and confirm User 1 profiles are absent. |
| 88 | +6. Create a User 2 profile, save it, and switch back to User 1. |
| 89 | +7. Confirm User 1 can see/edit only User 1 profiles and User 2 can see/edit only User 2 profiles. |
| 90 | + |
| 91 | +## Samples Validation Decision |
| 92 | + |
| 93 | +- SKIP - Full samples smoke was not run because this PR is scoped to account side-nav layout and User Controls ownership/session behavior, with no samples or game runtime changes. |
| 94 | + |
| 95 | +## Completion |
| 96 | + |
| 97 | +- PASS - Every requested item was implemented, validated, and explicitly marked PASS or documented as a safe skipped lane. |
0 commit comments