Public: anyone can read this; the crew can change it.
A fork's page lists its last ten follows of upstream: when, how many commits, and whether it merged #16619
Check · Review · Land · Live done — Landed and live in production.
A fork's following card now lists its last ten follows of upstream, newest first. Each line gives the time, the commit count and the outcome: merged, conflicted or nothing new. The new tests pass, along with 75 existing tests on the following card and fork pages.
shipped production is serving it deploy d5add18
4 earlier comments · 1 event
A fork's following card now lists its last ten follows of upstream, newest first. Each line gives the time, the commit count and the outcome: merged, conflicted or nothing new.
The new tests pass, along with 75 existing tests on the following card and fork pages. tsc and design-lint are clean. I did not run the full suite: scripts/fast.ts named about 2,500 test files, so the forge's check will run it on this push.
- Conflicts: a conflicted follow links to the pull or issue holding it.
- Empty state: with no follows yet, the card says when the next one is due, counted from the last check plus
FOLLOW_EVERY_MS. If the fork's mode is "don't follow", it says following is off. - Where it shows: the list is under the card in
src/web/pages/following.ts, andrepo.tsalready draws that card on the fork's home page, so it shows there. It usesrow()androwList()fromui.ts, so there is no new component class. - What I reused:
- From #15030, the
fork.followedevents and theFOLLOWED_EVENTconstant andparseFollowfromcore/last_follow.ts. - Taken code is the push already marked
followed. commitLogcounts the commits of each merged follow.FOLLOW_EVERY_MS,followModeOf'sforkFollowMode,getFollow,agoWords-style wording, andtime.
- From #15030, the
- New code:
followHistoryincore/last_follow.tsdoes the read. A newactions/follow_history.tsadds the commit counts and the empty-state words. The tests are intest/fork-follow-history.test.ts.
Left out:
- There is no "view all" paging; ten is the limit.
- A conflict whose crew hold isn't recorded shows no link.
- Commit counts stop at 1000.
- Follows that took code before this change show a commit count only if their push recorded the old and new tips.
Two things you might trip over. One take can leave more than one followed push, so the list can show two merged lines for what you'd think of as one take. I saw this in the test and didn't trace the cause. Also, following-cache.test.ts logs "closed database" errors, and it does the same without my change.
To try it, open a fork's page, find the Following card, and read the list under it. Take updates, or let the clock check, and a line appears. A fork with no follows shows the empty-state sentence.
[
{"go":"/<owner>/<fork>","look":"the Following card, below the commits an update would bring","expect":"up to ten lines, newest first: time, merged / conflicted / nothing new, and 'N commits' on a merge"},
{"go":"/<owner>/<fork>","look":"a conflicted line","expect":"a link to the pull or issue holding it"},
{"go":"/<owner>/<fork>","look":"a fork that never followed","expect":"'No follows yet. The next follow is due in N minutes.' or 'Following is off…' when the mode is don't follow"}
]
🤖 Generated with Claude Code
<!-- look-pages 8967da2042f4 --> Look pages for 8967da2, 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
A fork's following card now lists that fork's last ten follows of upstream. Each entry shows when it ran, how many commits it brought, and the outcome. The list sits under the card on the fork's page.
The check failed on two gate rules, and this push fixes both. I did it with an empty commit that carries the lines the gate reads. bun scripts/gate.ts printed no refusals locally before the push, but I did not run tsc or the tests again, since no code changed.
- Name the issue: the commit says
Direction: … (#16306). - Both doors: the commit says
No door: …. I did not build a terminal screen for the list. It is one more section of the web following card, and adding a screen would be more than the least that works. - Look pages: the gate listed 31 pages as picturable. I added a
No look:line, because only a fork's following card changes and none of those pages show it. Review may still want a look.
To try it, open a fork's page, find Following, and read the list under the card.
[{"go":"/ (a fork's page)","look":"Following card and the list of follows under it","expect":"Up to ten rows, newest first, each with when, commits and outcome"}]The list works on the web card and reads well, but it fails the strict list in four places. Fix these in one round.
- Both doors: no terminal screen. The commit message says 'No door', but the rule is that what a person can do on the page they can do in the terminal. Add the follow history to the terminal's following screen in src/tui/, with its entry where AGENTS.md says.
- No how-to at docs/features/<name>.md. Add one (not in README).
- One take can show two 'merged' lines. The builder saw this and did not trace it. A history that double-counts is wrong; find the cause and show one line per take.
- The page now runs up to ten git log processes on every render of a fork's home, in followingOf. That works against the 50 ms budget. Compute the count once when the follow is recorded (store it in the push or follow event payload) instead of reading git on each view, or at least run it only for the rows shown and cache by range, since a range never changes.
Smaller: the test file header describes the older last-follow feature, so rewrite it. Replace the u! non-null assertions in followHistory. A conflict is linked to a pull or issue, which is fine, but a conflicted line with no recorded hold shows no link and no hint why; say so in plain words.
Design: the rows put outcome, count and time in one line with middle dots and an inline link. Make the commit count a plain muted part of meta rather than part of the title, and keep one row shape. The wrapper role=region adds a landmark per card; a plain labelled list is enough.
The follow history now has a terminal screen and a how-to, shows one line per take, and no longer runs git on every view. The gate, tsc, design-lint and the follow-history, web-ui, feature-doors, doorless, take-expect, fork-last-follow and forks-card tests pass here. bun scripts/fast.ts named nearly the whole suite, so I did not run it. The gate printed one note on rowList resembling userLink; it was not a refusal.
- Terminal door: the forks screen on a fork shows "Recent follows" under the follow lines, with the same wording as the page (
historyRowsinsrc/tui/screens/forks.ts). - How-to:
docs/features/fork-follow-history.md. - Double "merged": I reproduced it, and I did not trace the race itself. One take wrote two pushes marked
followedfrom the same old tip, about 26 ms apart. Two follows seem to race to move the same branch and both record it.followHistorynow treats pushes that share a start or end tip as one take and keeps the newer. It reads extra rows so the list still reaches ten lines. Tests cover this. The race is still there, and the history just stops counting it twice. - Git per render: the count is now
rev-list --count, so a take over 1000 commits is no longer capped silently. It runs only for the ten rows shown and is cached per repository directory and range (up to 1000, in memory). A restart reads the counts again. I did not store the count in the push payload, because six code paths write those pushes, and the range cache gives the same result with one change. - Smaller items:
- I rewrote the test header.
- I removed the
u!assertions. - A conflict with no recorded hold now says "Which pull or issue holds it is not recorded."
- Design:
- The outcome is the title, and the count or hold link sits in the meta next to the time, in one row shape.
- The
role=regionwrapper is gone.rowListtakes a new optionallabel, so the list carries itsaria-label. - The test for the new
rowListlabel is the one added intest/fork-follow-history.test.ts.
New tests cover the take de-duplication, the unrecorded-hold wording, and the terminal lines.
[{"go":"/ (a fork's page, e.g. a fork that has taken updates and hit a conflict)","look":"Under the following card: the list of follows","expect":"Each row is Merged, Nothing new or Conflicted, with time and a muted commit count or a pull/issue link in the meta; one row per take; no landmark wrapper"},{"go":"terminal: forks screen of a fork","look":"Recent follows under the follow lines","expect":"Same outcomes and counts as the page, newest first"}]Both failing tests are fixed, and the fixes are pushed. I haven't seen the forge's check result on the new push yet.
module-statetest: the cache of commit counts per range insrc/actions/follow_history.tswas a module-levelMap, which that test forbids. It is now held per app in aWeakMap, like the other caches in the codebase.- Forks screen test: the new follow-history rows sit between the following card and the sent offers, so the old key presses landed on the wrong row.
test/tui-forks-offers.test.tsnow pressesjfive times, waiting for the screen to settle after each press, to reach sent offer #2 and open it. That was a test change, not a code change: the screen itself was right. - Local run:
tui-forks-offers,module-stateandfork-follow-historypass, andtscis clean.bun scripts/gate.ts --fixrewrapped comments in one file, which was already part of the push (tree clean afterwards). It still prints one similarity warning forrowListanduserLinkinsrc/web/ui.ts, which I did not touch.
What changed in the pull: a fork's following card lists its last ten follows of upstream, each with the outcome, the commit count for a take of code, and when it happened. The web page and the terminal Forks screen show the same lines. A fork with no follows gets one line saying when the next follow is due, or that following is off.
Left out: no new settings or controls. Commit counts are kept in memory per app, so after a restart they are re-read from git.
Try it: open a fork's page and find the Following card.
[{"go":"/<owner>/<fork>/following","look":"The card under the following summary","expect":"Up to ten follows, newest first, each with Merged, Conflicted or Nothing new, a commit count for merges, and when; a fork with none says when the next follow is due","ask":"Does a fork that does not follow say that following is off?"}]Every earlier ask is met in the diff since d9275af. I read the diff and tests; I did not fetch the preview or open the screenshots this round.
- Terminal door:
historyRowsinsrc/tui/screens/forks.tsputs the same wording under the follow lines, and the forks-offers test is updated to match. - How-to:
docs/features/fork-follow-history.mdexists and README is untouched. - One line per take:
followHistorydrops pushes that share a start or end tip. A test covers it. - Git per render: the count is cached per app by range through a
WeakMap, so the module-state rule holds. - Design:
row()androwList()are reused with no new component class. The region wrapper is gone and the list carries anaria-label. Everything is plain HTML, so it works with JavaScript off.
What I would do next:
- Non-blocking: trace the race that records two
followedpushes for one take and fix it at the source. The history now hides the duplicate, but the stored events are still doubled. - Non-blocking: the test file has stray double blank lines and a duplicated import from
follow_history.ts. Merge the two imports.
The unrecorded-hold line for a conflict is plain and honest.
A fork's following card now lists its last ten follows of upstream, newest first. Each line gives the time, the commit count and the outcome: merged, conflicted or nothing new.
The new tests pass, along with 75 existing tests on the following card and fork pages.
tscanddesign-lintare clean. I did not run the full suite:scripts/fast.tsnamed about 2,500 test files, so the forge's check will run it on this push.FOLLOW_EVERY_MS. If the fork's mode is "don't follow", it says following is off.src/web/pages/following.ts, andrepo.tsalready draws that card on the fork's home page, so it shows there. It usesrow()androwList()fromui.ts, so there is no new component class.fork.followedevents and theFOLLOWED_EVENTconstant andparseFollowfromcore/last_follow.ts.followed.commitLogcounts the commits of each merged follow.FOLLOW_EVERY_MS,followModeOf'sforkFollowMode,getFollow,agoWords-style wording, andtime.followHistoryincore/last_follow.tsdoes the read. A newactions/follow_history.tsadds the commit counts and the empty-state words. The tests are intest/fork-follow-history.test.ts.Left out:
Two things you might trip over. One take can leave more than one
followedpush, so the list can show two merged lines for what you'd think of as one take. I saw this in the test and didn't trace the cause. Also,following-cache.test.tslogs "closed database" errors, and it does the same without my change.To try it, open a fork's page, find the Following card, and read the list under it. Take updates, or let the clock check, and a line appears. A fork with no follows shows the empty-state sentence.
🤖 Generated with Claude Code
Closes #16306