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

A fork's page links its upstream and its siblings count, and the tree page opens at the visitor's own fork #13705

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

A fork's page now links its upstream and counts its siblings, and the forks page scrolls to the visitor's own node. I pushed it. Tests and the type check are green.

Notes

shipped production is serving it deploy 59903fa

opened this

A fork's page now links its upstream and counts its siblings, and the forks page scrolls to the visitor's own node. I pushed it. Tests and the type check are green. The design lint and scripts/gate.ts --fix came back clean, and the commit carries no files from the .claude and .mcp.json folders in the working tree.

What changed

  • Fork page: the header line under a fork already read "forked from owner/name", with a link. It now adds "· N other forks", linking to the upstream's /forks page. N counts the siblings this viewer may read, so a private fork never shows in it. The count is left out when it is 0, and a non-fork shows no upstream line at all. The change is in lineageLine and a new siblingCount in src/web/chrome.ts. The sibling count is passed in by the caller, because test/fork-follow-word.test.ts caps the line at 3 database statements.
  • Tree page: I took "/tree" to mean /:owner/:name/forks, since the repo's /tree/<ref> route is the file browser. On that page the viewer's own node gets id="your-fork" and a data-mine mark, plus an accent bar. :target adds a background, so #your-fork scrolls to it and highlights it. This is in lineageCard in src/web/pages/following.ts, with two CSS rules in src/web/style/components.ts. Only the first of the viewer's nodes has the id, because ids must be unique.
  • Getting there: on the repository page, the "N forks" link adds #your-fork when the viewer owns a direct fork of that repository.
  • Tests: test/fork-tree-here.test.ts covers a fork, a non-fork, the visitor with a fork, a visitor without one, and a signed-out visitor.

What I left out

  • The #your-fork link only appears when the viewer owns a direct fork of the repository whose page they are on. A deeper fork still gets the id, mark and highlight once they open /forks, but nothing scrolls them there.
  • There is no redirect that adds the anchor automatically.
  • The issue's file list names family.ts and fork-standing.ts. I did not change them: family.ts is the forge-to-forge /family page, and fork-standing.ts is the sync-status line.

I ran only the 104 tests that touch these paths. scripts/fast.ts could not name tests for this diff (2190 files, over its budget), so the forge's full check on the push is the first full run. The sandbox blocked outbound connections during some tests, but they passed.

The desk note "production is rolling, hold changes to it until it settles" did not affect this change. It only goes to a pull, not to production.

Closes #13670

10 earlier comments · 1 event
commented

A fork's page now links its upstream and counts its siblings, and the forks page scrolls to the visitor's own node. I pushed it. Tests and the type check are green. The design lint and scripts/gate.ts --fix came back clean, and the commit carries no files from the .claude and .mcp.json folders in the working tree.

What changed

  • Fork page: the header line under a fork already read "forked from owner/name", with a link. It now adds "· N other forks", linking to the upstream's /forks page. N counts the siblings this viewer may read, so a private fork never shows in it. The count is left out when it is 0, and a non-fork shows no upstream line at all. The change is in lineageLine and a new siblingCount in src/web/chrome.ts. The sibling count is passed in by the caller, because test/fork-follow-word.test.ts caps the line at 3 database statements.
  • Tree page: I took "/tree" to mean /:owner/:name/forks, since the repo's /tree/<ref> route is the file browser. On that page the viewer's own node gets id="your-fork" and a data-mine mark, plus an accent bar. :target adds a background, so #your-fork scrolls to it and highlights it. This is in lineageCard in src/web/pages/following.ts, with two CSS rules in src/web/style/components.ts. Only the first of the viewer's nodes has the id, because ids must be unique.
  • Getting there: on the repository page, the "N forks" link adds #your-fork when the viewer owns a direct fork of that repository.
  • Tests: test/fork-tree-here.test.ts covers a fork, a non-fork, the visitor with a fork, a visitor without one, and a signed-out visitor.

What I left out

  • The #your-fork link only appears when the viewer owns a direct fork of the repository whose page they are on. A deeper fork still gets the id, mark and highlight once they open /forks, but nothing scrolls them there.
  • There is no redirect that adds the anchor automatically.
  • The issue's file list names family.ts and fork-standing.ts. I did not change them: family.ts is the forge-to-forge /family page, and fork-standing.ts is the sync-status line.

I ran only the 104 tests that touch these paths. scripts/fast.ts could not name tests for this diff (2190 files, over its budget), so the forge's full check on the push is the first full run. The sandbox blocked outbound connections during some tests, but they passed.

The desk note "production is rolling, hold changes to it until it settles" did not affect this change. It only goes to a pull, not to production.

commented

<!-- look-pages e488d2175f01 --> Look pages for e488d21, from the gate:

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

A fork's page now links its upstream and counts the other forks in the tree. The forks page marks the visitor's own node and scrolls to it. This update fixes the failed "both doors" gate check and pushes the result.

  • Fork page: it links its upstream and counts the other forks. The change is in src/web/pages/repo.ts and src/web/chrome.ts.
  • Forks page: the visitor's first fork in the tree carries the anchor #your-fork, and :target marks it. Their other forks say "you" without the anchor. The change is in src/web/pages/following.ts and src/web/style/components.ts.
  • Fork count link: for a visitor who has a fork in the tree, it points at /owner/name/forks#your-fork.
  • Tests: test/fork-tree-here.test.ts covers this. It passes, and tsc --noEmit and scripts/gate.ts are clean.

Gate fix:

  • How-to: I added docs/features/fork-tree-here.md, with a row in docs/features/README.md, to satisfy the "both doors" rule. I put a "No door:" line in the commit message, saying the terminal's forks screen already ranks the same tree.
  • Stray files: an earlier commit had added 39 tool-config symlinks (.claude/* and .mcp.json). They made the pull look like 46 files and tripped the "small and single-purpose" rule. I removed them, and the pull is now 7 files.

Left out:

  • Terminal: it has no new key or line for this. The anchor only scrolls a web page.
  • Gate rule: the "pipeline first" rule asked for a "Direction:" line in a commit message. I added one saying this is a small fix asked for in #13670. That is my own judgement, so a person may want to look at it.
  • Design lint: I did not run bun scripts/design-lint.ts in this round, though the pull touches src/web/.

Try it: sign in as someone who has a fork, open the upstream repository, and follow its fork count. It lands on /owner/name/forks#your-fork.

commented

<!-- look-pages dc1569f5431f --> Look pages for dc1569f, from the gate:

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

I removed 39 stray tool-config links from the pull and pushed, so it is back to 7 files. I have not seen the forge's check run on this push. Locally, scripts/gate.ts no longer prints the "small and single-purpose" rule.

  • Cause: the links are the .claude/* entries and .mcp.json, under src/, src/web/ and src/web/pages/. They are the sandbox's own files, and the forge's automatic commit of my work re-added them after I had removed them. That is why the pull counted 46 files against a limit of 20.
  • What's left: src/.mcp.json and src/web/.mcp.json are still on disk, untracked, and I can't delete them ("Device or resource busy"). If the forge commits the working tree again, they may come back as 2 stray files. That is well under the 20-file limit, but a person may want to delete them.
  • Run this round: only scripts/gate.ts. I did not re-run tsc or bun test, because the push only removed files and changed no source.

What the pull does:

  • A fork's page links its upstream and counts the other forks in the tree.
  • The forks page marks the visitor's own node. It scrolls to #your-fork when the visitor follows the fork count.
  • test/fork-tree-here.test.ts covers this.
  • docs/features/fork-tree-here.md is the how-to the "both doors" rule asks for.

Not done: the terminal's forks screen has no new key or line, because the anchor only scrolls a web page.

To try it: sign in as someone with a fork, open the upstream repository, and follow its fork count to /owner/name/forks#your-fork.

commented

<!-- look-pages 59b10e98d95c --> Look pages for 59b10e9, from the gate:

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

I made no code changes for this feedback. It's an automatic note from the forge's look-pages gate, not a request. It inferred 25 pages to picture because I changed src/web/chrome.ts, which most pages import.

I narrowed those to /explore, /docs and /following with a Looks: line in an empty commit and pushed it. Those three show the nav and the fork-tree marker.

The earlier change is unchanged:

  • A fork's page links its upstream and counts the other forks in the tree.
  • The forks page marks the visitor's own node and scrolls to it.
  • bun x tsc --noEmit is clean, and the 4 tests in test/fork-tree-here.test.ts pass.
  • I didn't run bun scripts/gate.ts --fix or bun scripts/design-lint.ts this round, and I didn't wait for the forge's check on the new push.

The pull still contains two empty src/.mcp.json and src/web/.mcp.json files. They aren't on main. git rm fails on them in this sandbox with "Device or resource busy", so please delete them before merging.

Changes requested — before the latest push

Fix in one round:

  1. Delete the two empty stray files src/.mcp.json and src/web/.mcp.json. They are tool config and are not on main.
  2. Principle 5: the data-mine rule paints an --accent bar on a row that is not an interaction. Mark ownership with the muted background plus the existing 'you' word, and run bun scripts/design-lint.ts, which was not run in the last round.
  3. Box 2: the #your-fork link appears only when the visitor owns a direct fork of the repository whose page they are on. On a fork's page, the new 'N other forks' link goes to /forks with no anchor, so a visitor with a deeper fork or a sibling fork is never scrolled to their node. Make both links carry the anchor whenever the visitor owns a node in the tree. The id then has to be computed from the whole lineage, not just the direct children.
  4. MINE_ANCHOR was inserted between the doc comment and lineageCard, so the comment now describes the constant. Move the constant above the comment.
  5. The sibling lineageLine call line in chrome.ts is far over the line width. Hoist the count into a local.
  6. The test named 'a fork with no siblings' never tests a fork with no siblings. Add one (a sole fork shows no data-siblings), plus a test for deeper-fork anchoring after the fix in 3.
  7. Both doors: docs/features/fork-tree-here.md claims the terminal forks screen names the viewer's forks. Point to the src/tui/ screen and show it, or add the upstream and sibling count line there.
commented

All seven items are done and pushed. The pull no longer contains either .mcp.json file. bun x tsc --noEmit, bun scripts/design-lint.ts and the three related test files (fork-tree-here, provenance, fork-follow-word; 20 tests) pass. I didn't run the full suite, and I haven't seen the forge's check on this push.

  1. Stray files. Both empty .mcp.json files are out of the pull's tree. They still sit on disk, untracked, because the sandbox won't let me delete them. I re-added src/web/.mcp.json by accident once and removed it again in fa00f64c1.
  2. Principle 5. The accent bar is gone. A node of the visitor's own now gets a muted row background plus the existing "you" word. :target uses the same background.
  3. Anchor.

- Lineage check. A new ownsInTree in src/core/following.ts walks the whole lineage, up to the root and down through every descendant. It covers direct forks, deeper forks and siblings. MINE_ANCHOR moved there so chrome.ts can use it without importing a page module. - Links. The repo page's fork-count link and the "N other forks" link on a fork's page both get #your-fork when the visitor owns a node in the tree. - Anchor target. The forks page puts the id on the first such node only. Every node of theirs still says "you".

  1. MINE_ANCHOR. It no longer sits between the doc comment and lineageCard.
  2. Long call. chrome.ts computes the sibling count in a local and passes lineageLine one small Family object. It carries the count and whether the visitor has a node.
  3. Tests. I added a sole-fork test, where bea/pond shows no data-siblings. I renamed the old misnamed test to say what it checks. A new deeper-fork test has dee fork bea/yard and checks the anchor on /ann/yard, on /cal/yard's sibling link, and on the tree node. A visitor with no node keeps the plain link.
  4. Both doors. The doc now points to the terminal fork tree screen in src/tui/screens/fork_tree.ts, which already marks the viewer's nodes with (you), and shows an example. I did not add a new terminal line.

ownsInTree accepts any readable node the visitor owns. If an unreadable fork sits between them and the root, their node isn't drawn and the link scrolls nowhere.

The earlier look-pages line named three pages with commas, and the gate rejected it. The commits now say Looks: /explore.

commented

<!-- look-pages 1ab9dec33b42 --> Look pages for 1ab9dec, from the gate:

  • look pages (named): this pull changes src/web/chrome.ts, src/web/pages/following.ts, src/web/pages/repo.ts; a commit names /explore
commented

I made no changes and pushed nothing, because none of the three failures comes from this pull.

  • Client-size ceiling test (test/client-size.test.ts): the check log says it is red on main at 9feb835 too, with the same tests. The forge doesn't count it against this pull.
  • POST /apps/new timing test (test/new-app-post-timing.test.ts): it failed at 1047 ms against a 1 s limit. It passes here (2 of 2), and nothing in this pull touches that path. I read it as a timing flake on a loaded shard, though the forge's check saw it green on main. A re-run should clear it.
  • Shared-red vitals test (test/shared-red.test.ts): it passes here (29 of 29), and this pull doesn't touch it. It failed in 19 ms on shard 91, so I can't see what caused it from here.

I couldn't run bun scripts/gate.ts or bun x tsc --noEmit this turn, so nothing was re-verified beyond the two test files above.

Two empty files, src/.mcp.json and src/web/.mcp.json, are still tracked on this branch and aren't on main. I tried git rm on them and the sandbox refused with "Device or resource busy". A person may need to run git rm src/.mcp.json src/web/.mcp.json and push.

Pull summary: fork links now anchor to the visitor's own node anywhere in the fork tree. The change is in src/core/following.ts, src/web/chrome.ts, src/web/pages/following.ts and src/web/pages/repo.ts. It adds test/fork-tree-here.test.ts and docs/features/fork-tree-here.md. I haven't re-run those tests this turn.

commented

I changed nothing and pushed nothing. The look-pages comment doesn't ask for a fix.

It records that the gate accepted the pull's look declaration. The pull changes src/web/chrome.ts, src/web/pages/following.ts and src/web/pages/repo.ts, and a commit names /explore. I ran bun scripts/gate.ts and its only output is that same line.

The commit Looks: /explore, /docs, /following names /following, which is not in app.looks in forge.json. /explore and /docs are in it and carry the before/after pictures. /following shows the tree page's change, but I left it out of the list because the gate accepts /explore. Adding it would mean editing forge.json, which this pull doesn't otherwise touch.

The two empty .mcp.json files are still tracked on the branch and I still can't remove them. The sandbox refuses with "Device or resource busy". A person needs to run git rm src/.mcp.json src/web/.mcp.json and push.

Approved

Earlier asks are met. The accent bar is gone, so principle 5 holds. The anchor now covers deeper forks and siblings through ownsInTree. MINE_ANCHOR sits in core. The sole-fork and deeper-fork tests are in. The doc points at the terminal fork tree, which already marks (you), so both doors hold. The anchor works with JavaScript off, the links are plain <a>, and nothing in the change needs a mouse.

Two things I would do next:

  1. Before merging, git rm src/.mcp.json and src/web/.mcp.json. They are empty, stray, and not on main, and the builder cannot delete them from its sandbox.
  2. Non-blocking: familyOf and ownsInTree add lineage queries to every fork page and every repo page. Cache or fold them into one lineage walk if the page budget gets tight.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs