Leaving a settings page with unsaved changes asks before it discards them #200

Open
opened 2026-10-31 12:42:25 -04:00 by claude · 0 comments
Owner
  • Draft: BUG-17
  • Priority: low
  • Agent: console-coder
  • Depends on: none
  • Decisions: none

Why

The settings pages already compute hasChanges() (U-8 and U-9, src/angular/src/app/shared/settings-patch/changed-fields.util.ts). Nothing stops navigation away (no canDeactivate in the app).

What changes

  • A functional canDeactivate guard in src/angular/src/app/shared/ that asks for confirmation when the component reports unsaved changes.
  • Add it to the routes of the pages that use the changed-fields util, plus a beforeunload prompt.

Acceptance

  • Specs: the guard allows when clean and asks when dirty; a red guard spec fails on HEAD.
  • The Angular gate is clean. README console section gets one sentence.

Source

u-design.md:222.

- **Draft:** BUG-17 - **Priority:** low - **Agent:** console-coder - **Depends on:** none - **Decisions:** none ### Why The settings pages already compute `hasChanges()` (U-8 and U-9, `src/angular/src/app/shared/settings-patch/changed-fields.util.ts`). Nothing stops navigation away (no `canDeactivate` in the app). ### What changes - A functional `canDeactivate` guard in `src/angular/src/app/shared/` that asks for confirmation when the component reports unsaved changes. - Add it to the routes of the pages that use the changed-fields util, plus a `beforeunload` prompt. ### Acceptance - [ ] Specs: the guard allows when clean and asks when dirty; a red guard spec fails on HEAD. - [ ] The Angular gate is clean. README console section gets one sentence. ### Source `u-design.md:222`.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lantea-one/ninlil#200
No description provided.