Treat a whitespace-only place description as no change #138
Loading…
Reference in a new issue
No description provided.
Delete branch "task-194-unchanged-form-discard-prompt"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes task 194. Diagnosed before fixing, by testing rather than reading — the ticket's own lead confirmed, the other two disproved:
PlaceForm.NormalizeDescriptionusedIsNullOrEmpty, notIsNullOrWhiteSpacelike the repository's own. Typing only spaces into a description read as dirty even against a form that opened with none — in both add mode and edit mode (storednulland stored legacy""both checked). Fixed by matching the repository's own threshold, so whatever would not actually persist as a description does not count as a change.PlaceFormhas exactly one host,PlaceFormPanel, whoseHandleSavedAsynccloses unconditionally after every successful save — there is no code path today where a saved form stays open to be dismissed from. CheckedPlaceForm.IsDirtydirectly instead, simulating what a future host that stayed open would do (re-render withPlaceupdated to the saved values): already correct, and now held by a committed test.group_idcannot change through this form) — already proven by an existing test, nothing to fix.Mutation-tested: reverted the threshold change, the three whitespace tests reddened; reverted nothing for the save-then-dismiss test (the code was already correct), so mutated
IsDirtyitself to compare against a frozen name instead of livePlace— reddened exactly that test, restored.Avoided
PlaceFormPanel.razor/.razor.cs/.cssentirely — PR #137 is mid-flight there.No ADR — a one-line threshold fix reversing an explicitly documented prior decision, argued in the code comment it replaces; not a shape-of-the-system decision.
1799 total / 1789 passing / 10 skipped (4 WebUI repro tests, 6 E2E — no browser in this environment).
dotnet format --verify-no-changesclean, coverage ratchet holds.Verdict: mergeable
IsDirty's remarks andNormalizeDescription's summary both restate the PR #126-era distinction and explain why it's now collapsed rather than silently dropping it. ADR-0112's "independent by design" language is about rule ownership (fixingIsDirtydoesn't touch what a save writes), not a promise the two thresholds stay different forever — still literally true, no metadata update needed.NormalizeDescriptionmyself (IsNullOrWhiteSpace→IsNullOrEmpty): the three named whitespace tests reddened with the expectedIsDirtyassertion failure, restored, green again.HandleSavedAsynccallsStartClosingAsync()unconditionally, no branch leaves a saved form open;PlaceForm.razor's group<select>is wrapped in@if (!IsEdit), confirmed no control renders in edit mode, matching the existing test.PlaceFormPanelwith a scratch bUnit test (typed whitespace, clicked the backdrop, confirmed no.place-form-panel-discard-confirmandOnClosefired) — not committed, but proves the fix holds through the real dismiss path, not just the predicate.dotnet format --verify-no-changesclean. Diff confirmed limited toPlaceForm.razor.csand its tests — noPlaceFormPanelfiles touched.0f472f0.