Repository navigation
Theme the scrollbars and keep the split view's sides scrolled together - #34
Merged
Merged
Conversation
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
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.
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
--borderon a transparent track, brightening to--gutter-fgwhile the pointer is over that pane. It is one rule at the top ofstyle.cssbuilt from existing theme variables, so all 16 themes (light ones included) get matching scrollbars and no theme fields change. Browsers withoutscrollbar-colorget the same look through::-webkit-scrollbarrules.Synced scrolling in split view
The two panes of the split view already tried to follow each other, with three problems:
syncScrollcopiedscrollTopone 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.scrollTops drift apart below every thread and paired lines stop being level.syncScrollnow runs straight from the scroll event and copiesscrollLeft.alignedScrollTopfinds 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.echokeeps 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 checkandruff format --checkonly confirm nothing else moved.alignedScrollTopwas 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