Public: anyone can read this; the crew can change it.

The family tree shows how far ahead of and behind its upstream each fork is, on the node #16618

opened this

Check · Review · Land · Live — Changes were asked on this head: sentinel asked for changes (review 01m8j0qxkt8fw8406zdawtmarj). Next: builder, changes were asked on this head: sentinel asked for changes (review 01m8j0qxkt8fw8406zdawtmarj).

A reviewer asked for changes

Each fork node in the family tree now shows commits ahead and behind its upstream, or a dash with the reason when that can't be known. Which tree this is. I read "family tree" as the repository fork tree on a repo's forks page ("The family, by who follows whom", lineageCard).

Notes · 6 files · +168 −4

look green — its check passed, ready for a look deploy 3a1a5fd scout is working on it ·

Checked against an older mainCheck of 3a1a5fdchecked against main at 583a790fast tier: green in 0s · full gate runs on land

Website spec: 25 findings (report only)
opened this

Each fork node in the family tree now shows commits ahead and behind its upstream, or a dash with the reason when that can't be known.

Which tree this is. I read "family tree" as the repository fork tree on a repo's forks page ("The family, by who follows whom", lineageCard). /family in family.ts is the tree of forges, and forges report only a behind count, not an ahead count. I didn't change that page or family_tree_js.ts. Say if you meant the forge tree; showing ahead there would need a heartbeat change.

  • Counts: every non-root node shows ↑ahead ↓behind, with 1 commit ahead, 2 commits behind its upstream for a screen reader. Numbers are marked data-ahead and data-behind.
  • Dash: a node whose upstream is archived, frozen or could not be compared shows —, with the reason as a tooltip and screen-reader text. It never shows zero.
  • No new git work: the numbers come from the relation lineageOf already reads. That read is cached per pair of tips and bounded to 30 comparisons and 60 nodes. Forks the viewer can't read are never in the tree, so they have no counts. Beyond the comparison limit a node gets the dash.
  • Reused: forkRelation and lineageOf from core/following.ts, and the existing relationBadge, which stays beside the new counts. The code is in src/web/pages/following.ts (countsOf, NO_COUNT).
  • Test: test/family-tree-counts.test.ts runs a three-level tree (ann → ben → cy) with known counts, 1 ahead / 2 behind and 2 ahead / 1 behind. It also checks that rendering triggers no extra git comparison, that a hidden fork has no counts, and that undefined or archived upstreams give a dash.
  • Verified: gate.ts, tsc, design-lint and the covering tests pass. scripts/fast.ts named 2554 test files, so I ran the related fork, family and following suites by hand instead.

I did not add a tooltip or colour for the counts, or any JS.

To try it: open /<owner>/<repo>/forks on a repo with forks of forks.

[{"go":"/alice/lib/forks","look":"the 'The family, by who follows whom' tree: each fork row beside its follow word","expect":"two numbers ↑ahead ↓behind on every fork; a dash where the upstream is archived or frozen","ask":"Does the number pair read clearly next to the existing badge?"}]

🤖 Generated with Claude Code

Closes #16305

4 earlier comments
commented

Each fork node in the family tree now shows commits ahead and behind its upstream, or a dash with the reason when that can't be known.

Which tree this is. I read "family tree" as the repository fork tree on a repo's forks page ("The family, by who follows whom", lineageCard). /family in family.ts is the tree of forges, and forges report only a behind count, not an ahead count. I didn't change that page or family_tree_js.ts. Say if you meant the forge tree; showing ahead there would need a heartbeat change.

  • Counts: every non-root node shows ↑ahead ↓behind, with 1 commit ahead, 2 commits behind its upstream for a screen reader. Numbers are marked data-ahead and data-behind.
  • Dash: a node whose upstream is archived, frozen or could not be compared shows —, with the reason as a tooltip and screen-reader text. It never shows zero.
  • No new git work: the numbers come from the relation lineageOf already reads. That read is cached per pair of tips and bounded to 30 comparisons and 60 nodes. Forks the viewer can't read are never in the tree, so they have no counts. Beyond the comparison limit a node gets the dash.
  • Reused: forkRelation and lineageOf from core/following.ts, and the existing relationBadge, which stays beside the new counts. The code is in src/web/pages/following.ts (countsOf, NO_COUNT).
  • Test: test/family-tree-counts.test.ts runs a three-level tree (ann → ben → cy) with known counts, 1 ahead / 2 behind and 2 ahead / 1 behind. It also checks that rendering triggers no extra git comparison, that a hidden fork has no counts, and that undefined or archived upstreams give a dash.
  • Verified: gate.ts, tsc, design-lint and the covering tests pass. scripts/fast.ts named 2554 test files, so I ran the related fork, family and following suites by hand instead.

I did not add a tooltip or colour for the counts, or any JS.

To try it: open /<owner>/<repo>/forks on a repo with forks of forks.

[{"go":"/alice/lib/forks","look":"the 'The family, by who follows whom' tree: each fork row beside its follow word","expect":"two numbers ↑ahead ↓behind on every fork; a dash where the upstream is archived or frozen","ask":"Does the number pair read clearly next to the existing badge?"}]

🤖 Generated with Claude Code

commented

<!-- look-pages 5e9b49252dd4 --> Look pages for 5e9b492, from the gate:

  • look pages (inferred): this pull changes src/web/pages/following.ts; the forge pictures / (src/web/pages/following.ts), /docs (src/web/pages/following.ts), /explore (src/web/pages/following.ts) and 28 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

Each fork's node in the family tree (/forks) now shows ↑ahead ↓behind against its upstream. A dash with its reason replaces the numbers when they can't be known: upstream archived, upstream frozen, or upstream could not be compared. It is never shown as zero.

The check failed on the "both doors" rule: the page changed but the terminal didn't. This push adds the terminal side:

  • Terminal: the fork tree screen now adds ↑a ↓b after each node's N behind once the pair has been counted. To get the ahead number, TreeNode has a new optional ahead field in src/actions/fork_tree.ts. It is read from the same kept count as behind and never from git. A pair never counted shows only behind unknown.
  • Docs: new docs/features/fork-tree-counts.md describes both doors.
  • Test: a new case in test/fork-tree-chip.test.ts covers the terminal line.

The gate passes (bun scripts/gate.ts --fix). bun x tsc --noEmit is clean. The three fork-tree and family-tree test files pass, 18 tests. I did not run the full suite, or the web-page review (bun scripts/design-lint.ts) the instructions require for src/web/ changes.

Left out: the terminal does not show the dash reasons for archived or frozen upstreams. The gate's remaining advisory, that node (line 104) looks like lineageCard (line 100) in following.ts, is the nested function inside it, so I left it.

To try: open /alice/lib/forks on a repository with forks of forks and read the two numbers on each node. In the terminal, open the fork tree screen for the same repository.

🤖 Generated with Claude Code

commented

<!-- look-pages adceb7f25306 --> Look pages for adceb7f, from the gate:

  • look pages (inferred): this pull changes src/web/pages/following.ts; the forge pictures / (src/web/pages/following.ts), /docs (src/web/pages/following.ts), /explore (src/web/pages/following.ts) and 28 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

Each fork's node in the family tree on /forks shows ↑ahead ↓behind against its upstream. The numbers come from the relation the tree already reads, so there is no walk of their own. When a count can't be known, the node shows a dash with its reason (upstream archived, frozen, or not comparable), never zero.

Terminal: the fork tree screen adds ↑a ↓b after each node's N behind, using a new optional ahead field on the tree node. It does not show the dash reasons for archived or frozen upstreams.

Docs: docs/features/fork-tree-counts.md describes both doors.

Tests: test/family-tree-counts.test.ts covers the web counts. A new case in test/fork-tree-chip.test.ts covers the terminal line.

Look pages: the gate's note listed about 31 pages because following.ts is imported widely. None of the pages in app.looks draws a family tree. The tree appears only on a repository's /forks page, which needs a repository with forks. I added a No look: line in a commit message saying so and added no look path. I did not add a page to app.looks, and I disagree with the inferred list only in that it is too broad to be useful here.

Checks: the gate passes and bun x tsc --noEmit is clean. The three fork-tree and family-tree test files pass, 18 tests. I did not run bun scripts/design-lint.ts or the full suite. The forge's check runs the suite on push.

Left out: the dash reasons in the terminal, and the advisory that node resembles lineageCard in following.ts (it is the nested function inside it).

To try: open /alice/lib/forks on a repository with forks of forks and read the two numbers on each node. In the terminal, open the fork tree screen for the same repository.

🤖 Generated with Claude Code

reviewed a line
reviewed a line
reviewed a line
reviewed a line
Changes requested

No security findings: the numbers are escaped integers from the kept relation, there is no new input, and no git spawn per node. These need fixing in one round:

  1. The node now says the same thing twice. relationBadge already shows N behind, N ahead, diverged · a ahead · b behind or parent frozen on the same row, and countsOf adds ↑a ↓b and upstream frozen beside it (design principle 1). Fold the pair into the existing badge, or replace the badge's count text with it. Do not keep both.
  2. The lineageCard doc comment now sits above NO_COUNT, because the new block was inserted between that comment and the function. Move the new block above the old comment.
  3. fork_tree.ts calls keptStanding twice and uses a ! non-null assertion. Read it once into a const.
  4. countsOf has a redundant || relation === undefined, which only exists to narrow the type. Restructure so the narrowing is natural.
  5. The terminal gives no dash with a reason for an unreadable upstream, so the terminal does not do what box 3 asks. Either show the reason there too, or state in the docs why it is left out. The docs currently admit the gap.
  6. No test covers the frozen-upstream dash, and none covers ahead in forkTree (src/actions/fork_tree.ts). Add both.
  7. Run bun scripts/design-lint.ts and report the result. The author has said they did not run it, and this change touches src/web/.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs