feat(record-form): keep issues on their rows through list edits (PUI-126) #138
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/PUI-126-keep-issues-on-their-rows-through-list-edits"
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?
Issues now stay on their rows when list rows are added, removed or moved, so clearing on edit, the error summary and reveal all point at the row the message shows on.
Before: rows A, B, C, with issues on B and C. Remove A. The screen showed both messages correctly, but each issue still said "row 1" and "row 2". Fixing B's link (now row 0) cleared nothing, and fixing C's (row 1) cleared B's message.
Review guide
update:modelValuegets a second argument, aListChange { indexes }(old index → new,nullfor a removed row), for add, remove and move.field-change(path, change), including from nested rows and from a customfield:*slot'supdate(value, change?). A stray non-change argument is ignored.utils/cms: new publicclearIssuesAt(issues, path, change?).issuesitself when nothing changed.useRecordForm:clearIssuesis renamedclearIssuesAtand applies the helper. A functioninitial's result is copied too, and the copy is documented as a JSON copy.docs/cms/forms-and-validation.md, CHANGELOG (all unreleased entries amended).For you
pathafter a list edit. New objects would count as new issues: focus would jump and Repeater would re-file them.ListChangeandclearIssuesAt, and a second argument on Repeater'supdate:modelValue.field-changeon a list path without a change now drops that list's row issues. A row edit through a custom Repeater's row-slotupdate(patch)still clears the list's row issues, because no row path reaches the slot.Proof
useRecordForm+ RecordForm + list) cover the A/B/C remove case (B clears B; the summary shows only C), move, add, and row removal.bun run typecheck, lint and format pass.examples/vuetype-check: only the known SettingsForm error (#136).Review panel: changes + quality seats; their should-fix findings (a single public helper, reuse of
containsPath, custom-slot forwarding, duplicate objects) are fixed in6b1591aand5d25332.Choices made:
renumberIssueskept private; duplicates matched by object identity withouttoRaw(utils/cmsstays vue-free); Repeater computes the change (it knows the operation), RecordFields doesn't diff keys.Merge after #137 (this PR is stacked on it).
Closes PUI-126
Needs you: D1–D3 in the body. Merge after #137. CI green; stacked on the updated #137 branch (merged in at
03af860). 0.44.0 released Repeater and useRecordForm, so the CHANGELOG now says it all under## Unreleased(e9f990c): BreakingclearIssues→clearIssuesAt(with migration), Changed functioninitialcopied, Added renumbering,ListChangeandclearIssuesAt. The commits carry no!; under 0.x a breaking change counts as minor, the same asfeat, so the version is unaffected. Review panel round 1: changes and quality seats; should-fix items fixed in6b1591aand5d25332. Test files run separately all pass; typecheck, lint and format pass; the only playground type error is the one #136 fixes. Not checked in a browser.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.