[PR #225·228·232·237·239·241·244] Building Seven Groups of Customer App Screens on Mock Responses First
This post groups seven customer app screen tasks (PRs 225, 228, 232, 237, 239, 241 and 244) into one. Shared parts came first, and on top of them we added, in order, the daily plan view, plan editing, input records, count changes, device input, and prep and history screens. For most screens the server endpoints did not exist yet or were still being built on another track (a separate line of work running at the same time), so the screens were built and tested on mock responses (fixed answers a test returns in place of the server).
All seven tasks ran on my Windows computer. A Claude Code session (Claude Sonnet 5.5) handled the tests, work instructions, verification, docs and PRs, and Codex (gpt-6.1-terra, reasoning medium) wrote the code. Claude writes the tests and Codex implements, and Codex did not edit the test files. The coordinating session that split the tracks and watched over them was Claude Opus 5.5. The final review was codex exec review (its model name is not in the devlog).
What we built
| PR | What | Key points |
|---|---|---|
| 225 | Shared parts | Round status labels (e.g. “13:00 planned”), copy and next actions for six reasons a plan could not be calculated, kg and L display functions, the “round total vs. daily total” check, and 16 customer request functions. All screen copy lives in one copy file. |
| 228 | Today’s plan screen | The daily total, the list of rounds with their buttons, the actual total, and copy and action buttons for blocked states. Three ways in: the care tab, a home card, and the card shown after a record is saved. |
| 232 | Plan editing | Time, amount and method per round, adding and removing rounds, and a required reason. Rounds already recorded or skipped are locked, and saving is blocked when the sum does not match the daily total. |
| 237 | Input record and post-record check | Actual time (up to 48 hours back), material lines, a memo, and “skip this round”. If saving fails, a draft (input the app keeps for a while) stays and the request is resent with the same request ID. |
| 239 | Count changes | List, record and edit changes such as decreases, send-outs and moves. Today’s plan screen now shows a block notice together with the existing plan. |
| 241 | Device input and refill | A list of device cards, device input records, and refill records (three steps inside one screen). |
| 244 | Prep, editing and history | Recording when a device was filled with material, editing a saved input record (saved as a new version), and viewing records by date with what changed per version (“before → after”). These match the response shapes of the server already merged in PR 236. |
Choices we made and alternatives we dropped
Don’t invent requests that don’t exist
There was no request yet that returns the list of material types a customer may choose. Three screens hit the same gap, and all three chose not to invent one.
- Plan editing: material types are shown but cannot be changed. The types already in the plan are sent as they are (split by the original ratio when there are several).
- Input record: only materials in today’s plan can be chosen. On a day with no plan, saving is locked with “material type needs checking”.
- Record editing: only amounts can be changed; material types cannot be changed or added. So a skipped round cannot be undone on this screen (undoing it would mean choosing a material).
The dropped alternative was using the admin material list. Its permissions are different, so the customer app must not use it. Where a response shape was not decided yet (that a new record ID comes back as id, the shape of one count-list row, and so on), the app keeps its own types and the devlog marks them as assumptions. Adding them straight to the shared types (definitions both server and app use) was dropped because it would tangle with the server track.
Round by converting to integers
- kg display:
formatKg(1.205)becomes1.21kgby usingMath.round((kg + Number.EPSILON) * 100) / 100.toFixed(2)gives1.20, because 1.205 is stored inside the computer as 1.20499…. - Plan total: whether the rounds plus the hand-given amount equal the daily total is compared as whole grams (
planSumDiffG). If not, it shows “○kg difference” and blocks saving. - Input and refill amounts: taken with one decimal place and compared as whole 0.1L units, so tiny decimal errors do not affect the 600L limit check.
- Input fields and display are separate: input fields keep up to three decimal places as typed, while read-only display shows two. What is sent is exactly what was typed. Codex asked about these digits mid-run, the coordinating session asked me, and I answered “both as recommended”.
Don’t draw another module’s late response
The today’s-plan response has no value (moduleId) saying which module (the unit a customer manages) it is for. So after switching from M1 to M2, a late M1 response could be drawn on the M2 screen.
- Every request key (the label the app stores a response under) includes the module number, and the previous value is not shown as a stand-in while the new response loads.
- Test: a late M1 response is not drawn on the M2 screen.
- The home card uses the same request key and shares the stored response. If it fails, only that card’s line changes and the rest of home stays.
- Dropped alternative: adding
moduleIdto the response. It would tangle with the server track.
When only part arrives, hide rather than show a wrong value
- If only the record list request fails, the plan stays visible, the actual total is hidden, and “couldn’t load records” is shown.
- “Recorded” appears only after the server confirms the save. On failure, input is not cleared and the button becomes “send again”.
- If someone else changed it first and there is a conflict, what you typed stays and the latest version is shown beside it.
- Nothing is preselected (type, target, where it was prepared, and so on), so a wrong default does not end up in a record. Only a single-option choice is preselected.
Other choices
- The three refill steps are steps inside one screen, not separate screen routes. Going back keeps the input.
- Count records are short, so no draft is stored; input and the request ID live only while the screen is open.
- Dates are sent as “the Korean date at that moment”, because the server works on Korean dates.
- After saving a plan,
router.replacegoes to today’s plan screen.router.back()was dropped because a screen opened directly may have nowhere to go back to.
How we checked
- Each task ran the tests for the changed parts. In the last task, 327 tests in 15 related suites passed. App type checks passed every time, and lint (code style checks) errors were 0.
- Full
npm run verifyran for all seven tasks. In three of them (PRs 225, 239, 244), a test this work did not touch failed once and passed when run alone. We think it is a timing issue when several tracks share the computer and it gets slow, but the cause was not confirmed. - The admin web did not change, so
npm run e2ewas not run. - Tests were written first and seen to fail, but mostly only as whole-file failures because the implementation file did not exist. The only individual tests seen actually failing were two new tests in PR 239.
- Claude edited Codex’s code directly in two lines: one lint error (PR 232), and one line so the prep button is not drawn on days without a plan (PR 244). The coordinating session accepted both as exceptions.
Review findings we did not fix this time
codex exec review found no major defects (P1) in the seven tasks and raised several minor ones (P2). Most are rare cases, so they were written in the PRs and not fixed this time. What stands out is the same kind repeating across screens.
| Finding | What happens | Direction of the fix |
|---|---|---|
| No input lock while saving (three screens) | Anything changed while a save request is in flight is lost when it succeeds. For prep records, after a failure where the response was lost, editing a value and resending with the same request ID makes the server return the first answer, so it looks like success even though the edit was not saved. | Lock input on resend, or use a new request ID when a value changes. |
| No maximum on Android’s time picker (two screens) | A time later than now can be chosen, and a server rejection shows only as a generic save failure. | Fix once in the shared time input part. |
| Phone time zone not Korea | A value made as midnight Korean date can show as the previous day in the date picker. | Handle dates independently of the time zone. |
| Restoring a plan draft, splitting materials | Locked rounds can be reordered, and splitting one round across several material types can produce a negative line from 1g rounding. | Not confirmed (the devlog gives no direction). |
| Edit button on skipped records | The button shows, but pressing it only shows a notice. | Add one condition line. |
What we could not check
- Most screens were checked only against mock responses, not real server responses. Places that assumed a response shape need to be matched again once the server is ready.
- No check on a real phone was done.
What we learned
- Don’t invent what isn’t there; reduce the feature instead. When a request is missing, “show only” or locking the save is safer than borrowing a list with different permissions.
- Compare values where the boundary matters, like limits, as integers. Fixing a unit such as 1g or 0.1L keeps decimal errors out of the check.
- Tests can be wrong too. Tests Claude wrote caused three problems: a test with a value smaller than 1g that contradicted the “round to grams” rule (Codex stopped and reported it), a “same ID on resend” test that passed for free as
undefined === undefinedbecause there was no random-ID stand-in (a fake part), and an instruction saying “the button is always shown” that clashed with existing tests counting buttons. Before writing instructions, line up the calculation rules, the test values, and what existing tests count. - When the same finding repeats on every screen, fix it in the shared part. The save-time input lock and the time limit are better fixed once in a shared place than screen by screen.