Skip to content

feat: every column of the graph is as wide as you drag it, and stays that way - #19

Open
FrancescBagur wants to merge 1 commit into
masterfrom
feat/graph-column-widths
Open

FrancescBagur wants to merge 1 commit into
masterfrom
feat/graph-column-widths

Conversation

@FrancescBagur

Copy link
Copy Markdown
Owner

What this changes

Every edge between two columns of the graph can be dragged, and the width it is left at is remembered.

  • A strip of names above the rows (Branch / tag, Graph, Message, Author, Date, Hash) with a tick at each edge. An edge is taken hold of there or anywhere down the graph; the line that says so shows only under the pointer.
  • Each edge moves one column and the message takes up the difference.
  • A column stops at 32 points (the lanes at one lane and its gutters), and a drag stops when the message is down to its 200, so widening one column never makes another withdraw.
  • The lanes open as far as there are lanes, past the eight they come with.
  • Double-clicking an edge sends its column back to how it came.
  • The widths go in the settings as graph-column <name> <points>, only for a column that was dragged.

What was decided

How GitKraken does it was read out of its bundle first (a width and a floor per column, a handle on each edge in the header and down the column, the width written down when the handle is let go of), and this follows it, with three differences:

  • One column per edge, not a splitter. GitKraken lets the neighbours give way in turn. Here the message is the only thing that gives, which is one rule instead of several and keeps the edge under the pointer whichever one it is.
  • The widths are the window's, not a repository's, like the height of the terminal. The cost: lanes dragged down to one in a repository with two are one lane everywhere until the edge is double-clicked. A column nobody dragged is not written down at all, so it still measures its names or counts its lanes per repository.
  • Hiding columns and reordering them are not in this. GitKraken has both; what was asked for was the width.

Two things a reviewer might not expect:

  • The date and the hash are now cut with an ellipsis when their column is narrower than they are. They may lean into half of the gap on their left, because as it comes the date is a few points wider than its column and has always sat in the gap by that much.
  • tools/poke.c learns press and release. A drag is a button held down while the pointer moves, and it could only click, so this could not have been run without it.

Checked

  • cargo test passes here, not just in CI (420, eleven of them new)
  • It was run -- on an Xvfb with tools/poke: each edge dragged, two double-clicked back, the window closed and opened again to the same widths, a row clicked afterwards. Linux only; nothing of it has been seen on macOS or Windows.
  • Anything that writes (index, stash, branches, remote) or touches the
    graph layout carries a test -- the column layout is a function of its own now, with nine tests, and the setting has two
  • Commits are signed off (git commit -s) and read as sentences

🤖 Generated with Claude Code

…that way

The edges between the columns can be dragged: the branches' column, the
lanes, and author, date and hash on the right. There is a strip of names
above the rows now, with a tick at each edge, and an edge can be taken
hold of there or anywhere down the graph. The line that says so shows
only under the pointer, so the rows are still read without one.

Each edge moves one column and the message takes up the difference. A
column stops at thirty-two points -- the lanes at one lane and its
gutters -- and a drag stops when the message is down to what it needs,
so widening one column never makes another withdraw. The lanes open as
far as there are lanes, which is further than the eight they come with.
Double-clicking an edge sends its column back to how it came.

How GitKraken does it was read out of its bundle first: a width and a
floor per column, a handle on each edge in the header and down the
column, the neighbours giving way, and the width written down when the
handle is let go of. Hiding columns and putting them in another order,
which it also has, are not in this.

The widths are the window's and not a repository's, like the height of
the terminal: `graph-column <name> <points>` in the settings, and only
for a column that was dragged. One left alone still measures the names
it holds, or counts its lanes.

The date and the hash are cut with an ellipsis when their column is
narrower than they are. They were never cut before, because they could
not be narrower.

tools/poke learns `press` and `release`. A drag is a button held down
while the pointer moves, and it could only click.

Tried on Linux on an Xvfb: each edge dragged, two double-clicked back,
the window closed and opened again to the same widths, a row clicked
afterwards. Nothing of it has been seen on macOS or Windows.

Signed-off-by: Francesc Bagur <francesc.bagur@coffeesoftware.io>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@FrancescBagur
FrancescBagur force-pushed the feat/graph-column-widths branch from 72ba30c to da3061d Compare December 1, 2026 09:06
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