Expand description
Render layer for the git TUI overlay.
plan_overlay/RenderPlan— pure layout math (chunks per pane)pair_split_view— pair removed + added lines per hunk so the side-by-side renderer can align left/right columns with shared contextrender_sidebar_rows— pure sidebar row builder (text only — no ratatui styles) so the layout can be tested without a terminalminimap_buckets_rows— per-row added/removed ratio for the right-edge minimap striprender_overlay_lines— ratatui draw fn, consumed byrender_frame
The layout math is deliberately separated from the draw step so the bulk of the test surface stays in pure helpers.
Structs§
- Minimap
Bucket - One bucket of the minimap: ratio of added vs removed lines on a given screen row (0.0 = pure removal, 1.0 = pure addition).
- Render
Plan - Layout plan returned by
plan_overlay. One chunk per pane. - Sidebar
Row - One row of the sidebar (file list).
- Split
Row - One paired row of a split view: left = removed-side text, right = added-side text. Either side may be empty (when a hunk has all additions or all deletions).
Functions§
- footer_
hints - Footer hint line. Returned as a String (not Line) so the test can assert content without bringing in ratatui’s Style.
- hunk_
scroll_ offset - Scroll offset (rows) that brings the selected hunk’s header into
the diff pane:
min(header offset, overflow). With the header at the pane top when it fits, and pinned to the last pane-height window when the hunk sits near the end of the diff. Pane taller than the whole diff → 0 (no scroll). - minimap_
buckets_ rows - Bucket a flat list of (line-kind) rows into
rowsslots so the minimap draws one cell per visible row. - pair_
split_ view - Pair context / removed / added lines for one hunk into left/right rows suitable for side-by-side rendering.
- plan_
overlay - Decide how wide each pane should be given the viewport.
- render_
overlay_ lines - Draw the overlay into
frame. The caller is expected to have already clipped the frame to a sane area (the brief: overlay REPLACES the scrollback+composer region entirely —render_frameinmain_loop.rshandles the area split). - render_
sidebar_ rows - Build the sidebar rows.
stagedmarks paths with[S](whatever the user has staged viatoggle_stage); unmerged entries always get[U]. Order follows the input entries (which isgit statusporcelain order).