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

A fork's changes offered upstream show on the upstream's page as one line each, with who offered #13508

opened this

Merged 18d 7h ago, live in production

A repository's home page now lists the open pulls its forks have offered into it, one line each: the pull's title as a link, the fork's owner/name, and its age. I did not run the full suite or open the page on a preview. bun scripts/gate.ts --fix and tsc ran clean.

Notes

opened this

A repository's home page now lists the open pulls its forks have offered into it, one line each: the pull's title as a link, the fork's owner/name, and its age. I did not run the full suite or open the page on a preview. bun scripts/gate.ts --fix and tsc ran clean. design-lint printed only "no colour, size or component added outside the system", and four related test files pass: the new one plus fork-tree-web, tui-forks-propose and repo-fork-bar.

Visibility: the query only looks at forks the viewer can read, so a private fork's pull never appears for anyone who couldn't already see that fork. At most 20 offers show.

Tests: test/fork-offers.test.ts covers the visible and hidden cases. It makes a public fork and a private fork each offer a pull. The list and the rendered page show the public one to a stranger and to an anonymous viewer, and the private one only to its owner.

Where it lives: the query is in src/core/fork_offers.ts, the card in src/web/pages/fork-offers.ts, mounted in src/web/pages/repo.ts. The terminal forks screen (src/tui/screens/forks.ts) shows the same rows, and docs/features/fork-tree.md has a short section.

Left out:

  • Only direct forks are listed, not forks of forks.
  • There is no pagination or "see all" link past 20.
  • I did not touch src/actions/upstream_follow.ts, which the issue listed, because nothing there needed to change.

Gate lines: the commit messages carry a Try: line pointing at /preview-admin/sample, a No door: line saying the existing forks terminal screen already shows these rows, and a Direction: line. These are the assertions the gate rules asked for, not extra verification.

To try it: fork a public repo, push a branch, open a pull into the upstream, and visit the upstream's home. A private fork's pull shows only to people who can read that fork.

🤖 Generated with Claude Code

Closes #13403

3 earlier comments
commented

A repository's home page now lists the open pulls its forks have offered into it, one line each: the pull's title as a link, the fork's owner/name, and its age. I did not run the full suite or open the page on a preview. bun scripts/gate.ts --fix and tsc ran clean. design-lint printed only "no colour, size or component added outside the system", and four related test files pass: the new one plus fork-tree-web, tui-forks-propose and repo-fork-bar.

Visibility: the query only looks at forks the viewer can read, so a private fork's pull never appears for anyone who couldn't already see that fork. At most 20 offers show.

Tests: test/fork-offers.test.ts covers the visible and hidden cases. It makes a public fork and a private fork each offer a pull. The list and the rendered page show the public one to a stranger and to an anonymous viewer, and the private one only to its owner.

Where it lives: the query is in src/core/fork_offers.ts, the card in src/web/pages/fork-offers.ts, mounted in src/web/pages/repo.ts. The terminal forks screen (src/tui/screens/forks.ts) shows the same rows, and docs/features/fork-tree.md has a short section.

Left out:

  • Only direct forks are listed, not forks of forks.
  • There is no pagination or "see all" link past 20.
  • I did not touch src/actions/upstream_follow.ts, which the issue listed, because nothing there needed to change.

Gate lines: the commit messages carry a Try: line pointing at /preview-admin/sample, a No door: line saying the existing forks terminal screen already shows these rows, and a Direction: line. These are the assertions the gate rules asked for, not extra verification.

To try it: fork a public repo, push a branch, open a pull into the upstream, and visit the upstream's home. A private fork's pull shows only to people who can read that fork.

🤖 Generated with Claude Code

commented

This pull adds an "Offered by forks" list to a repository's home page, one line per open pull from a fork the viewer can read. A pull from a private fork the viewer can't read doesn't appear. The same rows show on the terminal forks screen.

Changed after review

  • Terminal Enter: an offered row now carries the pull number, so Enter opens the pull (src/tui/screens/forks.ts). Before, it reopened the upstream's own repo screen.
  • Web markup: the card has one heading, "Offered by forks", and uses the design system's ul.list with a.row, row-main, row-title and row-meta. Fork name and age are separate meta cells, and the · run is gone (src/web/pages/fork-offers.ts).

Tests

  • TUI (test/tui-forks-offers.test.ts): a visible fork's offer is a row, a private fork's is absent, and Enter opens the pull.
  • Core (test/fork-offers.test.ts): three new tests. A closed or merged pull isn't listed. A fork-of-fork's pull isn't listed. The list holds at 20 and runs newest first.
  • Ordering assertion: the cap test only checks the count, not that the newest come first.
  • Fork-of-fork setup: the pull flow refuses a grandchild's head, so that test opens a normal pull and re-points head_repo_id in SQL.
  • Runs: the new and changed tests, tsc, scripts/gate.ts --fix, design-lint and attention.test.ts all pass.
  • Skipped: scripts/fast.ts said the diff reaches too much to name, so I ran the covering files by hand.
  • Not run: I didn't run the full suite, which the forge's check does on push.

Left out: the "feature ahead of the pipeline-first list" point is noted, not acted on. I haven't looked at the preview, since the sample repo has no fork offers.

commented

I merged main into the branch, resolved both conflicts, and pushed. bun scripts/gate.ts --fix and tsc --noEmit are clean. The offers tests, test/fork-tree-mode.test.ts and test/tui-forks-propose.test.ts pass (17 tests); I didn't run the full suite, which the forge runs on push.

  • src/tui/screens/forks.ts: the offered rows stay, with Enter opening the pull, and the fork rows now use main's mode-aware forkRows(ranked, tree, forkModes).
  • docs/features/fork-tree.md: I kept both paragraphs. main's fork-mode paragraph stays with the tree section, and "Offers from forks" now follows it as its own section.
  • Gate rule, which I broke: the merge pushed a real-timer sleep in test/tui-forks-offers.test.ts without a reason, so the gate refused it. I added the // real-timer: reason and pushed that as a second commit.
commented

Open pulls from a repository's direct forks now show on the repository's page in an "Offered by forks" card, one line each: the pull's title, which fork it came from and how long ago it was opened, linking to the pull. The terminal's forks screen lists the same as "offered #N …" rows, and Enter opens the pull. An offer from a fork the viewer can't read never shows, so a private fork's pull doesn't reveal that the fork exists. Merged and closed pulls are left out, as are pulls from a fork of a fork. The list is capped at 20, newest first.

The two test files touched in this round and tui-forks-propose.test.ts pass, and the type check is clean.

Review changes in this round:

  • Query once: the forks screen (src/tui/screens/forks.ts) now looks up the offers once in read() and reuses them; it no longer queries on every render.
  • No fixed sleep: the terminal test (test/tui-forks-offers.test.ts) waits for the "offered #1" row to appear. After Enter it waits, up to 10 seconds, until that row is gone, instead of Bun.sleep(100).
  • Cap test: it now inserts 22 pull rows directly with set creation times, instead of opening 22 real pulls under a 60-second timeout. It checks the exact titles in newest-first order and that "Offer 0" and "Offer 1" are the ones dropped.
  • Page test: it now checks the link (href="/alice/lib/pulls/N") and that the age ("just now") appears after the title in the card.
  • Unrelated rewraps removed: runs.ts, talk.ts, conversation_markdown.ts, talk_chats.ts and no-polling.test.ts are back to what main has. The diff against main is now only this feature's 7 files.

The preview's sample repository has no forks offering anything, so the card doesn't appear there. To see it, fork a public repository as a second user, push a branch to the fork, open a pull into the upstream, and load the upstream's page (or forks in the terminal).

🤖 Generated with Claude Code

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs