feat(diff): read a diff in the order a walkthrough sets - #14
Merged
Conversation
Tours already carried an ordered list of file-and-line stops with narrative, but only the repository browser could show them, so a walkthrough of a diff had nowhere to appear. The diff page now reads the session's most recent tour and reorders the whole view by it - sidebar and diff body both, since they render from one list. Files the walkthrough visits come first in visit order, everything else keeps the order it had, under a divider. A toggle in the sidebar header returns to the alphabetical tree. The sidebar switches to a flat numbered list in that mode: position, file, and the stop's one-line annotation, with the existing filter and comment controls still applied. A stepper under the toolbar walks the stops with prev/next and scrolls to each file. Tours are polled on the same 2s interval as comments, and a tour still being written shows its steps as they arrive, so a reader watches the order being worked out. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018PkYQzbsnMihHesafWvXKs
A review tour's steps now drive the diff view, so the hand-off pointed the reader at /tour/<id>, which browses the repository instead of the change. Also notes that a review tour's --annotation becomes the file's label in the reordered list. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018PkYQzbsnMihHesafWvXKs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Slice 1. Tours already carried an ordered list of file-and-line stops with narrative, and the tour
skill already had a review mode that scopes them to a PR's diff — but only the repository browser
could render one, so a walkthrough of a diff had nowhere to appear.
The diff page now reads the session's most recent tour and reorders the whole view by it. Sidebar and
diff body both, because they render from one list: files the walkthrough visits come first in visit
order, everything else keeps the order it had, under a "Not in the walkthrough" divider. A toggle in
the sidebar header returns to the alphabetical tree.
/diff, and says an annotation should explain why a file is read at that pointMeasured on NaturalCycles/NCBackend3#14360, 11 files:
The primitive moves from 5th to 1st, the file holding the blocking finding from 7th to last, and the
five files that are signature updates only drop below the divider.
Ordering is a pure function with tests: first-visit wins when a walkthrough returns to a file, files
it names that the diff does not contain are dropped, no file is lost or duplicated, and an empty
walkthrough is the identity. 120 UI tests pass.
Also fixes a TS2883 from #12 —
tsccould not name the sanitize schema's inferred type. Note thatnpm run typecheck -w @diffity/uistill reports four pre-existingTS6059errors that are presenton upstream
maintoo; the script is not wired intonpm test.Follow-ups worth doing: the stepper scrolls to the file, not the line, because
DiffViewHandleexposes only
scrollToFile; and a step's line range is not highlighted in the diff yet.Stacked on #12.
🤖 Generated with Claude Code
https://claude.ai/code/session_018PkYQzbsnMihHesafWvXKs