Add layout modes, Block/RenderBlock, PaneScroller, and scroll support#1
Merged
Merged
Conversation
New layout modes: SidebarOnly (full-height sidebar + one main pane), Tabbed (tab bar + active pane content), Floating (pane 0 background with panes 1/2 as overlaid panels). Layout mode cycle updated in demo. Block/RenderBlock: multi-line content primitive parallel to Row/RenderRow. Header line uses Item styles (selected/muted states); body indented to prefix width using DetailBody. A Block with no Body is byte-identical to the equivalent RenderRow output. PaneScroller: scroll-state helper (ScrollDown, ScrollUp, ScrollToTop, ClampTo, CanScrollDown). Pane.ScrollOffset applied post-render in renderPane and renderTabbed via shared applyScrollOffset helper. Bug fix: renderTabbed previously ignored ScrollOffset entirely. paneBorders struct replaces rightBorder/bottomBorder bool args on renderPane, enabling full four-sided borders for Floating panels. placeBoxAt extracted from overlayOnBase as shared compositor. Theme and Styles field comments added throughout for library consumers. README updated with layout table, Block/scroll sections, and demo key table. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
SidebarOnly(full-height sidebar + single main pane),Tabbed(tab bar across the top, focused pane fills below), andFloating(pane 0 as background, panes 1/2 as right-anchored overlaid panels) alongside the existingStackedRightandThreeColumnBlock/RenderBlock: multi-line content primitive parallel toRow/RenderRow— header line with optional right-alignedMeta, optional multi-lineBodyindented to the prefix column;SelectedandMutedstates work identically toRenderRow; aBlockwith noBodyis byte-identical to the equivalentRenderRowoutputPaneScroller: scroll-state helper withScrollDown,ScrollUp,ScrollToTop,ClampTo, andCanScrollDown;Pane.ScrollOffsetis applied post-render via sharedapplyScrollOffsethelper used by bothrenderPaneandrenderTabbedBug fix
renderTabbedpreviously ignoredPane.ScrollOffsetentirely — scrolling silently did nothing in Tabbed mode. Fixed by callingapplyScrollOffsetbeforeclampView, matching the existing behaviour inrenderPane.Internal changes
paneBordersstruct replacesrightBorder, bottomBorder boolonrenderPane, enabling four-sided borders for Floating panelsplaceBoxAt(base, box, x, y, …)extracted fromoverlayOnBaseas shared compositor; both modal overlays and floating panels use itThemeandStylesfield comments added for library consumers building custom themes or reaching intorenderer.StylesdirectlyTest plan
go test ./...— all tests pass including new tests for each layout mode, Block rendering, scroll offset, PaneScroller bounds, and Tabbed scroll fixgo vet ./...— cleango run ./cmd/demo— presslto cycle all five layouts,j/kto scroll panes,gto jump to top,tfor theme picker,dfor density🤖 Generated with Claude Code