Fix scroll-during-selection for sidebar terminal and center pane#147
Merged
andyrewlee merged 2 commits intomainfrom Feb 2, 2026
Merged
Fix scroll-during-selection for sidebar terminal and center pane#147andyrewlee merged 2 commits intomainfrom
andyrewlee merged 2 commits intomainfrom
Conversation
The sidebar terminal required wiggling the mouse to scroll during text selection because it only scrolled on MouseMotion events. When the mouse was held still past the viewport edge, no events fired and scrolling stopped. The center pane had tick-based scrolling but didn't update the selection endpoint, so the highlight lagged behind. Introduce a shared SelectionScrollState in internal/ui/common that both panes use for tick-based auto-scroll during drag selection. The tick handler scrolls the viewport and extends the selection highlight to the viewport edge on every tick. Export SidebarSelectionScrollTick and route it through app_input.go so the message reaches the sidebar's Update. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The fallback code paths (used when the tab actor is unavailable) in updateMouseClick, updateMouseMotion, and updateMouseRelease did not use the selectionScroll state machine, so tick-based auto-scrolling during selection drag didn't work without the tab actor. Add Reset() calls on click and release, and add SetDirection/NeedsTick/SafeTick logic on motion to schedule selectionScrollTick messages. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.
The sidebar terminal required wiggling the mouse to scroll during text selection because it only scrolled on MouseMotion events. When the mouse was held still past the viewport edge, no events fired and scrolling stopped. The center pane had tick-based scrolling but didn't update the selection endpoint, so the highlight lagged behind.
Introduce a shared SelectionScrollState in internal/ui/common that both panes use for tick-based auto-scroll during drag selection. The tick handler scrolls the viewport and extends the selection highlight to the viewport edge on every tick. Export SidebarSelectionScrollTick and route it through app_input.go so the message reaches the sidebar's Update.