Editor: a page deleted before any draft offers its text as a scratch page
Fable's re-review of 14ab6a6, M-B. mayDraft admits a deleted page only when the person already has a draft on it, so a tab whose first autosave came after the delete got a 404, retried three times and showed Failed after about 17 seconds, with no bar and no way to keep the text; its close 404ed too. A 404 from the drafts route is now that state: nothing more is sent there, the status says Not saved, and the bar offers Save as a scratch page, a POST /scratch carrying the text (the existing route). Leaving offers it again beside Leave anyway, and a close makes the scratch page with one keepalive POST /scratch. L2: a bar's Save as a scratch page or Discard is no longer sent when the flush before it failed; the bar says so. Show the saved version does not go on a failed flush either: it offers Leave anyway. Gates: a saver.test.mjs case, red on the old saver; TestL9APageDeletedBeforeAnyDraftOffersAScratchPage (make browser), which never saw the offer on the old bundle.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7 files changed,
+174
−39
editor/notices.mjs+16 −1editor/page.mjs+34 −6editor/saver.mjs+38 −4editor/saver.test.mjs+17 −0internal/mapa/credits/assets.json+1 −1internal/mapa/static/{editor.de766a21852a1056.js => editor.d1d110338b29f15a.js}+27 −27internal/mapatest/editor_round4_browser_test.go+41 −0
editor/notices.mjsLoading diff…
editor/page.mjsLoading diff…
editor/saver.mjsLoading diff…
editor/saver.test.mjsLoading diff…
internal/mapa/credits/assets.jsonLoading diff…
internal/mapa/static/{editor.de766a21852a1056.js => editor.d1d110338b29f15a.js}Loading diff…
internal/mapatest/editor_round4_browser_test.goLoading diff…