feat(ui): vertical scrollbar thumb on navigation pane right border#152
Merged
feat(ui): vertical scrollbar thumb on navigation pane right border#152
Conversation
Add direct unit tests for FileTree.ScrollState and TOC.ScrollState (including the activeSection-driven offset path used when diff has focus). Extend TestApplyNavigationScrollbar with vh=1, overscrolled offset, empty input, proportional thumb sizing, and the unexpected-line-count bail. Add paneDiff-focus regression for the navigation thumb to cover the inactive-border ANSI envelope. Document scrollbarSpec field semantics, point applyScrollbar / applyNavigationScrollbar wrappers at applyPaneScrollbar's contract, and name the ScrollState freshness precondition. Update ARCHITECTURE.md interface method counts (15->17, 7->9) for the new ScrollState method on FileTreeComponent / TOCComponent.
There was a problem hiding this comment.
Pull request overview
Extends the existing post-render vertical scrollbar thumb rendering so the same right-border ┃ indicator can appear on the navigation pane (file tree / markdown TOC) when that pane is scrollable, matching the diff pane’s behavior.
Changes:
- Refactors diff scrollbar logic into a shared
applyPaneScrollbar(scrollbarSpec)and addsapplyNavigationScrollbarusing sidepane scroll state. - Exposes
sidepane.ScrollState{Total, Offset}viaFileTree.ScrollState()andTOC.ScrollState(), and threads that state throughView()/renderTwoPaneLayout. - Adds/extends unit and view-level tests covering navigation scrollbar placement, sizing, and focus-style ANSI envelope behavior; updates docs/README/CLAUDE.md accordingly.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| docs/ARCHITECTURE.md | Updates UI pipeline/docs to include navigation scrollbar post-processing and interface method counts. |
| app/ui/view_test.go | Adds view-level assertions for navigation-pane thumbs (tree + TOC) and updates constants. |
| app/ui/view.go | Threads left-pane scroll state into two-pane rendering and applies navigation scrollbar post-render. |
| app/ui/sidepane/toc_test.go | Adds tests validating TOC scroll-state reporting (incl. active-section-driven offset behavior). |
| app/ui/sidepane/toc.go | Exposes TOC scroll state via ScrollState(). |
| app/ui/sidepane/sidepane.go | Introduces shared ScrollState struct for sidepane components. |
| app/ui/sidepane/filetree_test.go | Adds tests validating file tree scroll-state reporting. |
| app/ui/sidepane/filetree.go | Exposes file tree scroll state via ScrollState(). |
| app/ui/scrollbar_test.go | Adds navigation scrollbar unit tests and updates diff scrollbar constant references. |
| app/ui/scrollbar.go | Refactors scrollbar thumb logic into shared helper; adds navigation scrollbar support + new constants. |
| app/ui/model.go | Extends FileTree/TOC component interfaces with ScrollState(). |
| README.md | Updates feature bullet to reflect scrollbar thumbs on diff/tree/TOC panes. |
| CLAUDE.md | Updates gotcha/docs for scrollbar behavior across diff + navigation panes and new constants. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
extend the existing diff-pane vertical scrollbar thumb (introduced in #151) so the same
┃thumb glyph also appears on the right border of the navigation pane (file tree and markdown TOC) when the content is taller than the visible window.implementation
applyScrollbarinto a sharedapplyPaneScrollbar(scrollbarSpec)helper. callers populate the spec from their own scroll-state source —applyScrollbarreads bubbletea viewport state,applyNavigationScrollbarreadssidepane.ScrollStatefrom the file tree or TOC afterRender()runsEnsureVisiblesidepane.ScrollState{Total, Offset}struct exposed byFileTree.ScrollState()andTOC.ScrollState(). for TOC, when the diff pane is focused,Renderaligns the offset toactiveSectionrather than the cursor, soScrollState()reflects what the user actually seesdiffScrollbarFirstViewportRow = 2(top border + single-line header) andnavigationScrollbarFirstViewportRow = 1(top border only). both panes share the shape-check + thumb-rune-replacement logicstrings.LastIndexfinds the right-border│, the slice replacement swaps only that rune, and the thumb's added bold-SGR wrap (\x1b[1m...\x1b[22m) does not disturb the surrounding border fg/bg bytestreePaneHidden()and produce no navigation pane, so no scrollbar is applied theretesting
FileTree.ScrollStateandTOC.ScrollState, including theactiveSection-driven offset path used when the diff pane has focusTestApplyNavigationScrollbarcovers top / bottom / fits-in-viewport, plusvh=1, overscrolled offset, empty input, proportional thumb sizing across YOffsets, and the unexpected-line-count bailpaneTreeandpaneDifffocus (different inactive-border ANSI envelope), and shifts position when the cursor moves to the last entryreviewed via
/code-review-loop(5 claude agents + codex GPT-5 adversarial). codex verdict: approve, 0 findings.