8000 feat(notes): page history, so any change (the assistant's too) can be undone by adeelahmad · Pull Request #139 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(notes): page history, so any change (the assistant's too) can be undone - #139

Merged
adeelahmad merged 1 commit into
mainfrom
claude/notes-module-j9j30y
Oct 4, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/notes-module-j9j30y

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

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 in store.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} and POST .../history/{vid}/restore.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit).
  • I added or updated tests.
  • My change requires documentation updates, and I have updated docs/ accordingly.
  • Users need more than the title to understand it, so I wrote it under ## Unreleased in CHANGELOG.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

… 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
@adeelahmad
adeelahmad merged commit 4928451 into main Oct 4, 2026
0 of 5 checks passed
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.

2 participants

0