Skip to content

Fix scroll-during-selection for sidebar terminal and center pane#147

Merged
andyrewlee merged 2 commits intomainfrom
better-scroll
Feb 2, 2026
Merged

Fix scroll-during-selection for sidebar terminal and center pane#147
andyrewlee merged 2 commits intomainfrom
better-scroll

Conversation

@andyrewlee
Copy link
Copy Markdown
Owner

@andyrewlee andyrewlee commented Feb 2, 2026

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.


Open with Devin

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>
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 3 potential issues.

View issues and 4 additional flags in Devin Review.

Open in Devin Review

Comment thread internal/ui/center/model_input_mouse.go
Comment thread internal/ui/center/model_input_mouse.go
Comment thread internal/ui/center/model_input_mouse.go
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>
@andyrewlee andyrewlee merged commit 1354d3f into main Feb 2, 2026
1 check passed
@andyrewlee andyrewlee deleted the better-scroll branch February 2, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant