Skip to content

Conversation

@joshka-oai
Copy link
Collaborator

@joshka-oai joshka-oai commented Jan 5, 2026

Summary

  • Add a transcript scrollbar in tui2 using tui-scrollbar.
  • Reserve 2 columns on the right (1 empty gap + 1 scrollbar track) and plumb the reduced width through wrapping/selection/copy so rendering and interactions match.
  • Auto-hide the scrollbar when the transcript is pinned to the bottom (columns remain reserved).
  • Add mouse click/drag support for the scrollbar, with pointer-capture so drags don’t fall through into transcript selection.
  • Skip scrollbar hit-testing when auto-hidden to avoid an invisible interactive region.

Notes

  • Styling is theme-aware: in light themes the thumb is darker than the track; in dark themes it reads as an “indented” element without going full-white.
  • Pre-Ratatui 0.30 (ratatui-core split) requires a small scratch-buffer bridge; this should simplify once we move to Ratatui 0.30.

Testing

  • just fmt
  • just fix -p codex-tui2 --allow-no-vcs
  • cargo test -p codex-tui2

@joshka-oai joshka-oai force-pushed the joshka/tui2-scrollbar branch from 17cf7e6 to db007d0 Compare January 5, 2026 04:49
Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 17cf7e6400

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@joshka-oai joshka-oai force-pushed the joshka/tui2-scrollbar branch from db007d0 to 036cc72 Compare January 5, 2026 05:09
@joshka-oai
Copy link
Collaborator Author

Screen.Recording.2026-01-04.at.9.23.55.PM.mov

Add tui-scrollbar to tui2 and introduce transcript_scrollbar.

Render the scrollbar via a ratatui-core scratch buffer to bridge the
pre-0.30 ratatui types.
Add a `tui-scrollbar`-based vertical scrollbar for the transcript viewport.

- Reserve 2 columns (1 gap + 1 scrollbar) and plumb the reduced width through
  wrapping, selection/copy, and mouse handling so on-screen rendering matches
  interactions.
- Only render the scrollbar when the view is scrolled away from the bottom
  (keep the reserved columns blank when pinned).
- Style track/thumb using terminal fg/bg heuristics so it feels consistent with
  the user prompt block; in light themes the thumb is darker than the track.
Support click/drag on the transcript scrollbar track/thumb.
Use tui-scrollbar's hit testing and drag interaction state, plus a
small pointer-capture flag so dragging doesn't fall through into
transcript selection when the view becomes pinned to bottom.

Skip scrollbar hit-testing when the scrollbar is auto-hidden at bottom,
so the reserved column is not an invisible interactive region.

Move the interaction glue out of app.rs into transcript_scrollbar_ui.
Return an explicit TranscriptScrollbarMouseHandling enum, and expand
docs for reserved column layout and track/thumb theme heuristics.
@joshka-oai joshka-oai merged commit 8f10d3b into main Jan 5, 2026
26 checks passed
@joshka-oai joshka-oai deleted the joshka/tui2-scrollbar branch January 5, 2026 17:05
@github-actions github-actions bot locked and limited conversation to collaborators Jan 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants