Skip to content

Offer a saved draft instead of restoring it; drop it on confirmed Cancel - #114

Merged
codeling merged 3 commits into
mainfrom
jarvis/pensive-knuth-7lt6b8
Nov 5, 2026
Merged

codeling merged 3 commits into
mainfrom
jarvis/pensive-knuth-7lt6b8

Conversation

@codeling

@codeling codeling commented Nov 5, 2026

Copy link
Copy Markdown
Owner

What

  • Cancel drops the draft. When you leave the editor with Cancel and confirm the "unsaved changes" warning, the draft is removed. Before, the page-hide handlers wrote it again, so it came back the next time the editor was opened. If you decline the warning, the draft stays. Cancel without having touched an offered draft leaves that draft offered.
  • Drafts are offered, not auto-loaded. The editor shows the saved page text with a note "An unsaved draft from … is available." and the buttons Show changes (line diff against what the editor shows, toggled with Hide changes), Apply draft (inserted as typing, so Ctrl+Z undoes it) and Discard draft. The conflict warning (page changed since the draft was started) is kept.
  • The forms in the editor that reload the page ("Link the name in that page") still bring the typed text back without asking, since the visitor never left.

Notes

  • If you type while a draft is being offered, autosave replaces the stored draft (the offer stays usable on that page until reload).
  • German strings added; data-msg-restored became data-msg-available (plus show/hide/apply/unchanged messages).

Tests

  • autosave.spec.js rewritten for offer/apply/show changes/discard/Cancel (confirmed, declined, untouched); preview.spec.js adjusted.
  • Browser specs run locally in Chromium: autosave, editor, editor-keys, toolbar, dark-mode, shortcuts, dragdrop, editor-upload, editor-import, history, preview all pass.
  • Not run: the PHP suites (composer install of the dev dependencies failed in this environment). FormsTest was only changed for the renamed attribute and syntax-checked.

Generated by Claude Code

… with Cancel

The editor no longer puts a saved draft into the text field. It shows the
text of the page and a note that an unsaved draft is available, with buttons
to show the changes (a line diff), apply the draft (undoable) or discard it.
The forms of the editor which reload the page (linking a mention) still bring
the text back without asking.

Leaving the editor with Cancel and confirming the warning about unsaved
changes now removes the draft; before, the draft was written again when the
page was hidden, so it came back the next time.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFJFMQsAsMsE7UBcDahhFi
The draft offer refreshes the hints for the title of a new page when a draft is
applied, and the forms linking a mention keep the draft coming back unasked.
The test of a refused save looks for its own note, since new pages now show
another one.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFJFMQsAsMsE7UBcDahhFi
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFJFMQsAsMsE7UBcDahhFi
@codeling
codeling merged commit b5e4023 into main Nov 5, 2026
21 checks passed
@codeling
codeling deleted the jarvis/pensive-knuth-7lt6b8 branch November 5, 2026 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants