Repository navigation
feat(notes): page history, so any change (the assistant's too) can be undone - #139
Merged
Merged
Conversation
… undone Before each change to a page's title, summary or text, the page as it was is kept as a version: one per person per sitting, and always one for the assistant's or the model's changes. History on a page lists them; pick one to read it and restore it. A restore is kept as a version too. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XZQXJtCvJgbG1Z2H312KcS
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.
Description
Before: when the assistant or the model rewrote a note, what was there before was gone.
After: each note has a History button. It lists earlier versions, newest first, with who changed the note: a person, the assistant or the model. Pick a version to read it; editors can restore it. A restore is kept as a version too, so it can be undone.
Motivation and Context
Notes module: the assistant is the notes' primary user and writes without approval, so its changes need to be easy to undo.
Versions live in
note_version(a new table instore.SCHEMA, so existing installs get it on start; no data changes). A version is taken before a change to the title, summary or text. A person's edits within ten minutes of each other make one version, so autosave doesn't flood the history. A change by the assistant, the model or another person always makes a new one. The newest 100 are kept per page. Deleting a page drops its history.New API routes:
GET /api/v1/notes/{id}/history,GET .../history/{vid}andPOST .../history/{vid}/restore.Types of changes
!in the title)Checklist:
make hookschecks it on commit).docs/accordingly.## UnreleasedinCHANGELOG.md.Checked locally: notes and MCP tests pass, along with ruff, tsc and eslint. The OpenAPI client was regenerated with
make openapi. The full backend suite is running.🤖 Generated with Claude Code
https://claude.ai/code/session_01XZQXJtCvJgbG1Z2H312KcS
Generated by Claude Code