[PR #116] Customer App Task 7: App Start and Access Check Screens
I requested this work.
- What was done: For the seventh task in the customer app plan, the three screens a signed-in user sees first were built. The app sends a request asking for the access status (
GET /me/access) and picks a screen from the result.- Terms re-consent: If there are terms to agree to again, the app redirects to the consent screen before looking at the module count.
- No connected modules (AUTH-03): With 0 modules, it shows a “no connected modules” notice, “Refresh connection status,” contacting the administrator, and sign out.
- Module cards (AUTH-04): With 1 or more modules, it shows the name, role, module cards, my info, and sign out. The home screen is built in sub-milestone 2, so the flow ends here.
- Suspended account (AUTH-02): It shows a notice, help, and a button to go to login. It sits outside login, so it sends no request to the server.
- Errors: A server or network error shows “Check your connection and try again” with a “Try again” button and does not sign the user out.
- Chosen approach:
- The access request only adds one
getMeAccess()line to the existing request helper. No new request code was written, and the handling of 401 (login expired), suspension and withdrawal is left to the existing helper and the session, so the screens do not deal with it. - The planned move-in date (
'2027-01-10') is turned into2027. 1. 10.by splitting the text on-(a pure function with no time-zone arithmetic). UsingDatecould shift the day depending on the time zone, so it was dropped. - “Try again” and “Refresh” first switch back to the loading state and then call the same
loadfunction again, so an earlier error message does not stay visible. The first implementation changed state directly insideload, which broke the lint rulereact-hooks/set-state-in-effect(a rule against changing state directly inside an effect) and failed CI; it was fixed to change state only after the response arrives (.then). - Role names use the names that already existed in
ko.ts(owner and staff). Two placeholder strings that were no longer used were removed.
- The access request only adds one
- Checks:
- Fizz’s 8 tests were run once before the implementation. All 8 failed because the screens were only placeholder text, and there was no error in the tests themselves. After the implementation the same 8 passed, and the test file was not edited.
- The cloud session has no Docker, so the full
npm run verify, which runs the server tests, could not be run to the end. App-side lint (0 errors), type checking, jest (12 files passed) and the terminology check were run directly and passed, and the final standard is GitHub CI (verify,e2e), which passed on the last commit. - The test file lacked the line that imports from
@jest/globals, so type checking failed and blockedverify. The instructions forbade editing the test file, so the implementing side could not fix it; Fizz fixed the import and the mock types.
| Item | Details |
|---|---|
| Built | Three access-check screens (AUTH-02, 03, 04) and the access request function |
| Screen choice | Terms re-consent → no modules / module cards; suspended account on its own screen; errors offer retry |
| Review | Honey (Haiku 5.5) findings applied; Opus medium finding (sign-out button) applied |
| Checks | 8 tests failed then passed; app-side lint, types and jest passed; CI (verify, e2e) passed |
| Needs the owner’s confirmation | The consent and my-info screens do not exist yet, so two buttons go to “not found” |
Who did what
- I: requested the work.
- Cloud session (Claude Sonnet 5.5): built the screens and fixed the review findings.
- Fizz (Fizz Codex): wrote the tests and fixed the test file’s problems and added the new test.
- Honey (Haiku 5.5): did a review, standing in because the usual reviewer, Pollen, could not be used.
- Claude (Opus 5.5): did a review.
- Claude (PL, Sonnet 5.5): coordinated the work, merged the pieces, tidied the PR and checked CI.
What the reviews found
- Honey’s finding: When a suspended account’s response (403) arrived, an error message flashed briefly before the app went to the suspended screen. If the error ends the session (
isSessionEnd), the screen now stays on loading instead of switching to the error state. The test was extended to check that no error message shows at the moment of the redirect, and it was confirmed that this test fails on the code before the fix. Also, the loading check was reduced to a singlegetByLabelText, a meaningless session-state comparison line was removed, and a comment explaining whyDelayedAccessScreenexists was added. - Opus’s finding (M1, medium): The server and network error screens had no sign-out button, so if the server kept failing, the user was stuck and could not even sign out. The same “Sign out” button as AUTH-03 and AUTH-04 was added to the error screen. Fizz first added a failing test (“you can sign out from the server and network error screens”), and it passed after the implementation. The original review file could not be read from the cloud session, so the fix follows what the instruction text said.
What needs the owner’s confirmation
The consent screen and the my-info screen do not exist yet, so until they do, “My info” and the terms navigation on AUTH-04 go to a “not found” screen. So a new terms version that requires re-consent must not be put on the server before the consent screen is built.
What I learned
When state is changed affects both lint and what the screen shows. Changing state only after the response arrives satisfied the lint rule and also stopped an error message from flashing before the suspended screen.