fix: Prompt to save PO as draft when navigating away with unsaved changes #30

Merged
shad0w merged 2 commits from claude/issue-18 into master 2026-06-19 06:59:26 +00:00
Owner

Automated fix by Claude Code for #18.

Closes #18

Review, merge, then create a release tag (vX.Y.Z) to deploy.

Automated fix by Claude Code for #18. Closes #18 Review, merge, then create a release tag (vX.Y.Z) to deploy.
shad0w added 1 commit 2026-06-18 23:47:46 +00:00
Both the PO create and edit screens now guard against accidental loss of
in-progress data. While a form has unsaved changes:

- in-app link clicks and the edit screen's Cancel button are intercepted,
  showing a dialog offering Save as Draft / Discard changes / Stay on page
- hard unloads (reload, tab close, external navigation) trigger the browser's
  native warning via beforeunload

"Save as Draft" reuses the existing draft-save action; validation errors are
surfaced in the dialog so the user can recover or discard. Dirty state is
tracked from any field edit, line-item change, or attachment change.

Adds useUnsavedChanges hook + UnsavedChangesDialog component and unit tests.

Fixes #18

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
shad0w added 1 commit 2026-06-19 06:59:20 +00:00
shad0w merged commit 405e3bfb5b into master 2026-06-19 06:59:26 +00:00
Sign in to join this conversation.
No description provided.