Skip to content

Add layout modes, Block/RenderBlock, PaneScroller, and scroll support#1

Merged
allisonhere merged 1 commit into
mainfrom
feature/layouts-blocks-scroll
May 30, 2026
Merged

Add layout modes, Block/RenderBlock, PaneScroller, and scroll support#1
allisonhere merged 1 commit into
mainfrom
feature/layouts-blocks-scroll

Conversation

@allisonhere

Copy link
Copy Markdown
Owner

Summary

  • Five layout modes: adds SidebarOnly (full-height sidebar + single main pane), Tabbed (tab bar across the top, focused pane fills below), and Floating (pane 0 as background, panes 1/2 as right-anchored overlaid panels) alongside the existing StackedRight and ThreeColumn
  • Block / RenderBlock: multi-line content primitive parallel to Row/RenderRow — header line with optional right-aligned Meta, optional multi-line Body indented to the prefix column; Selected and Muted states work identically to RenderRow; a Block with no Body is byte-identical to the equivalent RenderRow output
  • PaneScroller: scroll-state helper with ScrollDown, ScrollUp, ScrollToTop, ClampTo, and CanScrollDown; Pane.ScrollOffset is applied post-render via shared applyScrollOffset helper used by both renderPane and renderTabbed

Bug fix

renderTabbed previously ignored Pane.ScrollOffset entirely — scrolling silently did nothing in Tabbed mode. Fixed by calling applyScrollOffset before clampView, matching the existing behaviour in renderPane.

Internal changes

  • paneBorders struct replaces rightBorder, bottomBorder bool on renderPane, enabling four-sided borders for Floating panels
  • placeBoxAt(base, box, x, y, …) extracted from overlayOnBase as shared compositor; both modal overlays and floating panels use it
  • Theme and Styles field comments added for library consumers building custom themes or reaching into renderer.Styles directly

Test plan

  • go test ./... — all tests pass including new tests for each layout mode, Block rendering, scroll offset, PaneScroller bounds, and Tabbed scroll fix
  • go vet ./... — clean
  • go run ./cmd/demo — press l to cycle all five layouts, j/k to scroll panes, g to jump to top, t for theme picker, d for density

🤖 Generated with Claude Code

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>
@allisonhere allisonhere merged commit d3fc466 into main May 30, 2026
2 checks passed
@allisonhere allisonhere deleted the feature/layouts-blocks-scroll branch May 30, 2026 12:36
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.

1 participant