Add unsaved-changes guard to four edit pages

Task 12500 · Done · Coder · created · updated

Found while verifying Task 12467 (edit pages on useEditRecord + useSubmit) on dev: only AutomationEditPage asks before leaving with unsaved edits ("Unsaved changes — Cancel / Discard / Save", `hooks/useLeaveGuard`). The other routed edit pages drop a half-typed draft silently on any navigation (sidebar link, list row, breadcrumb). Suggestions: 1. ProjectEditPage: guard leaving with a dirty draft (it already tracks `seeded.pristine`), with the same dialog as AutomationEditPage; Save in the dialog runs the page's own Save. 2. FeatureEditPage: same, dirty = draft differs from `base`. 3. PlaybookEditPage: same, dirty = `useBaselineDirty`'s `dirty`. 4. AccountEditPage (edit mode): same, for EditAccountForm's touched fields. 5. Consider folding the guard into the shared edit-page pair (beside `useEditRecord`/`useSubmit`) so every edit page gets it from one place. Out of scope: changing AutomationEditPage's guard; any other page layout or copy. Done means: - On dev, typing in each of the four pages then clicking a sidebar link shows the Unsaved changes dialog; Discard leaves, Cancel stays, Save saves then leaves. - Each page's vitest suite covers the guard.

Outcome

Unsaved-changes guard (Cancel/Discard/Save) on Project, Feature, Playbook and Account edit pages; vitest covers each; quick gate green; visual check on the local stack showed the dialog and all three choices working. PR #7702 queued to the merge lane.

Pull request

Artifacts

Activity

  • Created
  • Run
  • Runner started
  • Runner ended (done)