FE-M0-21 · A pool that opens a page, and the menu check from the roles page
ID FE-M0-21 · Level L0 · Run order row 25b · Why R-ACC-04, R-GATE-04, D3 · Issue #151
A signed-in user always works at a pool where their permissions open at least one page, never in an empty shell (R-ACC-04). The current pool is the one chosen in the pool switcher if it opens a page, else the first pool that does; the switcher lists only such pools. With none, the user gets the refusal page /no-access, which now says which case it is: no role at any pool, or roles that open no page. The per-role menu check in lib/nav.test.ts reads each system role's permissions and landing page from the generated roles page instead of a copy, so it follows pack G1: gate:write is held by super_admin, admin and satpam, and the viewer only reads the gate (R-GATE-04). Committed on web/session-check.
Before
Section titled “Before”- FE-M0-20 is Done, on the branch web/session-check. Block 1 checks messages.en.ts as FE-M0-20 left it.
- You are in ~/opleet-v2/opleet and git status --short prints nothing.
1 · Check the files this step replaces, then copy its files
Section titled “1 · Check the files this step replaces, then copy its files”shasum -a 256 -c ~/opleet-v2/packs/fe-pack-b2/FE-M0-21/BASE.sha256 && cp -R ~/opleet-v2/packs/fe-pack-b2/FE-M0-21/apps . && git status --short2 · Write the catalog again, then test, typecheck, lint and build
Section titled “2 · Write the catalog again, then test, typecheck, lint and build”pnpm --filter web i18npnpm --filter web testpnpm --filter web typecheckpnpm lintpnpm --filter web build3 · Commit
Section titled “3 · Commit”git add -A apps/webgit commit -m "feat(web): a pool that opens a page, and the menu check from the roles page (r-acc-04)"Expect
Section titled “Expect”- Block 1: seven lines ending in “: OK”, then M for apps/web/app/(shell)/layout.tsx, app/no-access/page.tsx, i18n/messages.en.ts, lib/access/server.ts, lib/nav.test.ts, lib/nav.ts and lib/shell/actions.ts.
- Block 2: “Keys: 96. With English: 96. Without: 0.”; “ℹ tests 41” and “ℹ pass 41”, among them “✔ the roles page lists the 11 system roles, each with its permissions”, “✔ R-GATE-04: super_admin, admin and satpam record at the gate; viewer only reads it”, “✔ R-ACC-04: only a pool that opens a page can be the current pool” and one “lands on … and sees the menus its v1 role sees” line per role; no type errors; “No fixes applied.”; the build lists the same routes as FE-M0-20.
- Block 3: the commit line with 8 files changed.
The shell's layout stays utilities (D35): run the three greps from FE-M0-10, with apps/web/app/login added to the folders. Expect the same as after pack D: the first lists one line, in components/shell/LanguageSwitcher.tsx (the switcher thumb's position, a runtime value); the second and third print nothing.
If it fails
Section titled “If it fails”- Block 1 prints “FAILED” for messages.en.ts only: FE-M0-20's block 3 didn't copy its file, or the file was edited since. Paste the FAILED lines and stop.
- A role's test fails with a different landing page or menu: the roles page and lib/nav.ts disagree. Paste the test's lines. The roles page is generated from the database (BE-M0-31) and is never edited by hand; lib/nav.ts is FE's.
- “the roles page lists the 11 system roles” fails: the roles page was regenerated with another layout. Paste its first table row; FE adjusts the reader in lib/nav.test.ts.
git reset --hard HEAD~1Before anything is pushed: it removes this step's commit and keeps FE-M0-20's.
Not run yet. Log each run as a comment on #151.