---
id: DFMOD-C1-POS-006
title: "Unsaved changes protection appears on in-app navigation and browser exit"
product: web
module: digital-form
type: functional
priority: P1
risk: high
status: draft
automationStatus: planned
sourceRefs:
  tsd: PK141
  tsdSection: C1
  tsdScenario: C1.4
  prd: PK141
  jira: null
automationRef: null
lifecycleStatus: active
lifecycleReason: "AI-generated draft from PK141 TSD C1.4; pending QA review."
lastReviewedAt: null
reviewedBy: null
supersededBy: null
duplicateOf: null
blockedBy: null
preconditionRefs:
  - PRE-DF-cp-editing-form
tags:
  - web
  - digital-form
  - form-modification
  - discard
  - client-portal
  - pk141
  - staging
---
## Objective
Verify the unsaved-changes confirmation appears for both in-app navigation and browser exit, with Cancel and Leave behaving correctly.

## Preconditions
- See [[PRE-DF-cp-editing-form]]
- And the user has unsaved changes

## Steps
1. Attempt to leave via breadcrumb, internal navigation, browser refresh, close tab, or browser back
2. Choose Cancel; in a separate run, choose Leave

## Expected Result
- Then the system shows a confirmation that changes will be lost
- And Cancel keeps the user editing
- And Leave discards all unsaved changes
- And after discard, re-opening returns to the last saved state (not partial)

## Source Traceability
- TSD: PK141
- Section: C1 - Unsaved Changes Protection
- Scenario: C1.4 - Unsaved changes protection on navigation and browser exit
- Acceptance Criteria: PRD C.2 Scenario 1-6, C.3 Scenario 1-4

## Evidence Required
- Screen recording of confirmation across exit paths; Cancel and Leave outcomes.

## Notes / Gaps
- Rapid navigation while the modal shows must not corrupt data (Testing Concern TC-11, Medium).
