Skip to content

feat: Add navigation guard dialog for dirty drafts #298

Description

@lornakelly

Description

Implement a confirmation dialog that appears when users try to navigate away from a node with unsaved changes

Trigger when:

  • Selecting a different node while draft is dirty
  • Closing the side panel while draft is dirty
  • Selecting another node while draft is dirty

Dialog options:

  • Discard: Abandon changes and proceed with navigation
  • Keep editing: Cancel navigation and return to editing
  • No prompt when draft is clean
  • Implement for both light and dark modes
Image

Motivation

Users need protection against accidentally losing their work. When they've made changes but haven't saved, navigating away would silently discard those edits. The guard dialog makes the consequence explicit
and gives users a choice: commit to losing the changes or go back and save them. This is a standard pattern in editing interfaces (text editors, forms, etc.) that prevents frustrating data loss.

Proposed Implementation

No response

Definition of Done

  • Implementation: Fully implemented according to the Open Workflow spec.
  • Unit Tests: Comprehensive unit tests are included and passing.
  • Integration Tests: Verified within the monorepo and target environments (Web/VS Code).
  • Documentation: Updated README.md, ADRs, or official docs.
  • Performance: No significant regression in editor responsiveness.
  • Accessibility: UI changes comply with accessibility standards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions