feat: persist local reviews automatically in SQLite

This commit is contained in:
Valdemar Lorenzen
2026-10-16 15:15:19 +02:00
parent ef1c377167
commit b558f82094
15 changed files with 634 additions and 48 deletions
+5 -3
View File
@@ -13,7 +13,7 @@
- preserve immutable snapshot identity and existing stale detection; never silently reanchor comments after source changes.
- persist precise ranges in version 2 JSON import/export. SQLite storage follows in the next item.
- future GitHub publishing may map precise local anchors to supported line ranges without reducing precision in the local review.
- [ ] persist local reviews automatically in a local SQLite database using rusqlite; no server, hosted storage, or synchronization.
- [x] persist local reviews automatically in a local SQLite database using rusqlite; no server, hosted storage, or synchronization.
- keep one database under $XDG_DATA_HOME/vamp/reviews/, falling back to ~/.local/share/vamp/reviews/; allow a configurable review_directory.
- key reviews by repository identity and persistent review ID, preserving reviews and stale comments across revision changes.
- autosave committed comment edits and summaries when dismissing or switching review editors; save verdicts and deletions immediately, using transactions rather than per-keystroke writes.
@@ -22,13 +22,15 @@
- version the database schema; use review-version checks to reject conflicting edits from multiple editor instances.
- surface write failures and conflicts without discarding drafts or marking unsuccessful saves as persisted.
- persist the precise start/end grapheme anchors without reducing them to line ranges.
- [ ] add an option for three pane lef/base/right view for conflict resolution.
- alternative pane layout as left/right with base underneath (configurable)
- [ ] diff view: consider an MCP or a something for a local review loop when using coding agents.
- [ ] diff view: GitHub code review integration after the local review UX is usable.
- publish local reviews explicitly: general PR comments, inline line/range comments, review summaries, approval, and requests for changes.
- preserve explicit PR identity and reviewed commit IDs; validate anchors against GitHub's PR diff and recheck the PR head before submission.
- keep authentication, network requests, publishing, and remote thread synchronization out of the local UX work; treat timed-out writes as unknown outcomes rather than automatically retrying.
- define follow-on scope for reading/replying to remote threads, editing/deleting published comments, and resolving threads.
- [ ] add an option for three pane lef/base/right view for conflict resolution.
- alternative pane layout as left/right with base underneath (configurable)
- [ ] take a look at the configuration options and their names, and consider whether renaming some of them is warranted, as well as maybe nesting some under some common namespace (like some already are).
- [ ] remove the diff palette polling fallback once a released Herdr fix delivers palette-ready DEC 2031 notifications, including palette-only changes with an unchanged light/dark preference. Related upstream issue: [herdrdev/herdr#4183](https://github.com/herdrdev/herdr/issues/4183).
- verify that notification-triggered queries return fresh colors in Ghostty through Herdr before removal; retain startup, focus-regain, and notification-driven palette refresh.
- [ ] pull a pr description and display it in a buffer: