Skip to content

feat(home): add Top Active Repositories rotating panel on the landing page#1158

Open
plind-junior wants to merge 3 commits into
entrius:testfrom
plind-junior:feat/homepage-top-active-repos
Open

feat(home): add Top Active Repositories rotating panel on the landing page#1158
plind-junior wants to merge 3 commits into
entrius:testfrom
plind-junior:feat/homepage-top-active-repos

Conversation

@plind-junior
Copy link
Copy Markdown
Contributor

@plind-junior plind-junior commented May 14, 2026

Summary

The homepage's hero column rotates between two panels every 5 seconds — LiveProofPanel (latest PR activity) and TopMinersPanel (top contributors). This PR adds a third panel — Top Active Repositories — surfacing the 5 most active repositories by lines changed, powered by the /dash/repos/commits endpoint that until now was unused in the UI.

After this PR the same hero slot cycles feed → miners → repos → feed, giving the page a third "live proof" lens onto the data without enlarging the page or competing with the existing surfaces.

Why

/dash/repos/commits is a swagger-documented api.gittensor.io endpoint that wasn't wired in any UI hook. It returns one row per active repo with commits, additions, deletions, linesChanged, weight, and inactiveAt. The data is dense and hard for visitors to derive client-side (it would need every PR via /prs aggregated). Surfacing the top movers gives newcomers an immediate sense of which repos drive the most code on the subnet.

Sample top-5 by lines changed from the live endpoint at PR time:

autoppia/autoppia_webs_demo 165 commits +115k −7.7k 122,999 net entrius/gittensor-ui 764 commits +60k −31k 91,998 langgenius/dify 968 commits +29k −39k 69,225 we-promise/sure 521 commits +45k −2.2k 48,112 infiniflow/ragflow 533 commits +24k −3.5k 27,820 ​

Changes

src/api/DashboardApi.ts

  • Imports RepoChanges model.
  • New useRepoCommits() hook → useApiQuery<RepoChanges[]>('useRepoCommits', '/repos/commits').

src/pages/HomePage.tsx

  • New LandingTopRepoRow type.
  • New buildTopActiveRepoRows(repos) helper: filters inactive repos, parses numeric strings, sorts by linesChanged desc, slices the top 5 (TOP_REPO_ROW_LIMIT).
  • New TopActiveReposPanel component matching the visual treatment of LiveProofPanel / TopMinersPanel:
    • Same outer card surface (surface.subtle background, border.medium border, blur glow, slideIn animation).
    • Section kicker reads "Most active repositories" / "lines changed".
    • Each row: rank badge · owner avatar · owner/repo + commits count + +adds / −dels in green/red · right-aligned compact lines-changed total.
    • Each row has a horizontal background bar scaled to that repo's share of the top entry's lines (parallel to the earnings bar in TopMinersPanel).
    • Rows link to /repositories/details?repo=<full_name> with { backLabel: 'Back to Home' }.
  • Extended activePanel type from 'feed' | 'miners''feed' | 'miners' | 'repos'.
  • The 5s setInterval now cycles through the three panels via a PANEL_CYCLE array.
  • The toggle dots indicator below the panel column auto-renders from PANEL_CYCLE (now 3 dots instead of 2) — clicking jumps directly to that panel.

Test plan

  • Open the homepage (/). Wait through the rotation: feed → miners → repos → feed. The "Most active repositories" card displays with 5 rows.
  • Click any row → navigates to /repositories/details?repo=<owner/repo>; back button reads "Back to Home".
  • Click each of the 3 dots below the panel column → directly switches to the matching panel.
  • DevTools → Network on first load: one request to GET /dash/repos/commits (cached by React Query thereafter).
  • Resize to mobile width — the right-side lines-changed column collapses (display: { xs: 'none', sm: 'block' }) so commits + adds/dels stay readable.
  • npm run type-check and npm run lint pass.

Notes

  • The panel matches the existing LiveProofPanel color scheme but uses primary.main for its background glow (vs. status.merged for the feed panel) to differentiate at a glance.
  • Inactive repos (inactiveAt != null) are filtered out of the ranking so the panel always shows currently-active repos.
  • Top-5 is by linesChanged (net activity). Could alternately rank by commits count if reviewers prefer; happy to swap.
  • No mobile layout regressions in the existing two panels — only added a sibling Box.

Out of scope

  • A dedicated /repositories?sort=active view linked from the panel — could be a follow-up.
  • Pulling additional fields (weight, inactiveAt) into the row layout — currently only used for filtering / sorting, not for display. Easy to add if maintainers want a "weight badge" next to each row.
image

@xiao-xiao-mao xiao-xiao-mao Bot added the enhancement New feature or request label May 14, 2026
@plind-junior
Copy link
Copy Markdown
Contributor Author

I've updated the the term "coding agent" to "miner" in this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant