backnotprop / backnotprop/plannotator
Persist per-file viewed state across review iterations using a per-file content hash
- Dominant language
- TypeScript
- Stars
- 8.7k
- Forks
- 649
- Avg merge
- 11h 12m
- Merged PRs (30d)
- 109
Description
Viewed-file state is keyed off a single whole-patch hash, so any change to any file wipes the viewed marks for every file. In an iterative review (send feedback, agent changes one file, diff refreshes) you lose all progress on the files that did not change. GitHub keeps them. Supersedes #559.
Current mechanism: `packages/server/review.ts` sets `draftKey = contentHash(options.rawPatch)` and re-keys it on every patch refresh and diff-type switch; `viewedFiles` rides that single key (packages/review-editor/dock/ReviewStateContext.tsx).
**Acceptance criteria**
- Viewed state is stored per file with a per-file content fingerprint.
- On a diff refresh, a file whose content is unchanged keeps its viewed mark; a file whose content changed resets to unviewed.
- Works across diff-type switches within a session and across separate send-feedback iterations on the same branch.
- Existing whole-patch draft persistence (annotations) is unaffected.
Design precedent that did not exist when this was first requested: Guided Reviews persist per-section reviewed state keyed per item, with a `moved` flag when the stored head sha differs from the head under review (`/api/guide/:jobId/reviewed`, `/api/guides`). Same shape, applied to files.
Related: #1116 (continuous review sessions) does not cover this. #958 mentions viewed-file behavior; cross-link so it does not get specced twice.
Contributor guide
Assessment
This issue has not been assessed yet.