backnotprop / backnotprop/plannotator

Persist per-file viewed state across review iterations using a per-file content hash

Open
#1,136 1 comment 1 reaction 0 assignees View on GitHub
enhancement
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.