Repository navigation
feat(git-history): ragged gutters and a ten-lane window; fix(app-workspaces): id entropy - #1673
Merged
Merged
Conversation
…at ten The gutter used to be padded to the widest row in the page, so one commit sitting alone on one lane still reserved the width of twelve lanes and the subject started far to the right of the line it belongs to. Now a row's drawing is only as wide as the lanes that row actually uses, so a one-lane commit's refs start one lane in and the page pays for its busiest row rather than for its busiest row in every row. That budget is what makes a ten-lane window affordable where six used to be the phone's limit: a line of work past the tenth still folds into the tenth column and is marked `*` (a diamond on the phone and the desktop), so the cap, the fold mark and the six-colour palette all behave as before — the palette now repeats every six columns out of ten, which is the distance the comment already relied on. The columns (date-time, committer) are still a block read down the list, so what fits is decided once per page against its widest gutter: a row cannot drop the committer while its neighbour keeps it. Three surfaces, one picture: host/src/git_history.rs (what the phone and the desktop decode), tui/src/workbench/git_panel.rs and tui/src/workbench/screen.rs (the `/git` panel), with the demo fixtures re-dumped from a real eleven-branch repository so the screenshots are real output rather than a hand-drawn grid.
The window's last column is shared by every line past the tenth, so a `│` there claimed a lane this row does not have: nothing distinguished "this column's line" from "the work continues past the window", and that is how several folded lines came to read as one branch running down the page. On a row that has no commit of its own in that column the bundle now draws `┊` — same column, same width, same colour — and only while a bundle exists: inside the window the last column stays an ordinary lane with its solid `│`, so a ten-lane history prints exactly what it printed before. A connector (`┬`, `┐`, the fold's own `*`) keeps its shape; the change is about the straight run. The phone and the desktop decode `┊` as a dashed stroke rather than a new kind of line: it is the same thread, seen through the window's edge. Fixtures re-dumped from the real eleven-branch repository those screenshots use, so the demo data is the host's current output and not a picture typed out by hand.
huichen
enabled auto-merge (squash)
November 22, 2026 16:30
…exhaust The id is a prefix, the local time to the second, and a random suffix, so every row created inside one second differs only in the suffix. That suffix was three random bytes — 24 bits to separate a whole second's worth of rows — and a burst of 210 rows in one second is a 1-in-768 birthday collision: UNIQUE constraint failed: workspaces.id which is exactly how `Rust Linux test / host-remote` failed on PR #1673: `the_handshake_confirmation_does_not_grow_with_the_catalogue` creates 10 + 200 conversations in ~80 ms, each through `create_thread` -> `create_id("ws")`, in a HOME the fixture owns privately. Nothing races there — the loop is single-threaded and each insert runs in its own BEGIN IMMEDIATE — so two rows could only carry the same id by being *minted* with the same id, and the id column has no default or trigger to supply one. Measured on the current generator: 2 of 2 000 bursts of 210 ids contained a duplicate, and a burst of 100 000 produced 330 (99670 unique), matching C(n,2)/2^24. These are primary keys on every row kind the Host store mints (`ws`, `thread`, `event`, `artifact`, `approval`, `rsnap`, `review`, ...), so the exposure is not a test's: a bulk import or an importer's replay of a few hundred conversations in one second fails the same way on a user's machine. Eight bytes of the v4 UUID (60 bits after its version nibble) put a burst of n ids in one second at n^2/2^61 of a repeat, which no caller reaches. Tests: the shape test states the new width, and a burst of 20 000 ids must contain no repeat — it fails on the three-byte suffix about twelve times per run and passes on eight.
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.
The git lane graph now sizes each row's gutter to the lanes that row actually
uses, widens the drawing window from six lanes to ten, and draws the bundle's
folded thread broken. The change spans all three surfaces: the host decoder,
the TUI
/gitpanel, and the desktop/mobile history panels. A one-lane row nolonger reserves the width of the busiest row on the page, so subjects start
next to their own lane while a page still pays only for its busiest row; work
past the tenth column is still marked and can no longer read as one branch
running down the page.
The branch also carries a fix for Host store id minting: the random suffix was
24 bits, so a burst of a few hundred rows in one second hit a birthday
collision (
UNIQUE constraint failed: workspaces.id) — this is what failedRust Linux test / host-remotein the first CI run of this PR. The suffix isnow 60 bits.
Commits
Verification
Local, at the frozen head 272ca80 (pinned Rust 1.99.1,
ulimit -n 8192):cargo fmt --all -- --check— cleancargo check -p future-host -p future-tui— cleancargo clippy -p future-host -p future-tui --all-targets -- -D warnings— cleancargo test -p future-host --lib— 2341 passed, 0 failed, 15 ignoredcargo test -p future-tui --lib— 1849 passed, 0 failedcargo test -p future-app-workspaces --lib— 23 passednpx tsc --noEmit -p packages/git-graph/tsconfig.json— cleannpx vitest run packages/git-graph/src/index.test.ts— 25 passednpm run typecheckclean;vitest run src/features/git-history25 passed;eslinton the touched files cleannpm run typecheckclean (local jest cannot start because this checkout'snode_moduleslacks@react-native/js-polyfills/error-guard; CI runs the mobile suite)make check-docs— 425 docs OKpython3 scripts/tests/test-screenshot-scenario-fragments.py— okUser-visible changes
/git, desktop history panel, mobile git graph): the lane window grows from 6 to 10, and each row's gutter is now only as wide as that row's own lanes. Before: every row was padded to the widest row on the page, and work past six lanes folded into column six. After: a one-lane row's subject starts one lane in, the page is as wide as its busiest row, and work past ten lanes folds into column ten with the*(diamond on phone and desktop) marker. Revert: 9aa1d90.┊in the TUI; a dashed stroke on phone and desktop) instead of a solid line, so folded work is distinguishable from a real lane in that column. Revert: 9ed6a6e.UNIQUE constraint failed. Ids keep the same prefix and timestamp shape; only the suffix widens. Revert: 9cf3231.Notes
desktop/shot/mock,mobile/shot/mockand thegit-lane-windowscreenshot scenario were re-dumped from an eleven-branch repository, so the screenshots show real output rather than a hand-drawn grid.palette.tscomment documents.