Skip to content

Theme the scrollbars and keep the split view's sides scrolled together - #34

Merged
dgsienko merged 4 commits into
dgsienko:mainfrom
bwets:feat/themed-scrollbars
Nov 20, 2026
Merged

dgsienko merged 4 commits into
dgsienko:mainfrom
bwets:feat/themed-scrollbars

Conversation

@bwets

@bwets bwets commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

What

Two changes to how the web UI scrolls.

Themed scrollbars

The web UI had no scrollbar styling, so every pane showed the browser's default bar: wide and light grey, which stands out on the dark themes. Every element now gets a thin thumb in --border on a transparent track, brightening to --gutter-fg while the pointer is over that pane. It is one rule at the top of style.css built from existing theme variables, so all 16 themes (light ones included) get matching scrollbars and no theme fields change. Browsers without scrollbar-color get the same look through ::-webkit-scrollbar rules.

Synced scrolling in split view

The two panes of the split view already tried to follow each other, with three problems:

  • syncScroll copied scrollTop one animation frame late and cleared its guard before the other pane's scroll event arrived, so that event was synced back. During a fast or smooth scroll the panes could fight.
  • Sideways scrolling was not synced.
  • A comment thread or comment box takes room on one side only, so equal scrollTops drift apart below every thread and paired lines stop being level.

syncScroll now runs straight from the scroll event and copies scrollLeft. alignedScrollTop finds the row (hunk header or line) at the top of the source pane, which sits at the same index in both panes, and scrolls the other pane to put that row at its top, the same distance into it. While the source scrolls through a thread the other side lacks, the other side waits at the start of the next row. echo keeps the position it set on the other pane, so that pane's own scroll event is recognised and not synced back. The file tree and the unified view are untouched.

Tests

CSS and frontend only, and the web UI has no JavaScript tests, so pytest (317 passed), ruff check and ruff format --check only confirm nothing else moved. alignedScrollTop was checked against fake panes: rows above, inside and below a one-sided comment thread, scrolling either pane. Both changes were checked by hand in the web UI on long C# files, with whole-file context and long lines.

README and AGENTS.md are updated. Version bumped to 0.12.0, like #31, #32 and #33; whichever merges later only needs the version line resolved.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xshwvphn2wQmVKLLS2G9kJ

bwets and others added 2 commits November 20, 2026 15:27
The web UI had no scrollbar styling, so every pane showed the browser's
default bar, light grey and wide on a dark theme. All elements now get a
thin thumb in --border on a transparent track, brightening to
--gutter-fg on hover, with ::-webkit rules for browsers without
scrollbar-color.

Bump version to 0.12.0

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xshwvphn2wQmVKLLS2G9kJ
The split panes copied scrollTop to each other one animation frame
late, and cleared their guard before the other pane's scroll event
arrived, so that event was synced back and the panes could fight during
a fast or smooth scroll. Sideways scrolling was not synced at all. And
since a comment thread or comment box takes room on one side only,
equal scrollTops drifted apart below every thread.

syncScroll now runs straight from the scroll event, copies scrollLeft,
and scrolls the other pane so the row at the top of this one is at its
top too. It remembers the position it set, so the other pane's echo is
ignored. The file tree and the unified view are untouched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xshwvphn2wQmVKLLS2G9kJ
@bwets
bwets requested a review from dgsienko as a code owner November 20, 2026 15:41
@dgsienko
dgsienko merged commit 736e884 into dgsienko:main Nov 20, 2026
4 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.

2 participants