feat(switch): show a scrollbar on the interactive picker list#3198
Merged
Conversation
The picker drives skim with `default-features = false`, which drops
skim's `cli` feature and with it the clap `default_value = "▐"` for the
`scrollbar` option. The library `Default` for the field is then the
empty string, which skim reads as "no scrollbar", so the picker rendered
none. A long worktree (or `--prs`) list scrolled with no position cue,
made worse by `no_info(true)` hiding the matched/total counter.
Set `.scrollbar("▐")` explicitly on the builder. skim paints it only
when the list overflows, as a thumb-only widget (no track) in the
default style, so it reads against the picker's fzf-light theme like
fzf's own scrollbar.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
worktrunk-bot
approved these changes
Jun 24, 2026
max-sixty
marked this pull request as draft
June 24, 2026 17:07
# Conflicts: # src/commands/picker/mod.rs
max-sixty
marked this pull request as ready for review
June 24, 2026 17:52
worktrunk-bot
approved these changes
Jun 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
wt switch's picker rendered no scrollbar. Scrolling a long worktree list (or a longwt switch --prslist) gave no sense of position, and since the builder already setsno_info(true)to hide skim's matched/total counter, there was no positional feedback at all.Why it was silently absent
skim's
scrollbaroption documents a▐default, but that default is a clapdefault_valueon the field, gated on skim'sclifeature:The picker depends on skim with
default-features = false— it drives the library directly and doesn't want skim's own clap CLI compiled in. Withclioff, thedefault_valuenever applies, so the libraryDefaultforscrollbarisString::default(): the empty string. skim draws the thumb only when the indicator is non-empty and the list overflows (!scrollbar_thumb.is_empty() && items.len() > available_rows), so an empty indicator means no scrollbar, ever. The picker had been getting skim's library default, not its CLI default.The fix
Set the indicator explicitly on the builder, next to the other display options:
skim draws it as a thumb-only widget (no track, no arrows) at the rightmost column of the list. It appears only when the list overflows the visible height, so short lists are unchanged and the existing picker snapshots are unaffected.
Known limitation: the thumb inherits the row's color
skim styles the scrollbar thumb with no color of its own, so the
▐takes on the color of whatever row sits beneath it — most visibly the current-line highlight as the cursor scrolls past the thumb's track. The fix lives upstream in skim-rs/skim#1097, which styles the thumb with the theme'sbordercolor so it stays uniform. Once that lands and theskimdependency is bumped, the picker's thumb picks up thebordercolor (dark256's59) with no further change here.Shipping ahead of that fix: the position cue is the point, and the color bleed is cosmetic.
Verification
Driven interactively against a 48-row
--brancheslist in a 30-row terminal, the thumb renders down the right edge of the item pane (column 59, just left of the│preview separator), at the top of its track since the cursor starts on@ main:test_switch_picker_scrollbar_on_overflow(a PTY test) creates enough branches to overflow the test terminal and asserts the thumb renders.