Skip to content

feat(tui): drag the transcript scrollbar - #303

Merged
daviddanialy merged 3 commits into
mainfrom
feat/tui-scrollbar-drag
Oct 22, 2026
Merged

daviddanialy merged 3 commits into
mainfrom
feat/tui-scrollbar-drag

Conversation

@daviddanialy

Copy link
Copy Markdown
Contributor

Summary

You can now click and drag the transcript scrollbar in kit tui.

Dragging the transcript scrollbar

  • A left press on the scrollbar scrolls instead of starting a text selection.
  • Dragging the thumb keeps the grabbed cell under the pointer. scrollbar_thumb reproduces ratatui's thumb geometry, and the drag picks the smallest scroll offset that renders the thumb at the target row, so grabbing the thumb doesn't make it jump.
  • A press on the track centers the thumb there. Dragging to the last thumb row turns auto-follow back on.
  • Rows past either end clamp, so the drag keeps working off the bar. Motion that leaves the view unchanged doesn't request a redraw.
  • Dialogs drawn over the transcript (sessions, model, effort, file picker, command popup) take the press, not the bar.
  • In a focused child view, drags and releases that cross into the agent roster still reach the child.
  • A drag isn't cancelled by streaming layout changes. A lost release (e.g. letting go outside the terminal) clears on the next press.
  • The docs list the scrollbar as a scroll control.

Testing

  • mise run lint
  • mise run test -- --lib tui:: (628 passed)
  • New app test: thumb grab without a jump, track press, clamping, follow, redraw only on change, a layout change mid-drag, and a lost release.
  • New ui test: renders through draw and checks that the drawn thumb lands under the pointer after each drag.
  • The demo was recorded with VHS. VHS can't send mouse input, so a small pty wrapper injected SGR mouse drag sequences on the scrollbar column.

馃 Generated with Claude Code

Pressing the scrollbar now scrolls instead of starting a text selection.
Dragging the thumb keeps the grabbed cell under the pointer, a press on
the track centers the thumb there, and dragging to the last thumb row
resumes following the bottom. Dialogs over the bar take the press, and
a drag survives streaming layout changes and crossing into a focused
child's agent roster.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@kit-code-agent kit-code-agent Bot 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.

Grabbing the thumb can change the transcript offset without pointer movement and unexpectedly resume auto-follow. A full-track thumb also forces the transcript to the top and disables following.

Took 13 min

Comment thread src/tui/app.rs Outdated
Comment thread src/tui/app.rs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@kit-code-agent kit-code-agent Bot 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.

Dragging past the bottom does not restore auto-follow when a non-bottom scroll offset already renders the thumb at its last row.

Took 5 min 54 sec

Comment thread src/tui/app.rs Outdated
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@kit-code-agent kit-code-agent Bot 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.

No issues found. The changes look good to merge.

Took 8 min 53 sec

@daviddanialy
daviddanialy merged commit 16f6d08 into main Oct 22, 2026
5 checks passed
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