Explore: show only the top 5 most active owners, plus instance owner/repo totals (currently 50 name-sorted sections, no totals) #295
Labels
No labels
actions
bug
cli
duplicate
enhancement
fork
forum
git storage
help wanted
insights
invalid
issues
moderation
oidc
ownership transfer
packages
pr/merge protection rules
projects
pull requests
question
releases
sponsorships
tags
webhooks
wiki
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crueber/walhub#295
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What's requested
The
/explorepage should show only the top 5 most active owners (organizations/users) — not the current cap of 50 name-sorted sections.Current state (code evidence)
MAX_OWNERS = 50(web/src/lib/owners.js:8) caps the owner sections on/explore;Owners.jsx:110orders them withnewestFirst(owners())— reverse-lexicographic name order, not activity. "Showing newest N of M owners" is a name-sort claim, not an activity claim.repos/detailed?sort=activity&order=desc), but the sections themselves aren't, and there is no per-owner activity value anywhere yet — #283 (owner-levellast_commit_timerollup +sort=activityonGET /api/v1/owners) is still open.Proposed behavior
/explorerenders the 5 owners with the most recent commit activity (owner whose repo committed most recently first), each section capped atMAX_REPOS_PER_OWNERas today.last_commit_time; owners with no commit activity are not shown on the top-5 page at all (they're the opposite of active). An instance with fewer than 5 active owners shows fewer than 5 — no filler.Implementation shape (depends on #283 — sequence this after it)
GET /api/v1/owners?sort=activity&order=descand slices the first 5 —MAX_OWNERSbecomes 5,newestFirstis finally retired from this page (its own comment anticipates the replacement), and "active" filtering is just "skip rows with nulllast_commit_time".Also in this change: instance totals
Show the total number of owners and the total number of repositories in the system on
/explore(a small stats line on the intro card is the natural spot — it already carries the "walhub is a git host…" copy).owner_countandrepo_countare free there), or a tinyGET /api/v1/statsif the author prefers a dedicated surface. Either way, through all three route twins.liveReposuses (cmd/walhub/serve.go).Acceptance criteria
/exploreshows at most 5 owner sections, ordered by most recent commit activity across each owner's repos.MAX_REPOS_PER_OWNERcap (unchanged).newestFirstretired from this page.Explore: show only the top 5 most active owners (currently 50 name-sorted sections)to Explore: show only the top 5 most active owners, plus instance owner/repo totals (currently 50 name-sorted sections, no totals)Fix is up: PR #306 (branch fix/issue-295) - /explore renders the top-5 most-active owners over the #283 owners/detailed rails (activeOwnerNames filter before the 50->5 slice; cold load ~51 to 6 GETs), plus the instance owner total on the intro card from the payload's uncapped row count. No backend change, no new deps; node --test 586/586, vite build green, browser proof open (loopback guard).
One acceptance item needs a backend rail and is deliberately NOT in this PR: the instance REPO total. No endpoint serves one (owners/detailed rows carry no repo counts, no stats endpoint), and deriving it client-side would be either a capped sum (dishonest) or an N-fetch over every owner's listing (the antipattern this page avoids). Propose a follow-up: repo_count on the owners/detailed rows (ghost-filtered like liveRepos) or a tiny stats surface through all three route twins - happy to implement that rail as its own issue/PR.
Review of PR #306 (branch fix/issue-295 @
860ceb6, verified in scratch worktree /tmp/pr306, since removed). No browser per instructions — headless tests + reasoning only; no docker, no system packages, main worktree untouched (still clean on main).VERDICT: ready to merge. The repo-total gap is now tracked as #307 (filed); see the call at the end.
CHECKS (all pass, file:line on the PR branch):
TESTS (scratch worktree, web/node_modules symlinked read-only from the main checkout — main files untouched):
NO CODE PUSHED: nothing defective found. One cosmetic nit left alone to avoid churn: an empty instance reads 'Home to 0 owners — showing the most active below.' directly above 'no repositories yet' — slightly awkward, fully honest.
MERGE RECOMMENDATION: ready to merge. #295's top-5 + owner-total items are met; its repo-total item moves to #307. If #295 should stay open until #307 lands, retarget the PR's 'Fixes #295' keyword before merging.
Fixed by PR #306 (review clean; top-5 + owner total verified; repo totals continue in #307), merged. Closing.