Conversation
Tour steps and code peeks build a "document:" lens that goes through lensContextGaps(). Since devdotfast#502, when diffr supplies contextScopes, any unfolded run of lines that touches the lens range is shown whole. An added file is one unfolded run, so the card shows the entire file instead of the pinned lines. Add ReviewDiffLens.exact, set it on the document lens, and have withLens() drop contextScopes before computing gaps for an exact lens. Diff tab lenses never set exact, so devdotfast#502's behavior there is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A sequence step could carry only one source range, so a step that touches two places in the code had to pick one. Add an optional `sources` array (1 to 10 ranges) as a fourth alternative to `source`, `explanation` and `code`. A step still needs exactly one of them, and stored steps that use `source` read and render as before. The guided tour shows every chunk when it lands on the step. Chunks that share a file, side and pins go into one code card with several ranges, so the exact document lens folds the code between them. Chunks in other files get their own stacked cards. The first chunk anchors the step for jump-to-source. Each chunk is its own document reference (`<step id>:<index>`), so it gets the same whitespace, pin and staleness checks as a single source. The MCP edit guidance and scratchpad instructions mention `sources`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jykim256
force-pushed
the
feat/multi-chunk-sequence-steps
branch
from
September 27, 2026 00:30
e2b487d to
b192a69
Compare
thesiti92
requested review from
ketan0 and
sidkmenon
and removed request for
ketan0
September 28, 2026 17:37
Contributor
|
hey! @jykim256 tysm for the contribution !! sorry for the delay on this, have been working on some diffr data model improvements to fix up the diagram code snippets. i'm a bit confused by this though - "the multiple code snippets in a stop" doesn't feel very natural for a sequence diagram? are the other code snippets like context or something? and the limit of 10 feels a bit arbitrary. |
milanb17
self-requested a review
September 30, 2026 17:46
This branch has not been deployed
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.
What changed
A sequence step could point at one code range. Real steps often touch two or three places, so the author had to pick one. Now a step can carry several.
sourcesarray, with 1 to 10 ranges.source,sources,explanation, orcode. The error message now says so.sourceshas only one entry looks exactly like a step withsource.sources.Authoring guidance
instructions/authoring.mdnow tells authors to usesourceswhen a step's story spans several places, in reading order.Stored data
There's no migration.
sourcesis additive. Stored steps that usesourceparse, render and tour exactly as before.Each chunk becomes its own document reference, with the id
<step id>:<index>. That means each chunk gets the same checks a singlesourcegets: whitespace-only ranges get rejected, pins get validated, and staleness is tracked per chunk. A single-sourcestep keeps its old reference id, so existing stale-source state still lines up.How I checked it
pnpm --filter @dev.fast/review typecheckandtsc --noEmit -p packages/review/apppass.pnpm lintpasses.oxfmt --checkpasses on the changed files.pnpm --filter @dev.fast/review test:node: 1196 passed. One run hit a failure insrc/sharing/export.test.ts(the diff-count watch stream test). It passed on four reruns of this branch and on the base branch, so it looks like a timing flake under load.vitest --project browser): 46 files, 275 tests pass. That includes a new test where three chunks across two files make two editors, with the same-file editor getting both ranges.test:node, Node 24.18.0): 48 files, 247 tests pass, including the newsequence-tour.test.tsandcode-peek-groups.test.ts.sourceandsourcesis rejected, and a whitespace-only range insources[1]is rejected.Things to look at
CodePeekCardnow wraps a newCodePeekFileCardthat takes a list of sources. Single-source callers (code peeks, side peeks) get the same title, ranges and reveal behavior as before.sources. Only sequence steps produce it right now. Flow-diagram attachments still make one tour stop per source. I left that alone on purpose, but it could adopt the same stack later.🤖 Generated with Claude Code