How in-browser resume drafts are built
Until now, the Resumer editor at /build kept one resume in this browser. A second version meant overwriting the first, or keeping a JSON file on the side. The editor now keeps several named drafts in this browser. You pick the one you want from the app bar. You can copy the one you have open, start a blank one, rename, or delete.
This post covers what is stored, how a resume you already had saved becomes Draft 1, what the switcher does, what happens when you delete the last draft, how Export JSON changed, and the limits. Drafts live only in this browser. Import is not available yet.
What you will notice
- The app bar now has a Draft switcher next to the Resumer title, then Preview and the More actions menu as before.
- New draft… asks for a name and whether to Copy current or start Blank. Copy current is the default. The suggested name is the next unused "Draft N".
- Rename… and Delete… apply to the draft you have open.
- If that draft is the only one, the confirm says: "This replaces [name] with an empty Draft 1."
- A successful autosave still shows nothing. If the browser refuses to store the workspace, you get the same warning as before: "Could not autosave this resume in this browser. You can keep editing."
- Export JSON now downloads one file that contains every draft.
- Preview and Download PDF still use the draft you have open, and they stay disabled until that draft has a name.
- Start over is gone. Deleting the last draft is how you empty the editor.
Where the pieces live
| Piece | Path | Role |
|---|---|---|
| Draft schema | src/lib/drafts/schema.ts |
Draft names, the workspace shape, and the next unused "Draft N". |
| Persistence | src/lib/document/persistence.ts |
Load, migrate a v1 save, write the v2 envelope, and drop resumer-document.bad. |
| Reducer and state | src/lib/document/reducer.ts, state.ts, actions.ts |
Switch, create, rename, delete, and ignore a late Save on the wrong draft. |
| Autosave hook | src/components/document/useAutosave.ts |
Load on mount, debounced save, flush on hide, and the immediate write when the last draft is deleted. |
| Provider | src/components/document/ResumeDocumentProvider.tsx |
useDrafts and useWorkspaceSnapshot. |
| Switcher | src/components/build/DraftSwitcher.tsx |
The app-bar select, with the new, rename and delete dialogs beside it. |
| App bar | src/components/forms/Form.tsx |
Resumer, the switcher, Preview, then More actions. The form body remounts when the active draft changes. |
| Export | src/lib/workspace/schema.ts, export.ts |
Version 2 workspace file with every draft. |
What is stored
The storage key is still resumer-document. The envelope is still format: "resumer-autosave". The schema version is now 2, and the payload is a workspace rather than a single values object.
{
"format": "resumer-autosave",
"schemaVersion": 2,
"savedAt": "2026-11-23T12:00:00.000Z",
"workspace": {
"activeId": "00000000-0000-4000-8000-000000000001",
"drafts": [
{
"id": "00000000-0000-4000-8000-000000000001",
"name": "Draft 1",
"updatedAt": "2026-11-23T12:00:00.000Z",
"values": { "personalDetails": { }, "contactDetails": { }, "experienceItems": [], "educationItems": [], "personalProjects": [] }
}
]
}
}
Each draft has a UUID, a name, an updatedAt, and the camelCase editor document. The React list keys for experience and education are still not stored. They are created again when that draft becomes active.
A draft name is trimmed, and it must be between 1 and 60 characters. The workspace must contain at least one draft, and activeId must name one of them. There is no maximum number of drafts in the code.
This is still a different file from the JSON export. The autosave is an internal format that only this browser reads. The export is a portable resumer-workspace file, now also at schema version 2, and I cover that change below. For how autosave first landed, see How autosave is built.
How an existing save becomes Draft 1
If this browser already has a version 1 autosave, the load path still accepts it. The old envelope held one values document. That document becomes a single draft named Draft 1. The draft's updatedAt is the old envelope's savedAt. The next save writes the version 2 envelope.
// src/lib/document/persistence.ts
const MIGRATED_DRAFT_NAME = "Draft 1";
function migrateV1(values, savedAt) {
const id = crypto.randomUUID();
return {
activeId: id,
drafts: [{ id, name: MIGRATED_DRAFT_NAME, updatedAt: savedAt, values }],
};
}
An unreadable payload is still copied to resumer-document.bad, left on the original key, and not overwritten. If getItem throws, the load reports that storage is unavailable and does not quarantine.
If the key is empty, the editor opens a draft named Draft 1 with a new id, and it does not write until something changes. The first server and client render use a fixed draft id so the HTML matches. The real id replaces it after storage has been read.
The switcher
DraftSwitcher sits in the app bar, in Form.tsx, next to the Resumer title. It is an MUI Select labelled "Draft". The list is every draft name, then a divider, then New draft…, Rename… and Delete…. The dialogs render beside the select, not inside it.
A new draft can copy the values you have on screen, or start from empty form values. Create switches you to the new draft. Rename changes only the label. It does not bump updatedAt.
The form body remounts when the active draft changes, because the accordion container uses key={activeId}. An open section form does not keep showing the previous draft's unsaved text.
A Save that finishes after you switch
Contact, experience and education still write to the store when you press a section's Save, not on each keystroke. Those actions now carry the draft id from the moment you press Save. If you switch drafts before that Save settles, the reducer ignores the action. The name you typed for one draft does not land on another.
When you switch, the reducer first copies the on-screen values back onto the draft you are leaving. It does not flush to localStorage at that moment. The usual 500 ms timer still runs, and the write contains the whole workspace.
Deleting a draft
Delete always asks first.
If other drafts remain, confirm says: "This removes [name] from this browser." That draft is dropped. If it was the active one, the editor opens the draft that sat in the same place in the list, or the new last draft if you deleted the one at the end.
If it is the last draft, confirm says: "This replaces [name] with an empty Draft 1." The reducer puts one empty draft named Draft 1 in its place, with a new id. useAutosave writes that workspace immediately and removes resumer-document.bad. If that write fails, you still see the empty Draft 1 on screen, the previous document stays in storage, and the warning snackbar appears. There is no undo.
Autosave is the same timing, on a larger document
A save still runs 500 ms after the store changes, and right away when the tab is hidden or the page goes away. Unchanged workspaces are not written again. Nothing is written before the load has finished. useAutosave is the only writer.
The warning path is unchanged. The difference is the payload. The hook now writes the whole workspace, not a single resume.
Export JSON now holds every draft
Export JSON used to write a version 1 resumer-workspace file with one source resume and an empty variants array. That is described in How Workspace JSON export is built. It now writes schema version 2, with every draft in the file.
{
"format": "resumer-workspace",
"schemaVersion": 2,
"exportedAt": "2026-11-23T12:00:00.000Z",
"activeId": "00000000-0000-4000-8000-000000000001",
"drafts": [
{
"id": "00000000-0000-4000-8000-000000000001",
"name": "Draft 1",
"updatedAt": "2026-11-23T12:00:00.000Z",
"source": {
"personal_details": { "name": "Ada Lovelace" }
}
}
]
}
Each draft's source is still the snake_case resume document, built with fromFormValues. The v1 schema remains in the code so a later import can still read those older files. Export writes version 2 only. Import is not implemented.
The filename still comes from the active draft's name: resumer-<name-slug>-YYYY-MM-DD.json, or resumer-YYYY-MM-DD.json if that draft has no name that can be turned into a slug. The menu item is enabled when any draft has a name, even if the one you have open does not. The confirmation is unchanged: "Downloaded [filename] — stays on this device".
Preview and Download PDF still read the active draft only, through useResumeSnapshot. They do not include the other drafts.
What drafts do not do
- This browser only. There is no account and no server copy. Another browser, another device or a private window starts empty.
- It is not a backup. Clearing site data for Resumer deletes the drafts. Export JSON is the copy you keep.
- No import yet. You cannot load a workspace file back into the editor.
- Private modes. Some block or limit storage. Then you see the warning once and nothing is saved.
- Two tabs. They do not sync or merge. The last write wins.
- Unsaved form edits. Only what you have saved in a section is kept.
- Start over is gone. It used to live in the More actions menu. Deleting the last draft now takes its place.
There is no automated test suite in the repo. The checks for this change are manual steps: switching drafts, copy and blank, Export JSON as a version 2 workspace, Preview and PDF of the active draft, deleting the last draft, and a Save that finished after a switch.
You can try it in the editor at https://resumer.orlinivanov.com/build.