Repository navigation
F13: Destructive-action guards + prefill-failure overwrite fix (#59) - #61
Merged
Merged
Conversation
added 2 commits
July 16, 2026 16:27
Follow-up to the mis-deplete incident (#57): one-way actions fired on a single click, and one silent-overwrite path existed. Confirm dialogs (window.confirm; styling revisits with #52): - Daily entry: Save & submit — freezes the day, creates egg lots. - Sales: Confirm order (allocates stock; void is #60) and Cancel draft (lines discarded). - Flocks: deplete and archive (one-way until reactivate, #57). Reversible actions (grade deactivate, line remove) stay one-click. Prefill-failure guard (daily entry): the edit-aware prefill was best-effort — if the lookup failed, the form showed zeros for a day that has data and saving would overwrite the existing draft. Prefill failure now shows an error, disables both save buttons, and offers a retry; saving unblocks only after a successful prefill. Verified in chromium against the real stack, both dialog paths each: dismiss leaves state untouched (flock stays Active, nothing submits, draft panel stays), accept proceeds (deplete, submit, cancel). Prefill verified by aborting the lookup: banner + disabled saves, retry after unroute re-enables. Closes #59
- Prefill retry no longer clears the blocked state optimistically: saves stay disabled from the moment a prefill is in flight until it succeeds (new prefillPending state) — the optimistic clear reopened the exact overwrite window the guard exists to close. (codex P1, pi High) - A retry that recovers for the same flock+date no longer zeroes the form: values typed while the banner was up survive (there is no server entry to overwrite); a normal date/flock change still resets. (pi Medium) - Sales confirms hoisted above run(): buttons no longer flash disabled while the user is deciding, matching the Flocks pattern. (pi Medium) - Cancel-draft dialog reworded: cancellation is a status change — the order keeps its lines and becomes read-only; "lines are discarded" was wrong. (codex P2) Re-verified in chromium: retry-while-broken stays blocked, typed values survive a retry recovery, normal date change still resets, recovery unblocks saving.
Owner
Author
Review round: codex + pi
Re-verified after fixes: retry while the network is still broken stays blocked; typed values survive a retry recovery; a normal date change still resets the form; recovery unblocks saving. |
This was referenced Jul 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #59. SPA-only, 3 files. Follow-up to the mis-deplete incident that motivated #57.
What
window.confirmfor now; styled dialogs belong to the UI design revamp — distinctive visual identity #52 revamp.Verification (chromium, real stack, both dialog paths each)