Skip to content

TUI - autohide scrollbars - #4994

Open
krissetto wants to merge 1 commit into
docker:mainfrom
krissetto:auto-hide-scrollbars
Open

krissetto wants to merge 1 commit into
docker:mainfrom
krissetto:auto-hide-scrollbars

Conversation

@krissetto

Copy link
Copy Markdown
Contributor

To keep things clean and clear up some more visual clutter in the TUI, let's not show the scrollbars until the user actually scrolls the scrollview or moves their mouse towards where the scrollbar would be


Screen.Recording.2026-11-21.at.23.58.11.mov

Copilot AI balanced review requested due to automatic review settings November 21, 2026 23:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved scrollbar bugs cause settings to snap back without revealing the bar, leave it visible after resizing, and misalign hit-testing in narrow tool-confirmation dialogs.

3 open issues
What changed in this PR

This PR reduces TUI clutter by hiding scrollbars until users scroll or move the pointer nearby, using the shared animation runtime for fades.

Changes:

  • Adds hover, scrolling, and drag-driven scrollbar visibility.
  • Integrates pointer tracking and animation across chat, sidebar, and dialogs.
  • Adds interaction tests and updates rendering expectations.
File Description
pkg/​tui/​tui.go Routes pointer events and dialog animation ticks.
pkg/​tui/​tui_noop_input_test.go Extracts reusable scrollable-content setup.
pkg/​tui/​scrollbar_pointer.go Tracks and clears scrollbar pointer state.
pkg/​tui/​scrollbar_pointer_test.go Tests fades and drag release outside chat.
pkg/​tui/​page/​chat/​input_handlers.go Exposes scrollbar drag detection.
pkg/​tui/​page/​chat/​chat.go Forwards pointer state and clears it during cleanup.
pkg/​tui/​handlers.go Preserves animation integration when rebuilding dialogs.
pkg/​tui/​dialog/​toolconfirmation/​tool_confirmation.go Positions the scrollbar and routes drag events.
pkg/​tui/​dialog/​testdata/​settings-80x24-Behavior.golden Updates expectations for hidden scrollbars.
pkg/​tui/​dialog/​testdata/​settings-80x24-Appearance.golden Updates expectations for hidden scrollbars.
pkg/​tui/​dialog/​settings.go Supports manual scrolling and scrollbar positioning.
pkg/​tui/​dialog/​scrollbar.go Connects dialog scrollviews to shared animation.
pkg/​tui/​dialog/​manager_test.go Tests scrollbar interaction in moved dialogs.
pkg/​tui/​dialog/​dialog.go Manages scrollbar animation and pointer lifecycle.
pkg/​tui/​components/​sidebar/​sidebar.go Integrates sidebar scrollbar visibility.
pkg/​tui/​components/​scrollview/​visibility.go Implements visibility timing and fade rendering.
pkg/​tui/​components/​scrollview/​visibility_test.go Tests fades, scrolling, and drag visibility.
pkg/​tui/​components/​scrollview/​scrollview.go Reveals scrollbars on input and renders hidden gutters.
pkg/​tui/​components/​scrollview/​scrollview_test.go Updates composition expectations.
pkg/​tui/​components/​scrollview/​fade_test.go Explicitly reveals scrollbars in edge-fade tests.
pkg/​tui/​components/​scrollview/​compose_nodiscardview_test.go Makes the composition oracle visibility-aware.
pkg/​tui/​components/​messages/​messages.go Integrates transcript scrollbar animation and cleanup.

Review effort: Balanced

Comment thread pkg/tui/dialog/settings.go Resolved
@aheritier aheritier added area/tui For features/issues/fixes related to the TUI kind/feat PR adds a new feature (maps to feat:). Use on PRs only. labels Nov 21, 2026
@krissetto
krissetto force-pushed the auto-hide-scrollbars branch from f21e7d6 to b27f85a Compare November 21, 2026 23:32
Copilot AI balanced review requested due to automatic review settings November 21, 2026 23:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

A critical scrollbar-release path skips selection cleanup, leaving the mouse-button state active and causing later mouse motion to resume selection and autoscrolling.

1 open issue
3 resolved since last review

Review effort: Balanced

@krissetto
krissetto force-pushed the auto-hide-scrollbars branch from b27f85a to e573715 Compare November 21, 2026 23:53
Copilot AI balanced review requested due to automatic review settings November 21, 2026 23:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Resizing the settings dialog can leave a stale scrollbar visible after its opacity reaches zero, with no remaining animation ticks to repaint it.

2 open issues

Review effort: Balanced

Comment thread pkg/tui/dialog/settings.go Resolved
Signed-off-by: Christopher Petito <chrisjpetito@gmail.com>
@krissetto
krissetto force-pushed the auto-hide-scrollbars branch from e573715 to 16bccd2 Compare November 22, 2026 00:21
Copilot AI balanced review requested due to automatic review settings November 22, 2026 00:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues block approval of the scrollbar visibility changes.

1 open issue
1 resolved since last review

Review effort: Balanced

@krissetto
krissetto marked this pull request as ready for review November 22, 2026 00:28
@krissetto
krissetto requested a review from a team as a code owner November 22, 2026 00:28
@krissetto
krissetto enabled auto-merge November 22, 2026 00:28

This branch has not been deployed

No deployments
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/feat PR adds a new feature (maps to feat:). Use on PRs only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants