[PR #262] Admin Web: Explaining Saves With No Changes, and History Details You Can Read
This PR fixes the two admin-web items among the candidates left over from an earlier review. I approved it on 2026-11-22 with “go with the recommendations.” The branch was stacked on PR 261, which fixed the customer-app items the same day, so once PR 261 was merged first, only the admin-web changes were left in this PR.
The Claude lead session on my Windows computer (Claude Opus 5.5) handled tests, work instructions, documents, and checks, and Codex (gpt-6.1-terra) did three rounds of implementation and two runs of codex exec review (Codex’s code review command). One side writes the tests first and the other implements.
What was done and why
1. Saving device settings with nothing changed
When an admin saved the device settings dialog without changing anything, the server answered with a “no change” error (409). But the admin web showed only “Couldn’t save,” with no reason.
Now, before sending, the product, target stages, and in-use setting are compared with the current values; if they match, nothing is sent and “Nothing has changed” is shown. If the server answers with the same 409, the same notice is shown. The server was not changed (my decision).
2. History details shown as key: value
The details of device setting changes, count corrections, and input-record correction check notes appeared as raw program names and values, like stages: [2,3]. They now follow the same shape as the cycle date change history, which was already readable. For example: “Device setting change · Device B · Target stages 2 and 3 · In use · Setting version 2.”
What was chosen, and what was dropped
The first codex exec review made two valid points.
- The reason disappeared: For these two histories (device setting change, count correction), the server keeps the reason only in a different field,
meta.reason. The new text left that field out, so the reason vanished from the screen. The reason column now usesmeta.reasonwhen the usual field (item.reason) is empty. However, in the login-denied history,meta.reasonholds an error code, not a reason, so the fallback applies only to the two histories. The Claude lead session found this exception. - No way to tell which target: These histories have an empty customer column, so without the IDs you can’t tell which site or module they belong to. A short ID (the first 8 characters) was kept.
- Dropped alternative — showing names: the history response has no names, so the server would need to change.
The tests were adjusted too.
- Two existing tests that saved with nothing changed (device save, general save failure) would no longer send a request under the new rule. So that they keep checking what they were meant to, they now change one product name before saving.
- Two lines checking the new text were added to the e2e test (a test that opens a real browser and follows a flow) for editing a device’s product.
How it was checked
- Claude committed the tests first and confirmed they failed: 8 in round 1, 3 in round 2 (after review), and 1 in round 3 failed for the right reason before implementation.
- After Codex’s implementation, 63 tests in the two suites (groups of tests) passed. vitest (the test tool) wouldn’t start in Codex’s sandbox (an isolated run environment), so the Claude lead session ran them. The admin-web lint (code rule check) passed as well.
- The full
npm run verifypassed (6 min 22 s): admin web 502, customer app 811, server 862.npm run e2epassed 10 tests too (41 s). - One point from the second
codex exec reviewwas not fixed. If another admin changes the same device after the dialog is opened, saving with values equal to the dialog’s old values is blocked with “Nothing has changed.” It needs two admins editing the same device at once, which is rare, and closing and reopening the dialog starts from the new values. To remove it, drop the check before sending and rely only on the server’s 409.
Lesson
- A history’s “reason” may live in different fields depending on the history. Some keep it in
reason, others inmeta.reason. Before changing it, first look for histories that use the same field name for something else (login denied).