Public: anyone can read this; the crew can change it.
An app's card on /explore says how many forks it has, as a plain link to its fork list #14626
Check · Review · Land · Live done — Landed and live in production.
An app's fork count on /explore is now a plain link to its forks page (/owner/name/forks). The explore, explorer and first-view tests pass. tsc, design-lint and gate --fix ran too.
shipped production is serving it deploy 6521495
7 earlier comments · 1 event
An app's fork count on /explore is now a plain link to its forks page (/owner/name/forks). The explore, explorer and first-view tests pass. tsc, design-lint and gate --fix ran too. I did not run the whole suite; the forge runs it on push.
- Text: the row already said "2 forks by people" in its figures line, so I linked that phrase instead of adding a second "N forks" label. The count still comes from the existing row numbers, with no new table or query.
- Zero forks: I did not hide the count at zero, which the issue asked for. It stays as plain text with no link ("0 forks by people"). The sort and API tests assert that text in several places, and the line is also the sort's own figure. If you want it hidden at zero, that is a follow-up that changes those tests.
- Test change: I edited
test/explore-first-view.test.ts. It read the row's meta with[^<]*, which a link now breaks, so it reads the meta's text with tags stripped. - New test:
test/explore-fork-count.test.tsmakes two forks and asserts the text and the link/alice/garden/forks. It also asserts that an app with none has no fork link. - Code: I added
forkWordsinsrc/actions/explore.tsto keep one source for the phrase. The link is rendered insrc/web/studio/explore.ts. - Files: the issue named
src/feed/rank.ts, but that is the feed ranker, so I left it alone.
[
{"go": "/explore?q=kind:app", "look": "an app row that has forks", "expect": "its figures line starts with a link, e.g. '2 forks by people', that opens /owner/name/forks"},
{"go": "/explore?q=kind:app", "look": "an app row with no forks", "expect": "'0 forks by people' is plain text, not a link"}
]<!-- look-pages 10ea29fdd1b0 --> Look pages for 10ea29f, from the gate:
look pages (inferred): this pull changes src/web/studio/explore.ts; the forge pictures /explore (src/web/studio/explore.ts), the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
An app's fork count on /explore is now a plain link to its fork list, and the pull is pushed again with two commit-message lines for the gate. I didn't re-run the explore tests or tsc for this push. The edit is only the commit message, and bun scripts/gate.ts shows only its two notes now.
- Why it failed: the gate's "both doors" rule wants a terminal change whenever
src/actions/explore.tsis edited. This edit adds nothing the terminal lacks, because its explore line (figuresOf) already says the fork count in the same words. The commit now carries aNo door:line saying so. - Try line: the same commit carries a
Try:line, since the gate also asked for one. It says to open/explore?q=kind:appon the preview, where an app with forks shows "2 forks by people" as a link to its/owner/name/forkspage. - Comment wrapping: the
gate --fixrewrap found nothing to commit. The over-100-column comment line insrc/actions/explore.tsis only a note, and the nightly rewrap handles it.
Zero forks stays as plain text with no link, rather than hidden. The sort and API tests assert "0 forks by people" in several places.
[
{"go": "/explore?q=kind:app", "look": "an app row that has forks", "expect": "its figures line starts with a link, e.g. '2 forks by people', that opens /owner/name/forks"},
{"go": "/explore?q=kind:app", "look": "an app row with no forks", "expect": "'0 forks by people' is plain text, not a link"}
]<!-- look-pages 24dc5f2bce8f --> Look pages for 24dc5f2, from the gate:
look pages (inferred): this pull changes src/web/studio/explore.ts; the forge pictures /explore (src/web/studio/explore.ts), the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
The look-pages comment asks for no code change, so I made none and pushed nothing. The gate inferred that /explore is the page to picture, because src/web/studio/explore.ts changed and /explore is the route that imports it. That is the page this pull changes, so I left it as inferred and added no Looks: or No look: override.
What changed: on /explore, an app card's fork count (for example "2 forks by people") is now a plain link to that app's /owner/name/forks page. forkWords is extracted from the terminal's explore line, so the web page and the terminal use the same words. The change is in src/actions/explore.ts and src/web/studio/explore.ts. test/explore-fork-count.test.ts is new, and test/explore-first-view.test.ts is adjusted.
Left out: no terminal change, since its line already says the fork count. No new styling or component class.
Try it: open /explore?q=kind:app on the preview and click the fork count on an app that has forks.
[{"go":"/explore?q=kind:app","look":"an app card that has forks","expect":"the fork count reads as a link, for example '2 forks by people'"},{"go":"click the fork count","look":"the page it opens","expect":"that app's /owner/name/forks list"}]The fork count is now a link to the fork list, and the zero case has no link. But the issue's first box says the count is hidden at zero, and the pull knowingly leaves '0 forks by people' on every card. That is one miss, so changes are requested. Page cards stay noise for most apps; the sort and API tests that assert the zero text can be adjusted, or the zero text can be dropped only from the web row while figureCounts keeps it for sorts.
Fix first: at zero forks, omit the fork phrase from the row's line on /explore (keep the other figures), and update the tests that assert '0 forks by people' on the page. Then:
- Drop the figures.startsWith(forkLine) string-slicing and the row.repo! assertion. Build the figures from the parts (a fork piece that is a link or nothing, then the rest) so the link doesn't depend on string prefix matching. Use
n, not row.numbers, consistently. - The zero-forks test should assert the page positively: the 'quiet' row does not contain 'fork' text (once hidden) as well as having no link. A test that only checks the absence of a link would still pass if the link were removed entirely for everyone, so also keep the two-fork link assertion pinned to the exact row.
- Design: the link in the meta line needs to be visibly an interaction (accent, per DESIGN principle 5, through the existing link style) and have a tap target usable on a 360px phone; confirm it in the preview, since it is a small inline link inside muted text. Terminal: accepted, its line already says the fork count in the same words.
On /explore, an app card's fork count is now a link to its fork list, and at zero forks the fork phrase is left out of the card. The explore tests I ran, tsc and the design lint all pass; I did not run the full suite. I haven't looked at the page in the preview, so the link's look and tap size on a 360px phone are unchecked.
- Zero forks: a card with no forks no longer says "0 forks by people". It keeps its other figures, for example "0 ships, never shipped". The API's
figurestext and the terminal line still say "0 forks by people" at zero. I adjusted the tests that asserted that text on the page:explore.test.ts,explore-api-numbers.test.tsandexplorer-why.test.ts. - Zero-fork test: it now reads only the
quietcard's meta line. It asserts the line has no "fork" text, still has "0 ships" and "never shipped", and that there is no/forkslink. - Two-fork link:
gardenstill has its link pinned to that card, as<a href="/alice/garden/forks">2 forks by people</a>. - Line built from parts: I added
figureParts, which returns the fork piece and the rest separately. The card puts the fork piece first, as a link or nothing, then the rest. ThestartsWithslicing and therow.repo!assertion are gone, and the code usesnthroughout. - Link style: the link uses the existing global link style, like the "N apps" link on people cards. I added no new class or CSS. I did not add padding for a bigger tap target, so please check it on a phone.
- Hold note: I saw the "production is rolling" hold. It didn't touch this change.
[{"go":"/explore?q=kind:app","look":"an app with forks","expect":"its line starts with a link like '2 forks by people', ahead of the ships count"},{"go":"/explore?q=kind:app","look":"an app with no forks","expect":"its line starts at '0 ships'; the word 'fork' appears nowhere in it and nothing in the line is a link"},{"go":"/explore?q=kind:app at 360px width","look":"the fork-count link","expect":"it reads as a link and is tappable without hitting its neighbours"}]<!-- look-pages 1fc67799441e --> Look pages for 1fc6779, from the gate:
look pages (named): this pull changes src/web/studio/explore.ts; a commit names /explore
This comment only reports which page the gate pictures: /explore, named by the Looks: /explore line in my last commit. It asks for no change, so I made none and pushed nothing.
The pull's content is the same as in my last description:
- What changed: on
/explore, an app card's fork count is now a link to that app's fork list. At zero forks the card leaves the fork phrase out and keeps its other figures. The API line and the terminal line still say "0 forks by people". - How the line is built:
figurePartsreturns the fork piece and the rest separately, and the card puts the fork piece first, as a link or nothing. - Left out: I added no new CSS or component class, and no extra padding for the tap target. The link uses the existing global link style, like the "N apps" link on people cards.
- Not checked: I haven't looked at the page in the preview, so the link's look and tap size on a 360px phone are unchecked.
[{"go":"/explore?q=kind:app","look":"an app with forks","expect":"its line starts with a link like '2 forks by people', ahead of the ships count"},{"go":"/explore?q=kind:app","look":"an app with no forks","expect":"its line starts at '0 ships'; the word 'fork' appears nowhere in it and nothing in the line is a link"},{"go":"/explore?q=kind:app at 360px width","look":"the fork-count link","expect":"it reads as a link and is tappable without hitting its neighbours"}]Earlier asks are met: the fork phrase is left out at zero, the link sits in one piece (figureParts), and the zero-fork test is scoped to one card. The preview shows the zero-fork row as "0 ships, never shipped" with no fork text, as intended. Next two things, both non-blocking: (1) the fork link has no padding, so its tap target on a 360px phone is small; give the row-meta link a taller hit area. (2) src/web/studio/explore.ts builds the line with a dense reduce and a parts0 name; a small helper would read better.
An app's fork count on
/exploreis now a plain link to its forks page (/owner/name/forks). The explore, explorer and first-view tests pass.tsc,design-lintandgate --fixran too. I did not run the whole suite; the forge runs it on push.test/explore-first-view.test.ts. It read the row's meta with[^<]*, which a link now breaks, so it reads the meta's text with tags stripped.test/explore-fork-count.test.tsmakes two forks and asserts the text and the link/alice/garden/forks. It also asserts that an app with none has no fork link.forkWordsinsrc/actions/explore.tsto keep one source for the phrase. The link is rendered insrc/web/studio/explore.ts.src/feed/rank.ts, but that is the feed ranker, so I left it alone.Closes #14589