Skip to content

fix(widgets): keep the section border under a panel scrollbar - #2974

Open
sinelaw wants to merge 1 commit into
masterfrom
claude/fix-tour-border-short-dock
Open

fix(widgets): keep the section border under a panel scrollbar#2974
sinelaw wants to merge 1 commit into
masterfrom
claude/fix-tour-border-short-dock

Conversation

@sinelaw

@sinelaw sinelaw commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Fixes sub-issue 3b of #2969 — "Tour explanation box loses its right border at short dock heights".

What was wrong

collect_labeled_section widens a child's scroll region by two columns on purpose, so the bar lands on the section's border rather than floating a column inboard (and so a wheel over the border still scrolls the list). render_scrollbar then paints one blank cell per row — correct over a list's own padding, destructive over a border. Every row the bar covered lost the box's right edge.

That is the whole of 3b: the border is not "missing", it is overwritten by a space. Reading the same frame with colours shows it — the last column of each content row is a space carrying the scrollbar's thumb/track background:

lines 1–88                        ^[[38;5;170m^[[48;5;226m ^[[39m   <- thumb, was `│`
                                  ^[[48;5;238m ^[[39m                <- track, was `│`

Which explains the height threshold in the issue (140x45/44/42 fine, 40 and below broken) and why width is irrelevant: a shorter dock is simply what makes the prose overflow its window and earn a scrollbar. Same for "opening the tour into an already-open bottom dock renders borderless immediately" — that dock is shorter from the start.

The fix

render_scrollbar_over_chrome paints the same track/thumb colours but keeps whatever glyph is already in the column, re-styling only its background. Used at the two widget-panel paint sites (split-mounted panels, floating panels), which are exactly the bars whose regions were extended onto the section border. Every other scrollbar in the editor — file browser, settings, keybinding editor, prompt suggestions, buffer scrollbars — is untouched.

The box stays closed, the bar still reads as a bar (border glyph in thumb/track colours), and over an ordinary list row — a space — it paints identically to before, so is_scrollbar_thumb_at / is_scrollbar_track_at and the existing drag/hit-test behaviour are unaffected.

Verified by hand under tmux at 140x36: content rows are back to 137 columns ending in , with the scrollbar's background still on that column.

Test

test_overflowing_lists_keep_the_section_border in crates/fresh-editor/tests/e2e/code_tour_dock.rs loads the existing overflow-tour fixture (both the Steps rail and the prose overflow), then asserts on rendered output only: on each of the two columns, the bar is present (a thumb or track cell — this must not pass by having no scrollbar at all) and every content row between the top and bottom borders still carries .

Without the fix: left: Some(" "), right: Some("│") at the first content row. With it, it passes.

Checks

  • cargo fmt, cargo clippy, cargo check --all-targets
  • e2e modules most exposed to the change, run before the final commit: code_tour (34), dock (145), orchestrator (145), scrollbar (82) — all pass. The rest is left to CI.

🤖 Generated with Claude Code

https://claude.ai/code/session_013LV5WvsL3drUfQmFRMe4kP


Generated by Claude Code

A widget panel's scroll region is deliberately widened by two columns so it
reaches through the right padding and onto the wrapping `LabeledSection`'s
`│` border — the bar hugs the box edge instead of floating a column inboard,
and a wheel over the border still scrolls the list. But the bar is painted
as a blank cell per row, which is right over a list's own padding and wrong
over a border: it rubbed the box's right edge out on every row it covered.

The code tour's explanation box is where this shows: as soon as its prose is
taller than the rows it has — any short dock, which includes a tour opened
into an already-open bottom dock — the box renders with a top and a bottom
border and no right edge at all in between. At width 140 it is correct at
heights 45/44/42 and broken at 40 and below, purely because the shorter dock
is what makes the prose overflow. Width has nothing to do with it.

Paint those two bars (split-mounted panels and floating ones) through a
scrollbar renderer that keeps the glyph already in the column and re-styles
only its background. The border stays closed, the bar still reads as a bar,
and over an ordinary list row — a space — it paints exactly as before.

Fixes sub-issue 3b of #2969.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013LV5WvsL3drUfQmFRMe4kP
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.

2 participants