The page editor keeps a working copy of your unsaved edits so that an accidental refresh, a closed tab, or a browser crash doesn't throw away work in progress. When you reopen the same page in the editor, your unsaved changes are waiting where you left them.
What gets recovered
There are two kinds of unsaved edit, and they're preserved by two different mechanisms.
Field edits — content, styling, and section design
Text, headings, link URLs, class strings, toggles, and section-level design (background colour/image/video, texture, colour preset, dividers, animation, sticky header, etc.) are mirrored into the browser's localStorage as you edit, debounced so a burst of typing writes once. A final flush also runs when the tab is closing, so even the last keystrokes before a refresh survive.
On reopening the page, the editor overlays that saved draft back onto the freshly-loaded rows. Text comes back in place; background and texture edits trigger a one-time preview re-bake so the section renders exactly as you left it (they can't be patched in place the way text can, because they drive the section's CSS, not its text). The sidebar's design panel also re-reflects the recovered values.
Because this layer lives in localStorage, it is independent of your login cookie — it survives a session timeout, a logout, or a power loss, and is restored the next time you open that page in the same browser.
Structural edits — adding, removing, and reordering rows
Adding, deleting, duplicating, reordering rows (and edits to the page's underlying PHP) are preserved in your server-side editing session. With the default 24-hour session lifetime, an unsaved structural change is recoverable for up to a day, and across any refresh or tab-close within that window.
You're told what was recovered
Recovery is never silent. When the editor re-applies unsaved changes as a page opens, a blue banner says so ("Recovered unsaved changes from 5m ago."), with Show what changed to list them, Keep changes to carry on, and Discard to go back to the last-saved page.
If the page was saved in the meantime — from another tab, or by another editor — and your draft's sections differ from the saved page, the orange This page was changed outside your editing session banner appears instead, so you decide which version wins rather than either being silently overwritten: Discard mine loads the latest version, and Keep mine keeps yours (your next save then replaces the other changes with your version). See "The page was saved while your draft was waiting" below for what happens to field edits in that case.
What it does not cover
Recovery is a safety net for the "oops" moments, not a substitute for saving or for the Backups/Revisions system. Specifically:
- It's per-browser, per-device. Drafts live in the browser you were editing in. They do not roam to a different computer, a different browser, or a private/incognito window. (Draft import doesn't change this: your own unsaved changes are never offered back to you in another browser.)
- Clearing browser data removes field drafts.
localStorageis wiped if the user clears site data or edits in a private window that's then closed. - Structural changes are tied to the session window. Added/removed/reordered rows are recoverable for the session's lifetime (24 hours by default). If the session has ended when you return — a logout, or a return after that window — those structural changes are gone, even though your field edits (text, backgrounds) still come back. The same happens when an editor left open for a long time loses its editing session on the server: from then on, saving (like preview updates and undo) is refused with "This editing session has expired. Reload the page to continue." every time until you reload, and after the reload only your field edits come back. Save before stepping away for an extended period if you've restructured a page.
- The page was saved while your draft was waiting. If the page was saved (by you in another tab, or by another editor) after your unsaved changes were made, the editor won't silently re-apply them against rows that may have shifted, been renamed, or been deleted. Structural changes come back behind the orange This page was changed outside your editing session banner described above. Field edits can't be safely re-applied and are dropped, with an amber Unsaved edits were discarded notice. While the editor is still open, saving is the safe way through: a save made after someone else's is merged with it automatically.
Someone else's unsaved changes
Draft recovery only ever brings back your own unsaved changes. When two people have the same page open, each keeps a private copy of their unsaved changes; to copy the other person's into yours — and hand the combined work back later — use Draft Import. An imported change becomes part of your own unsaved work, so it is recovered like any other edit.
For lasting safety, use Backups & Revisions
Draft recovery protects in-progress, unsaved edits. For recovering saved work — rolling a page back to an earlier published state, or restoring the whole site — use Page Revisions and Sitewide Backups instead. See Backups & Page Revisions. The two systems are complementary: draft recovery is the everyday "don't lose what I'm typing" net; backups and revisions are the durable history of what's been saved.
Where this lives in the code
- Field drafts —
_persistFieldDraft()/_loadFieldDraft()inresources/js/editor/editor-state.js, keyed per file inlocalStorage(editor_field_draft.{md5(file)}). The closing-tab flush is wired inresources/js/manager.js(beforeunload). - Structural drafts —
persistRowDraft()/loadRowDraft()/clearRowDraft()and thedehydrate()auto-persist hook in⚡editor.blade.php, stored in the session undereditor_row_drafts.{md5(file)}with a capturedsourceMtimefor conflict detection. The session entry is a pointer: the rows themselves live in the editing session's state file (EditorSession,storage/framework/editor-sessions/), so when that file is gone — the expired-session case above — there is nothing structural to recover. - Recovery banners — the blue recovered-changes banner, the orange disk-conflict banner and the amber discarded-edits notice sit at the top of the row list in
⚡editor.blade.php(editor-row-list-draft-recovered-banner,editor-row-list-conflict-banner,editor-row-list-field-draft-notice). - Draft import (someone else's unsaved changes) — see Draft Import.