[PR #187·191] App Record Edit, Exclude, and Revert: Keep What You Edited Even When the Server Refuses
Work completed 2026-11-07 08:43 KST · Published 2026-11-10 23:34 KST · AI model used for the work Claude Sonnet 5.5
In earlier work, the record detail screen only showed edit, exclude, and revert buttons. These two PRs made those buttons actually work: first editing and re-checking (PR 187), then excluding, reverting, rewriting, and the conflict screen (PR 191). Records are never overwritten; each change stacks a new version, so editing, excluding, and reverting are all “add one more version”. I requested both, and Codex wrote the tests first while Claude did the implementation, so the implementer never wrote its own tests.
Stage 1, edit and re-check (PR 187):
Tapping Edit on the detail screen opens the edit screen. It makes an edit draft (input not yet sent, kept on the phone for a while) from the server’s current version and saves to the draft as you edit. You can leave for another screen or restart the app and continue.
One function builds the body of the new version, and the rules live in that one place: a reason is required and up to 200 characters, at most 5 photos, and the re-check rules for measured values.
When the re-check screen receives a record number, it works as an edit re-check. An out-of-range value that did not change and was already confirmed stays “confirmed”; only values newly out of range are asked again. The re-check for new records is unchanged.
Methods chosen and alternatives dropped (PR 187):
Items no longer in use show as read-only fields and send their current values. Instead of changing the shared input form, the edit screen draws them itself, to keep the change small.
The draft is not saved before it has been read, and saving overwrites only an existing edit draft. This prevents overwriting before reading, and a cancelled draft coming back to life.
The screen remembers which module it opened with; switching to another module sends you home, without deleting that module’s draft.
Dropped alternative: showing a photo field when editing record kinds that have no photo field. The new-record screen has no such field, so photos already attached are only kept.
I decided the five wording changes on the edit screen (cancel edit, discard edits, reason for edit, and so on).
Stage 2, exclude, revert, and rewrite (PR 191):
One screen handles “exclude” a record, “revert” to an older version, and “rewrite” an excluded record. It takes one reason field (1 to 200 characters) and adds a new version with the existing version-stacking function.
The “revert” button at the top of the detail screen was removed, and each older-version row in the version list got “revert to this version”. The current-version row and excluded records do not get one.
Stage 3, when the server refuses (PR 191):
If the server refuses a submitted edit (someone else edited first, the record was already excluded, or no permission), the app fetches the latest detail again. If it is a conflict because someone edited first, it shows “latest content” and “my edits” side by side.
“Edit again on top of the latest” changes only the draft’s base version number. What you wrote stays as it is.
The draft is saved once before sending, and a conflict never deletes or overwrites it. Even if the server refuses, the input remains. Saving reuses the safe save function from Stage 1.
If the server answers “excluded record”, the app follows that answer even if the refetched detail is still the old one.
Methods chosen and alternatives dropped (PR 191):
No new edit form; the Stage 1 screen and function were reused. Splitting the conflict screen into its own route was dropped as unnecessary.
The shared button had no label for tests to find (testID), so this screen got a small dedicated button and the shared button was left alone.
Version names were changed to version N style to match the tests, consistent with the record history’s “reverted to version 1”.
How it was checked:
PR 187: the new tests (8 for the edit screen, 29 for the body function, 7 for detail) passed.
PR 191: the coordinator session ran Codex’s first tests itself, found four defects (a variable error, a comparison function that did not exist, an unfinished module switch, and mismatched input-field names), and had them fixed. It then confirmed, with a temporary blank screen, that the new tests failed only because the feature was missing, before handing over the implementation.
Right after implementation, one detail test still failed. It expected “rewrite” on a record whose current version was valid, a mistake on the test side. Codex corrected the test, and the implementer did not touch it. After that all 28 tests in the three files passed, and type checks, lint (code-rule checks, 0 errors), and the terminology check passed too.
Running all app tests at once, some files timed out when the computer was busy, but all passed when rerun one by one. They appear to be tests that were already flaky.
The two PRs at a glance
PR
Action
What it adds
Key method
187
Edit
A new version
Saves to the draft as you edit; re-checks only values newly out of range
191
Exclude
A new version (excluded)
One reason field (1-200 characters)
191
Revert
A new version (older content)
A button on each older-version row; not on the current version or excluded records
191
Rewrite
A new version
Only on excluded records
When the server refuses an edit
Server’s answer
What the app does
Draft
Someone else edited first
Refetches the latest detail and shows “latest content” and “my edits” side by side
Kept; “edit again” changes only the base version number
Already excluded
Refetches the latest detail and follows the server’s answer even if the detail is still old
Kept
No permission
Refetches the latest detail
Kept
Who did what
I: requested both pieces of work and decided the five wording changes on the edit screen.
Claude (Claude Sonnet 5.5): did the implementation for PR 187 and PR 191. For PR 191 it was Claude Code on my Windows computer. Claude Sonnet 5.5 also coordinated PR 187.
Codex: wrote the tests for both PRs first and corrected the test-side mistake itself. The logs record gpt-5.6-luna for PR 187 and GPT-5 for PR 191.
Coordinator session (PR 191): ran Codex’s first tests, found the defects, and had them fixed. This session’s model is not in the PR 191 log, so it could not be confirmed.
Not confirmed
For one record kind, the edit flow has no screen test.
Lessons
For a request the server may refuse, save the input before sending. Then even on a conflict, nobody has to type it again.
Do not ask again about an “already confirmed” value that did not change. Only changed values get re-checked.
Even a one-line wording change means waiting twice when the test owner and the implementer are separate. Getting the wording approved by me up front and putting it in the brief cuts that down.
Keeping the rule that whoever wrote the tests fixes them, and the implementer never touches them, makes it clear whose mistake it was.
In React Native tests, finding a title by heading works with role="heading", not accessibilityRole="header".
When automatic checks overlap with checks run by hand, tests become flaky.