Add version history with rollback and per-note created/synced info
All checks were successful
ci / test (push) Successful in 3m8s
ci / release (push) Successful in 11m21s

Server (schema v2, auto-migrates): every accepted overwrite snapshots the
superseded revision into note_history (capped at 50 per note); new
GET /api/v1/notes/{id}/history endpoint; compact purges orphaned history.

Client: notes get a synced_at stamp on every confirmed server exchange;
an info footer under the editor and a Ctrl/Cmd+I panel show created/
modified/last-synced plus the revision list. Restoring a revision applies
it as a normal edit through the sync path, so rollback is non-destructive.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-25 22:20:19 +02:00
parent bd2b8e6241
commit c389bab46e
12 changed files with 563 additions and 9 deletions

View File

@@ -31,6 +31,7 @@ Open `http://localhost:8420`, click `⋯` → set server URL + token → Save.
| `Ctrl/Cmd+Shift+P` | toggle markdown preview (`[[wiki-links]]` open/create notes) |
| `Ctrl/Cmd+K` | cycle tag filter |
| `Ctrl/Cmd+J` / `+Shift` | next / previous note while editing |
| `Ctrl/Cmd+I` | note info (created / last synced) & version history |
## CLI
@@ -96,6 +97,12 @@ edits of the same note never silently overwrite: the loser comes back as a new n
tagged `conflict` with “(conflicted copy …)” in its title. Delete-vs-edit: the edit wins.
Every client keeps a full offline copy in IndexedDB; a crash mid-sync loses nothing.
**Version history:** every time an accepted sync overwrites a note, the server keeps the
previous state (last 50 revisions per note). `Ctrl/Cmd+I` (or the “History” button under
the editor) shows a notes revisions; restoring one applies the old text as a new edit,
so the replaced text itself stays in history — rollback is never destructive.
`tefterd compact` drops history along with the purged notes.
## Development
```sh