Skip to content

feat(git-graph): draw a six-lane window instead of widening the gutter - #1666

Merged
huichen merged 2 commits into
mainfrom
dev-huichen
Nov 21, 2026
Merged

huichen merged 2 commits into
mainfrom
dev-huichen

Conversation

@huichen

@huichen huichen commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

The gutter stopped at six lanes: for any line of work past the sixth, its commits
keep their dots but are drawn inside the last column, sharing it with the other
lines past the window. The picture stays 12 cells / 91 pt wide instead of growing
by two cells per extra lane (a history with ten lanes open used to take 40 cells
on a phone, leaving the subject about one word).

LANE_WINDOW = 6 in both producers (host/src/git_history.rs, tui/src/workbench/git_panel.rs)
so the TUI, the phone and the desktop draw the same gutter.

Assertions:

  • the_gutter_stops_widening_past_the_window (TUI): with ten lanes, every row's
    gutter is ≤ 12 cells and equal in width, and a commit on the tenth lane still
    has its o in that column.
  • the_picture_stops_widening_past_the_window (host): a real ten-branch repo is
    laid out and every row is ≤ 12 cells, dots sit on even cells and never past the
    window, and one row uses all six columns.

docs/guide/tui.md and tui.zh-CN.md describe the cap; packages/git-graph/src/palette.ts
records why six colours still stand.

User-visible changes

  • Git graph gutter: before, a history with more than six open lanes widened the
    gutter by two cells per extra lane (ten lanes took 40 cells on a phone). After,
    LANE_WINDOW = 6 keeps the gutter at 12 cells in the TUI, desktop and mobile;
    commits past the sixth lane keep their dots but share the last column.
    Revert 3f502d25e to restore the widening gutter.

A lane is two cells and the subject starts after the gutter, so a log with
ten lines of work open pushes every subject twenty cells right. The picture
now stops at six lanes: a line past the sixth is drawn inside the last
column, sharing it with the other lines out there. It keeps its commits and
their dots; it just no longer has a column of its own, and the six colours
are the six columns.

Capped in both producers — the host's picture (what the phone and desktop
decode) and the TUI's own — so all three surfaces draw the same gutter.
@huichen
huichen merged commit 9b584a0 into main Nov 21, 2026
25 checks passed
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