feat(core): add per-note history timeline with restore - #183
Merged
Conversation
This was referenced Aug 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 Automergetext_at/get_at/keys_atat 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.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/relaycargo clippy --workspace --all-targets -- -D warningscargo fmt --all --checkPart of #179
Closes #182