Skip to content

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

Closed

Description

@backnotprop

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.

Activity

  1. added
    enhancement
    on Jul 27, 2026
  2. ashish921998 commented on Aug 21, 2026

    @ashish921998
    Contributor

    @backnotprop can i take this up?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions