Skip to content

feat: page/block revision history — periodic snapshots, diff, and restore #225

Description

@tstapler

Problem

SteleKit has no in-app safety net for accidental edits or deletions to a page's content. Today the only recovery path is external git usage (git-integration/git-smart-sync plans) — which requires the user to have git sync configured, know the git CLI or SteleKit's git UI, and understand how to check out a prior commit for a single page. There is no automatic, always-on version history the way there is for e.g. Google Docs.

Trilium Notes ships this natively (https://docs.triliumnotes.org/user-guide/concepts/notes/note-revisions):

  • Automatic snapshots at a configurable interval (independent of any sync/git setup)
  • On-demand manual "save a revision now"
  • Named revisions with short descriptions
  • Diff/change-highlighting between a revision and current content
  • One-click restore (which itself creates a new revision of the pre-restore state, so nothing is lost)
  • Configurable retention (max revisions per note, or unlimited)
  • Multi-source tracking (manual save vs. restore vs. external edit)

Why this matters

  • Git-based recovery is opt-in and requires leaving the "just works locally" experience SteleKit's README promises. A user who hasn't set up git sync yet has zero undo path beyond in-session undo/redo.
  • Even git users benefit: git captures whole-repo commits at sync time, not the fine-grained "smallest oops" that revision history captures (e.g. an accidental paste-overwrite three edits ago, mid-session, before any commit).

Suggested scope (v1)

  • Store periodic content snapshots per page (interval-based + on significant edit gaps), likely in SQLite alongside the existing block/page tables.
  • A "History" panel/dialog per page listing snapshots with timestamps.
  • Diff view between a snapshot and current content (text diff is sufficient for v1).
  • Restore action.
  • Configurable retention cap (default a reasonable number, e.g. last 50 or 30 days).
  • Out of scope for v1: named/annotated revisions, cross-device revision sync, revision export.

References

  • No existing code or project_plans/ entry addresses this — grepped for RevisionHistory, NoteRevision, VersionHistory, PageRevision with zero hits.
  • Related but distinct: project_plans/git-integration/, project_plans/git-smart-sync/ (external, repo-level, opt-in).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions