[PR #21] Admin Web Plan and the Gaps in the Server Plan
- What changed: While writing the admin web plan, the server plan’s gaps (affiliation, role, modules, admin notes, and more) were fixed in the same PR.
- Decision: Affiliation data goes in a separate table, and for now only one line per person is allowed.
- Still unknown: If a person later needs several affiliations, the data must be moved and the server code changed.
This is the record of a PR in which, while writing the admin web development plan for sub-milestone 1, I found that the server plan written earlier was missing several things and fixed them in the same PR. No code changed; only the plan documents, edits to the spec and milestone, and this PR’s work log went in.
What I did and why
Claude wrote the admin web plan, the next item after the server plan (PR #20). Reading the admin web spec from start to end showed several things the server plan did not have.
- Each user has an affiliation (which organization they belong to) and a role (the range of things they may do).
- One registration saves the affiliation, modules (units of features opened to a user), and an admin memo (a note only admins see) together.
- Almost every change asks for a reason (150 characters).
- A number change asks for 3 verification methods and a consultation record number.
- There is a module code (a name that tells modules apart).
- A CSV (a table saved as comma-separated text) format is specified.
Server development had not started yet, so the server plan was fixed in the same PR.
| Output | Content |
|---|---|
| Admin web plan | A new plan (12 tasks) |
| Server plan | An “adjustments to match the admin web spec” section, data tables (affiliation table, module code, memo, last login), an admin API (the doorway through which the admin screens exchange data with the server), test changes in tasks 12 to 15, and the three approved items changed from “needs confirmation” to “approved” |
| Milestone document | Screen IDs 89 → 90 (the re-consent screen was added) |
During review I asked for the schedule to be moved earlier, and the change was reflected in the server plan, the admin web plan, and the milestone. This post does not list the specific dates.
Options considered
- The affiliation and role go in a separate affiliation table, with only one row per person allowed for now (my decision). Putting them straight into the user table is simplest now, but allowing several affiliations later would mean moving data and changing server code. With a constraint (a rule that blocks more than one row) on the affiliation table, extending it later only means lifting the constraint, and the work now is almost the same.
- The screen components are built by hand, using the browser’s built-in dialog (
<dialog>) (my decision). A UI component library such as Mantine was dropped. The screens are simple tables and input forms, so the library gains little, and it adds one more outside dependency to keep up with. - Tests are split into screen tests and four flows against a real server (my decision). Screen tests use MSW (a tool that fakes server responses), and flow tests use Playwright (a tool that drives a real browser automatically). The fake Google verifier for the flow tests lives only in a startup file under the server’s test folder, so it does not go into the production build. React Router is used in its simplest declarative mode, and TanStack Query (a tool that fetches and holds server data) handles server data.
- Two things differ from the spec. Removing a module or changing a role does not cut off an active session; the spec has the server re-read the assignment on every request, which would block access immediately. The extra admin login verification and the text-message states were removed, as the spec says.
- The server starts early, beginning with tasks that do not depend on the app (my decision). Starting all of the server at once was dropped, because the app plan was not written yet, and if the server API changes, as happened with the admin web, the code already built has to be fixed. Finishing the app plan first was also dropped, because it delays the start.
- The overall schedule was moved up by only one week, and the pilot start stayed as it was (my decision). Moving it up two weeks was dropped, because the three tracks would overlap for a long stretch, and an outside reply even one day late would push everything back.
- Two things were added during review (I approved them). Screen layout and wording follow the HTML mockup, and colors, fonts, and spacing are carried over as CSS variables. If the login ends while saving, the user is guided with “log in in a new tab → come back and save,” because going to log in in the same tab leaves the page and loses the input.
- The verification methods were unified to 3 (my decision). The recovery code had 2 and the number change had 3, but the server uses the same values, so both now read “call back / contract party / in person.”
How I checked
- Claude read sections 1 to 8 of the admin spec in full and matched the 41 screen and state rows to the tasks in the plan. The result is kept as a table in task 12.
- From the official docs and npm, I confirmed the three modes of React Router 8, the Google sign-in button (GIS)
initializeandrenderButtonand thecredentialin the callback, MDN on<dialog>(closing with Esc and browser support), and the latest library versions. - Whether focus returns after a
<dialog>closes is not in MDN, so it is left as “not confirmed,” and the plan has the focus returned by hand.
What I learned
- If the server plan is written before the screen spec, things get left out. This time it was before server development, so only documents had to be fixed.
- When writing the app plan, read the app spec through to the end first and check it against the server API.