oficina / mapa Public

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>
Paul Campbell pushed by paul@keymail.dev f39d6516dc9ef22e967e38a2a2c91bac23cf43d9 parent c7e7aa4
7 files changed, +174 −39
  • editor/notices.mjs +16 −1
  • editor/page.mjs +34 −6
  • editor/saver.mjs +38 −4
  • editor/saver.test.mjs +17 −0
  • internal/mapa/credits/assets.json +1 −1
  • internal/mapa/static/{editor.de766a21852a1056.js => editor.d1d110338b29f15a.js} +27 −27
  • internal/mapatest/editor_round4_browser_test.go +41 −0
editor/notices.mjs

Loading diff…

editor/page.mjs

Loading diff…

editor/saver.mjs

Loading diff…

editor/saver.test.mjs

Loading diff…

internal/mapa/credits/assets.json

Loading diff…

internal/mapa/static/{editor.de766a21852a1056.js => editor.d1d110338b29f15a.js}

Loading diff…

internal/mapatest/editor_round4_browser_test.go

Loading diff…