Implement dirty-close unsaved changes dialog
Categories
(Calendar :: Calendar Frontend, enhancement)
Tracking
(Not tracked)
People
(Reporter: arschmitz, Unassigned)
References
(Depends on 2 open bugs, Blocks 2 open bugs)
Details
(Whiteboard: [calendar-ui-create-edit])
Summary:
Implement the Unsaved changes confirmation for closing a dirty create/edit dialog.
Links:
- Zeplin unsaved changes error state: https://app.zeplin.io/project/66dd0f2b2fe8f1b63cda36f1/screen/6a0f47193e23cd2704326eb2
- Zeplin error variant 06: https://app.zeplin.io/project/66dd0f2b2fe8f1b63cda36f1/screen/6a0f4719f1139fa048a9779e
- Zeplin error variant 07: https://app.zeplin.io/project/66dd0f2b2fe8f1b63cda36f1/screen/6a0f47199ad7d5f43e0d8c62
- Zeplin error variant 08: https://app.zeplin.io/project/66dd0f2b2fe8f1b63cda36f1/screen/6a0f4719f2eb9b39ca8f9fc5
- Interaction guide: Create > Quick actions: https://docs.google.com/document/d/15OpMthOHmBGyPpDBNRW8vp6CxeoitBp8n7Fti3LD10/edit?tab=t.why4m6lqup0#heading=h.qwdqcwauo1fg
Questions and concerns:
-
Confirm whether Zeplin error variants 06–08 are validation states owned by title/date/time stories or belong in this confirmation story.
-
Planning: Redux - Mapping To Existing Work
-
Planning: Questions - Q17 Ownership Of Zeplin Error Variants 06 Through 08
Acceptance criteria: -
A request to close a clean dialog follows the established close path. A request to close a dirty dialog opens an internal confirmation.
-
The confirmation renders from stable
storeObserverselections ofselectIsDirtyandselectDirtySectionsfor the current session. Do not use getters that pull state from the store or recompute field differences locally. -
The confirmation title is
Unsaved changes, communicates that changes will be discarded, and lists localized labels for the dirty sections. -
Confirmation-open state, focus trap, triggering-control reference, and background inertness are local dialog-controller state. They are not Redux state.
-
While the confirmation is open, the underlying dialog is inert and cannot receive pointer or keyboard interaction.
-
Back dismisses the confirmation, restores focus to the original close trigger, and preserves the draft.
-
Discard clears only the current session’s draft, closes without invoking Save or any calendar transaction, and prevents stale confirmation actions from closing a newer session.
-
The confirmation overlays the existing dialog without resizing, re-positioning, or calling
PositionedDialog. -
Field-level validation errors, helper text, and error variants remain owned by their relevant field stories.
-
Add focused tests for dirty/clean close routing, changed-section labels, inert background, Back and Discard behavior, session replacement while open, focus trap/restore, no-save close behavior, and axe coverage where supported.
Out of scope:
- Field-level validation UI, Save failures, generic modal infrastructure, dirty-section comparison rules, persistence, and direct calendar mutation.
Description
•