[PR #224·226·230·231·234·238] Before the Server: Six Admin Web Tasks Built on Fake Responses
I built the admin web screens for the third sub-milestone in six PRs, one after another. They are the screens where headquarters manages input materials and calculation standards, and looks over the records customers leave. The server features these screens call were being built at the same time in another work stream and did not exist yet. So every screen was built first on fake responses (MSW, a tool that imitates server responses in tests).
All six tasks ran the same way on my Windows computer. A Claude Code session (Claude Sonnet 5.5) handled the tests, work instructions, checks, documents and PRs, and Codex (gpt-6.1-terra, reasoning medium) wrote the code. The tests come first and the implementation is handed over after. The final review was codex exec review (Codex’s default model, name unknown), and I merged all six PRs.
What was built
| PR | What was built | Key behavior |
|---|---|---|
| 224 | Material types screen and four new menu items | Headquarters creates material names and turns them “on/off”. A material turned off still shows in past records. A duplicate name shows “That name already exists” next to the field; the button locks while saving, and the input stays if saving fails. Three screens for later tasks got their menu items first. |
| 226 | Calculation standard version screen | The standard for calculating the daily input amount is created as a “version” and approved. A draft sets how many times a day the input is split, the times and shares, and three standard tables. Rows copied from Excel can be pasted; a wrong row is refused with “Please check row n”. Pressing approve twice sends one request, and approved and past versions are view-only. |
| 230 | Material share table by days elapsed | On the same edit screen, each range of days elapsed gets materials and percentages. If they do not add up to 100 it shows “Total ○%” but can still be saved. If the material list fails to load, the rest of the screen and saving still work. |
| 231 | Three settings on the module tab | Days elapsed at the start, a count adjustment (base date, count, reason), and a site-level device table (A–D, each with its target stage). With no count record, or one older than 7 days, it shows “Check the count record”. |
| 234 | Work record lookup | Input, count, device input and refill records in one table. Filters stay in the address; the default is 7 days and the maximum 92. The detail view shows the version history and the calculation basis for that day’s plan, or “Could not calculate: reason” instead of an empty table. |
| 238 | Input correction review, and pages past the end | Headquarters sees the before and after values of a corrected input record and leaves one review note (1–500 characters); once noted, the button is gone. It also fixed the “list past the last page” issue from the PR 234 review (below). |
Choices made and alternatives dropped
- Server rules are not checked again on screen. Rules such as shares adding up to 100, times in order and overlapping ranges are left to the server; when it refuses, the screen shows that message. Rules kept in two places drift apart sooner or later.
- Approval is locked while there are unsaved edits. This keeps the approved version from differing from what is on screen. Saving automatically on approval was dropped because it doubles the failure handling.
- The share table groups rows of the same range together. A table that repeats the days elapsed on every row was dropped, because the numbers would have to match row by row and are easy to get wrong.
- The count warning shows only for modules in progress. Before the start, having no records is normal, so a warning there is just noise.
- The tests set the request and response shapes first. Shapes not yet in the shared types live as temporary types inside the admin web, and the server side matches them. Changing the shared types in these PRs would have collided with the other stream working at the same time.
- Claude chose some screen wording itself, in plain words. The design documents had no wording in some places, and Claude marked those in the PR as “needs owner check”.
A list past the last page
In the PR 234 review, Codex pointed out one problem. Suppose page 2 is bookmarked, and the 7-day window moves so there are fewer records; that page then has no items. The total count is above zero, yet the screen said “No work records match these filters”, and “Reset filters” cleared the filters instead of the page.
In PR 238 the screen now shows “The list changed and this page has no records” with a “Go to last page” button. The filters stay and only the page number moves to the last page. If the total is zero, the usual empty-result message appears. Sending the user to the last page automatically was dropped: the screen would change suddenly, and tests could not see the in-between state. It works the same way as the existing record list’s “Go to page 1” button.
How it was checked
Each PR ran the admin web tests, type checking (typecheck), code rule checks (lint), the full npm run verify, the browser tests (npm run e2e, 7 tests) and codex exec review.
- The admin web test count grew from 344 (PR 224) to 482 (PR 238), and all of them passed every time.
- The full
npm run verifytook about 9 to 13.5 minutes per run and passed every time. In PR 224 and 226, three customer app screen tests timed out under load, and all of them passed when run one at a time. npm run e2epassed all 7 tests in all six runs.codex exec reviewhad no findings for PR 224, 226 and 230. For PR 231 and 238 the findings were “the server does not accept this path yet”; the server stream was building those, so they were noted in the PR. For PR 234 the finding was the page number issue above.
What was not checked
- All six screens were tested only against fake responses. Whether the request and response shapes match the real server was not checked. Until the server builds that feature, the correction review screen shows a loading error and notes are not saved.
Lessons
- Write tests for late-appearing parts so they wait from the start. Tests that looked right away for rows or areas that only appear after the list arrives failed again and again in PR 230, 231 and 234. The implementation was right; only the tests were fixed. Claude noted in the devlog that thinking first about “parts that appear asynchronously” and “text that appears more than once” when writing tests first means fewer test fixes. In PR 238 no test needed fixing, and all 50 passed on the first try.
- In files with CRLF line endings (Windows-style line ends), regex replacements can silently miss. In PR 224 Claude used a script to update the expected list in an existing menu test, and the line-ending difference left it unchanged. Codex stopped twice saying “the tests and the instructions conflict”, and on the third run Claude fixed the test by hand and it passed. After a change like that, always check the result by eye.
- When a test disagrees with the work instructions, Codex stops before implementing. In PR 226 Claude wrongly wrote a test expecting removed values to come back when the number of fields was reduced and then increased, and Codex stopped, saying it conflicted with the instructions. The test was corrected to match the instructions and run again.
- Code written by Codex can have very long lines. One file had a 781-character line, so the line-wrapping tool (prettier) was run only on newly created files and put in a separate commit with no behavior change. Running it on existing files would have changed many unrelated lines, so they were left alone.
- Codex kept failing to commit. Codex’s isolated environment could not create the Git lock file, so in PR 224, 230, 231, 234 and 238 Claude made the commits in a copy and brought them over.