~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/knotless

git that lives in your Atmosphere account

knotless.dev
1 collaborator

knotless 0.13.0 Latest 2 packages, 1 image

1
10

A repository's Fork button shows how many forks it has

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/knotless:web/fork-count

What changes

A repository's header shows how many forks it has beside Fork, joined to the button as Star's count is. getRepo answers forkCount beside starCount. The index counts forks with a new fork_count, and the account's starred list now uses it too instead of listing every fork to take its length. Like starCount, it is absent for a private repository, whose forks are private too, and from a server with no index.

Star and Fork share one .counted style for a button with its count joined on.

Why

Watch, Fork and Star sat side by side, but only Star had a count. The index already counted forks for repository lists. Watch gets no count: what an account watches is kept for that account alone, and a small count would often say who.

How it was checked

just look repository signed out, as its owner (Fork disabled, count still shown) and as bob.test, desktop light and phone dark, with the fork menu open on both. The recorded getRepo answers carry forkCount (1 for alice.test/tally, which bob.test forked, 0 for the others), added by hand rather than re-recorded. CI runs the tests and the query plan. The signed-in repository pages move only in their button row, where Fork gains its count.

Shots-moved: issue-subscribe, repository-watch, settings, settings-access, settings-actions, settings-branches, settings-labels

Shortcomings

The count is not a link: there is no page listing a repository's forks yet. Where Fork is hidden (signed out on a server with no logins), so is its count.

🤖 Generated with Claude Code

Approved

This adds forkCount to getRepo and shows it beside Fork, using the same joined .counted style as Star. The new Index::fork_count runs the same WHERE and down filters as Index::forks, so the count matches the listed forks. The account starred list now calls it instead of listing every fork to take its length. The count is absent for a private repository and when the server has no index, as starCount is. The lexicon, api.md and the recorded fixtures are updated with it. I read every changed file and found nothing wrong.

I did not run the layout. The phone CSS (.repo-actions columns, and the Star container query that only matches .star) looks consistent with the new .counted wrapper, and the body says it was checked on the phone.

Merged as d841b59