Repository navigation
feat(ui): scroll the diff pane with the horizontal wheel - #411
Merged
Merged
Conversation
horizontal wheel and trackpad swipes over the diff pane were swallowed. Each scrollX change invalidates the whole render cache, so rendering per event would bring back the #179 stall on a fast swipe. The first event with no wheel tick in flight repaints at once, later events in the burst only set wheelState.xPending, and the existing wheel tick repaints once per interval. xPending is kept apart from renderPending so a mid-burst repaint never discharges a vertical cursor pin. Related to #334
a key press, resize or blame load during a wheel burst flushes pending work and clears tickInFlight, but cannot cancel the tick already scheduled. With horizontal wheel support that leftover tick could clear a newer tick's ownership or repaint beside it, which could start a second tick chain and trigger extra full renders during a sideways swipe. Ticks now carry an epoch that flushWheelPending bumps, and handleWheelDebounce drops a tick from an older epoch. Related to #334
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.
Horizontal wheel and trackpad swipes over the diff pane now scroll it sideways, four columns per event like the arrow keys. They were swallowed before.
scrollXchange invalidates the whole render cache, so rendering per event would bring back the Cannot interrupt an active mouse scroll with an opposite scroll #179 stall on a fast swipe. The first event with no wheel tick in flight repaints at once, later events in the burst only mark a horizontal repaint as owed, and the existing wheel tick repaints once per interval. Vertical scrolling is unchanged, and a sideways repaint mid-burst never discharges a pending vertical cursor pin.Large diffs can still scroll in visible steps because each horizontal repaint renders the whole file. Tests cover the leading-edge repaint, in-burst deferral, mixed vertical/horizontal bursts in both orders, flush paths and a tick left over from before a flush. README,
site/docs.htmland both pluginusage.mdcopies document it.Fixed #334