Skip to content

Warn before leaving a blog editor with unsaved changes #39

Open

Description

@LunaStev

Motivation

BlogEditorPage reloads its form when the route slug changes and has no dirty-state navigation protection. Switching to another draft or leaving the page can discard text without warning.

Code references

Audit baseline: 50eb207.

Completion criteria

  • Track dirty state relative to the last successfully loaded/saved form, including metadata and Markdown.
  • Ask for confirmation on internal route changes and use the browser-supported unload warning for external navigation.
  • Do not warn after a successful save; retain dirty state and text after a failed save.
  • Test cancel/confirm navigation, switching drafts and normal post-save routing.

Scope and dependencies

Difficulty: easy.

Only unsaved-change protection. No localStorage draft copies, autosave, language selector or change to blog author permissions.

Backlog index: #12. Keep the change limited to this issue and include focused verification in the pull request.

Activity

  1. added
    enhancement
    good first issue
    help wanted
    blog
    priority medium
    needs testing
    on Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    blogenhancementgood first issuehelp wantedneeds testingpriority medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions