Skip to content

feat(core): add per-note history timeline with restore - #183

Merged
haribo merged 1 commit into
developfrom
feat/note-history-core
Aug 4, 2026
Merged

feat(core): add per-note history timeline with restore#183
haribo merged 1 commit into
developfrom
feat/note-history-core

Conversation

@haribo

@haribo haribo commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Summary

Implements the note-history core (design: docs/design/note-history.md).

  • note_history(id) — coalesces content-changing edits into versions (author change or ≥ 5 min idle gap), newest first, capped at 100; unchanged-content steps are skipped (which also filters out edits to other notes).
  • note_at(id, version_id) — historical read via Automerge text_at/get_at/keys_at at the snapshot's heads.
  • restore(id, version_id, now) — a forward, merge-safe re-apply of title/body/tags/folder; itself a new history entry.
  • Each mutation now commits as its own change stamped with the caller's now. This gives per-edit history granularity and makes change timestamps deterministic — the model's "reads no clock" contract, previously only honoured at the field level, now holds at the change level too.

Test plan

  • cargo test --workspace — 6 new core tests (coalescing + read-back, restore reverts + is a new version, restore is merge-safe vs a concurrent edit, 100-cap, bad version id) + no regression across sync/e2e/relay
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo fmt --all --check

Part of #179
Closes #182

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

implement note history in core (note_history, note_at, restore)

1 participant