fix: warn before quitting with an unsaved event form [skip release]#28
Summary
Closes #8. A New/Edit event form with unsaved changes now blocks quit through the same beforeunload guard the composer uses, so quitting shows the native "Keep editing / Close anyway" prompt.
text
| 1 | <App> eventDirty -> existing beforeunload guard |
| 2 | <Workbench onEventDirtyChange> |
| 3 | <EventForm onDirtyChange> dirty = fields != initial values |
| 4 | <MeetingDialog onDirtyChange> |
| 5 | <EventForm onDirtyChange> |
Only a changed form blocks. Cancel, save, unmount or restoring the original values clears it. The prompt title changes to "Close with unsaved changes?".
Evidence
- Before: new App-level test in
src/workbench.test.tsxfails at "a changed new event form blocks quit". - After: passes for no form, pristine/dirty New and Edit forms, restored values and Cancel.
npm test,npm run buildandcheck:desktop(Windows) pass.
Not verified: native Ctrl+Q, tray Quit, Cmd+Q or logout with a dirty form.
Merge Danger
Door: two-way
Blast Radius: Calendar
View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.
Added 1 commit
- fix: warn before quitting with an unsaved event forma8d0382