Skip to content

fix(tui): keep the scrollbar hover band inside its pane - #5024

Merged
aheritier merged 1 commit into
docker:mainfrom
TDnorthgarden:fix/scrollbar-hover-clamp
Nov 26, 2026
Merged

aheritier merged 1 commit into
docker:mainfrom
TDnorthgarden:fix/scrollbar-hover-clamp

Conversation

@TDnorthgarden

Copy link
Copy Markdown
Contributor

Problem

pointerOverScrollbar accepted any column up to ScrollbarX()+2. On a messages pane docked left of the sidebar or a divider, those columns belong to the neighbouring surface, so moving the pointer onto the sidebar's first column made the chat scrollbar fade in and hold — and it collided with the sidebar grip's own edge zone. The left bound is clamped to the pane; the right one was not.

Fix

  • Clamp the right bound to the pane's last column, matching the left bound.
  • TestScrollbarHoverClampsToPane pins that columns past the pane's right edge are not hover: it fails before the fix.

@TDnorthgarden
TDnorthgarden requested a review from a team as a code owner November 24, 2026 02:48
@aheritier aheritier added area/tui For features/issues/fixes related to the TUI kind/fix PR fixes a bug (maps to fix:). Use on PRs only. labels Nov 24, 2026
@aheritier

Copy link
Copy Markdown
Collaborator

@krissetto any feedback ?

@aheritier aheritier left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for fixing the hover overlap with the sidebar. The clamp keeps the hover band inside the pane, and the regression test checks that both columns just outside it are ignored while the scrollbar itself still responds. No code changes requested.

aheritier
aheritier previously approved these changes Nov 25, 2026
@aheritier
aheritier added this pull request to the merge queue Nov 25, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 25, 2026
@aheritier
aheritier added this pull request to the merge queue Nov 25, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 25, 2026
@aheritier
aheritier added this pull request to the merge queue Nov 25, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 25, 2026
@aheritier
aheritier added this pull request to the merge queue Nov 25, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 25, 2026
pointerOverScrollbar accepted any column up to ScrollbarX()+2. On a
messages pane docked left of the sidebar, the columns past the divider
belong to the neighbouring surface, so moving the pointer onto the
sidebar made the chat scrollbar fade in and hold, colliding with the
sidebar grip's own edge zone. Clamp the right bound so the band ends at
the divider column: it covers the pane plus the one column the divider
crossfades in, and the sidebar itself starts a column further out.

The divider column is deliberate, not slack: the sidebar separator
crossfades with the transcript scrollbar, and the held-pointer motion
test drives its release through that column
(TestSidebarDividerCrossfadesWithTranscriptScrollbar).

Signed-off-by: Aucoto Zhang <tdnorthgarden@gmail.com>
@TDnorthgarden

Copy link
Copy Markdown
Contributor Author

The merge-queue failures came from my change: the clamp also cut the divider column, which the new sidebar-separator crossfade uses (TestSidebarDividerCrossfadesWithTranscriptScrollbar, added after this branch was cut — merging this PR into current main fails on it locally). The band now ends at the divider column (m.xPos+m.width): the sidebar itself starts one column further out, so hovering the sidebar still does not summon the scrollbar, and the divider crossfade works. The branch is rebased onto current main, so this PR's own CI now runs the crossfade test; the scrollview and chat suites (including -race) are green. Amended and force-pushed (d859bad → 756be20).

@aheritier aheritier left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The revised clamp keeps the divider in the transcript scrollbar’s hover band, preserving the crossfade, while excluding the sidebar’s first column. The regression test covers the scrollbar, the divider, and the first sidebar column. No code changes requested.

@aheritier
aheritier added this pull request to the merge queue Nov 26, 2026
Merged via the queue into docker:main with commit 82445fb Nov 26, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/tui For features/issues/fixes related to the TUI kind/fix PR fixes a bug (maps to fix:). Use on PRs only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants