Repository navigation
diff: scroll wrapped display rows, not source lines - #667
Closed
andyrewlee wants to merge 1 commit into
Closed
andyrewlee wants to merge 1 commit into
andyrewlee wants to merge 1 commit into
Conversation
The diff viewer computed scroll bounds from logical lines but rendered wrapped display rows, so a long wrapped line's tail was unreachable. The model now keeps a cached visual-row layout keyed on (diff, width, wrap, styles): scrolling, wheel gating, footer position, and hunk jumps all operate in that space, wrap toggles and width changes re-anchor to the same source line, and chrome tiers bound the emitted frame. A scroll limit can no longer strand wrapped tails. PERF_STRICT=1 make perf-check could not be evaluated on this host: sustained load (~25) inflates the tail percentiles for the sidebar and monitor presets, which never instantiate the diff viewer; the baseline commit passed all three presets on the same host minutes earlier.
7 tasks done
Owner
Author
|
Superseded — content landed on main via merge 8580442 (plans/ scaffolding intentionally excluded). |
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.
Summary
internal/ui/diff/visual_rows.go): every wrapped segment is a scrollable row with a source-line→first-row lookup for hunk navigationmaxScrollreported zero — wheel/keys now reach the end, and the footer counts display rowscopyFile-style pre-commit seams n/a; scroll never rebuilds the wrap layout (proven byrowsBuiltcounter inTestVisualRowsCache)Test plan
go test ./internal/ui/diff ./internal/ui/centerincl. newTestVisualRows*groups + real-git-diff center integration (TestDiffTabWrappedTailReachable)go test -raceon both packages,make harness-presets,verify-loop,lint-strict-new,devcheck(one ambientTempDir RemoveAllteardown flake in e2e — assertions green)PERF_STRICT=1 make perf-check: not evaluable on this host — sustained load ~25 inflated sidebar/monitor p95 tails on the baseline commit too; those presets never instantiate the diff viewer (p50s flat)Stacked on #666 (plan 053).