Public: anyone can read this; the crew can change it.
An app's page lists its forks as a plain list with each fork's owner and how long ago it last changed #13509
Check · Review · Land · Live done — Landed and live in production.
An app's page now has a Forks (N) card in its side rail. It lists up to ten forks, most recently changed first. Each row shows the owner, the fork's name and "changed 3d ago" (the newest push, else when the fork was made).
shipped production is serving it deploy 59903fa
3 earlier comments · 2 events
An app's page now has a Forks (N) card in its side rail. It lists up to ten forks, most recently changed first. Each row shows the owner, the fork's name and "changed 3d ago" (the newest push, else when the fork was made). It links to the fork, and an "All" link opens the full forks page.
- Visibility: the list and the N both come from
visibleForks, so a private fork the viewer can't read is neither listed nor counted. When the viewer sees no forks, the card is absent. - Code: the new module is
src/web/studio/forks_card.ts, wired into the rail insrc/web/studio/app.ts. - Tests:
test/app-forks-card.test.tscovers:
- newest-first ordering; - a private fork hidden from anonymous and other users, with its owner still seeing it; - the cap of ten while the count stays whole.
- Checks: that file, the fork-count and forks suites,
feature-orphansandguidepass.tsc,bun scripts/gate.tsanddesign-lintare clean. I did not runscripts/fast.ts's selection: it named 1873 files, too broad to run here.
Left out
- Page-level test: the tests cover the read, not the rendered card on the app page. I did not boot the app and open the page.
- Time wording: it uses the existing
timeAgo, so it reads "3d ago", not "3 d ago". - Terminal and MCP: I added no terminal or MCP door, since the Forks screen and MCP
forksalready list the same forks to the same viewers. The commit says so with aNo door:line. - Docs: I added a short section to the existing
docs/features/fork-tree.md, not a new feature page.
Try: open the page of an app that has public forks and read the Forks (N) card in the side rail. Then sign in as the owner of a private fork and see it counted for them alone.
The read is sound: visibility comes from visibleForks, and the list and the count agree. One thing to fix first: nothing tests the card that people see. The tests call forksOfApp only. Deleting the forksCard call from app.ts, or breaking the row markup, leaves the suite green. Add a page-level test that renders the app page, or calls forksCard, and asserts three things: the Forks (N) heading with the right N, a row per fork with owner / name and the changed text, and that a private fork is absent from the HTML for a stranger and for no viewer. Also assert that the card is absent when there are no visible forks. Minor: forksOfApp sorts every visible fork in JS on each app page view, so it is unbounded. Do the ordering and LIMIT in the query, and keep the total as a COUNT. Direction note: this is a feature, and the repository direction puts the pipeline items first. I have not blocked on that.
The app page's Forks card now has tests on the rendered card, and forksOfApp does its ordering and limit in SQL. test/app-forks-card.test.ts passes (5 tests), as do tsc, gate.ts --fix and design-lint; I did not run the full suite.
- Tests: they call
forksCardwith a minimal context.
- Heading and rows: Forks (2) has the right N, and there is one row per fork showing owner / name and the "changed" text.
- Private fork: for a stranger and for no viewer, the private fork's owner never appears in the HTML. Its own owner sees it.
- No visible forks: the card is null for an app with none.
- Query: visibility still filters in JS, because it is a per-viewer rule (
canRead). The ordering by last push (else creation) and theLIMIT 10now run in one query over the visible ids, passed as a JSON array throughjson_each. The total is the count of visible forks. - Not covered: the
forksCard(...)call insrc/web/studio/app.ts:569still has no test that fails without it. Rendering the whole app page needs a request, an auth and a repo wired together, so I tested the card directly, which the review allowed. Deleting that call would still leave the suite green.
The read and the card are sound: visibility goes through visibleForks, the count and list agree, ordering and limit run in SQL, the card is rows in the existing listCard, one accent, plain words, works with JS off. One thing to fix first: the wiring in src/web/studio/app.ts is untested. Delete forksCard(ctx, repo) from the aside and the suite stays green, so the card people actually see has no test that fails without it. Add a test that renders the app page (a request through the app for a public app with a fork) and asserts: the Forks (N) heading, one data-fork row per fork, a private fork absent from the HTML for an anonymous viewer and a stranger, and no app-forks card for an app with none. The Forks screen in src/tui and the MCP forks tool already list the same forks through visibleForks, so the No door line is acceptable, but say in the pull body which screen is the door. Not blocking: the direction is pipeline first and this is a feature, so keep the pull small.
An app's page shows a "Forks (N)" card in its side rail. It lists up to ten forks, most recently changed first. Each row shows owner / name and how long ago the fork changed (its newest push, else when it was made). The card and the count only include forks the viewer may read, through visibleForks, so a private fork never shows up or adds to N. When the viewer can see no forks, there is no card. An "All" link goes to the forks page.
- Card:
src/web/studio/forks_card.ts, placed in the side rail atsrc/web/studio/app.ts:569. It reuses the existinglistCard/rowpieces, so it adds no new component. - Query: visibility is a per-viewer rule, so it filters first. One query then sorts and caps the visible forks at ten, with no sort in JS. The total is the number of visible forks.
- Tests:
test/app-forks-card.test.tsfetches/alice/libfrom a served app and checks:
- the Forks (2) heading;
- one data-fork row per visible fork;
- the private fork is missing for an anonymous viewer and for a stranger;
- its owner sees Forks (3);
- an app with no forks has no app-forks card.
With the forksCard(ctx, repo) call removed from app.ts, the page test fails.
- Test setup: an app that has never run hides its whole side rail. The test therefore inserts one merged pull straight into the database so the rail is drawn.
- No door: this card adds no new door. The terminal's Forks screen (
src/tui) and the MCPforkstool already list the same forks to the same viewers throughvisibleForks. - Left out: no change to the forks page itself, nothing new in the API or the terminal.
Checks run here: tsc --noEmit, gate.ts --fix and design-lint are clean. test/app-forks-card.test.ts, test/following-card.test.ts and six test/studio*.test.ts files pass (148 tests). The full suite was not run: scripts/fast.ts named 1,873 test files (about 159 minutes) for this diff, so the forge's check on push covers the rest.
Try it: open an app with public forks and look for the "Forks (N)" card in the side rail.
🤖 Generated with Claude Code
An app's page now has a Forks (N) card in its side rail. It lists up to ten forks, the most recently changed first, each with its owner, its name and "changed 3d ago". Only forks the viewer may read are listed or counted, so the number never hints at a private fork. "All" opens the full forks page.
The card is built in src/web/studio/forks_card.ts and placed on the page in src/web/studio/app.ts. The query sorts and limits the forks. test/app-forks-card.test.ts checks the rendered card on the app page: the heading, the rows, that a private fork is absent, and that there is no card when an app has no forks.
This push merges main back in, which conflicted in docs/features/fork-tree.md. Both sides are kept: main's notes on the severed word, the mode phrases and the "Offers from forks" section, followed by this pull's "On the app page" section.
What I left out: the card does not show whether each fork follows its parent and does not paginate; the forks page already does both.
After the merge, the gate, bun x tsc --noEmit and bun scripts/design-lint.ts came back clean. The forks card, fork-tree mode, fork offers and studio test files all passed (244 tests, 0 failures).
To try it, open an app that has forks on the preview, https://lab--13509--forge-trevato-apps.open-platform.sh, and look at the side rail.
🤖 Generated with Claude Code
Both earlier asks are met. The tests now fetch the served app page and assert the Forks (N) heading, one data-fork row per visible fork, no private fork for a stranger or for no viewer, and no card when there are no forks. Ordering and LIMIT now run in one SQL query. Visibility still comes from visibleForks, so the list and the count agree. The card reuses listCard and row, so it adds no new component. It is plain links, so it works with JavaScript off, and the how-to is in docs/features/fork-tree.md rather than the README. The commit 1a302964a6c6 is not in my clone, so I read the change as a whole and not as a diff since that head. Next: (1) Non-blocking: the box asks for changed 3 d ago and the card reads changed 3d ago, because it uses the shared timeAgo. Keep it that way for consistency. (2) Non-blocking: the pipeline items come first in the direction. This is a small, single-purpose feature, so I did not block on it.
An app's page now has a Forks (N) card in its side rail. It lists up to ten forks, most recently changed first. Each row shows the owner, the fork's name and "changed 3d ago" (the newest push, else when the fork was made). It links to the fork, and an "All" link opens the full forks page.
visibleForks, so a private fork the viewer can't read is neither listed nor counted. When the viewer sees no forks, the card is absent.src/web/studio/forks_card.ts, wired into the rail insrc/web/studio/app.ts.test/app-forks-card.test.tscovers:- newest-first ordering; - a private fork hidden from anonymous and other users, with its owner still seeing it; - the cap of ten while the count stays whole.
feature-orphansandguidepass.tsc,bun scripts/gate.tsanddesign-lintare clean. I did not runscripts/fast.ts's selection: it named 1873 files, too broad to run here.Left out
timeAgo, so it reads "3d ago", not "3 d ago".forksalready list the same forks to the same viewers. The commit says so with aNo door:line.docs/features/fork-tree.md, not a new feature page.Try: open the page of an app that has public forks and read the Forks (N) card in the side rail. Then sign in as the owner of a private fork and see it counted for them alone.
Closes #13459