Skip to content

feat(miner-ui): add a ranked-candidates dashboard route - #7706

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
galuis116:feat/miner-ui-ranked-candidates-route-7675
Jul 21, 2026
Merged

feat(miner-ui): add a ranked-candidates dashboard route#7706
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
galuis116:feat/miner-ui-ranked-candidates-route-7675

Conversation

@galuis116

Copy link
Copy Markdown
Contributor

Summary

/api/ranked-candidates (backed by packages/loopover-miner/lib/ranked-candidates.js, wired into
the dev server by apps/loopover-miner-ui/vite-ranked-candidates-api.ts) already exposes the last
discover run's full per-issue discovery breakdown (laneFit/freshness/potential/feasibility/
dupRisk) for the browser extension's opportunity badge, but no apps/loopover-miner-ui dashboard
route consumed it. This adds a read-only Ranked candidates route that renders it.

Mirrored route: apps/loopover-miner-ui/src/routes/run-history.tsx (named per the issue's
requirement). The new route copies its exact conventions:

  • usePolledFetch + DEFAULT_POLL_INTERVAL_MS for the fetch/poll loop.
  • StateBoundary for the loading/error/empty states, with a content-shaped Skeleton table so the
    layout doesn't jump once the poll resolves.
  • Client-side Pagination once the table exceeds 20 rows, unpaginated below it.
  • A sibling src/lib/ranked-candidates.ts (mirroring src/lib/run-history.ts) holding the typed
    fetch client, payload-shape validation, and demo-mode branch — the route file itself stays
    presentation-only.
  • A DEMO_RANKED_CANDIDATES fixture added to src/lib/demo-data.ts alongside the existing demo
    fixtures, so the route also works in the app's zero-backend demo build.
  • A new "Ranked candidates" entry in __root.tsx's nav, next to "Run history".

This is a strictly read-only view of already-existing data: vite-ranked-candidates-api.ts and
packages/loopover-miner/lib/ranked-candidates.js's ranking logic are both untouched.

Scope

Validation

  • git diff --check
  • npm run actionlint
  • npm --workspace apps/loopover-miner-ui run typecheck (root npm run typecheck OOMs on this
    sandbox; ran the scoped equivalent instead, after npm run ui:kit:build + npm run build:miner
    so @loopover/ui-kit and @loopover/engine resolve)
  • npm --workspace apps/loopover-miner-ui run lint
  • npx vitest run in apps/loopover-miner-ui (30 files, 350 tests, all passing, including the
    30 new/updated tests for this route)
  • npm run test:coverage — not run; apps/** is outside Codecov's coverage.include (confirmed
    via codecov.yml), so this UI-only change carries no patch-coverage obligation. Test coverage
    is instead validated per the issue's own Test Coverage Requirements: real behavior tests
    matching run-history.test.tsx's conventions (see src/ranked-candidates.test.tsx).
  • npm run test:workers / npm run build:mcp / npm run test:mcp-pack / npm run ui:openapi:check
    — not applicable; no backend, workers, MCP, or OpenAPI-surface changes.
  • npm --workspace apps/loopover-miner-ui run build (regenerated routeTree.gen.ts for the new
    /ranked-candidates route, committed)
  • npm audit --audit-level=moderate

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests — n/a, no auth/cookie/CORS/session code touched.
  • API/OpenAPI/MCP behavior is updated and tested where needed — n/a, /api/ranked-candidates itself is untouched (already had its own test coverage in ranked-candidates-api.test.ts).
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks (the new DEMO_RANKED_CANDIDATES fixture only activates under the existing build-time VITE_DEMO_MODE flag, same as every other route's demo data).
  • Visible UI changes include a UI Evidence section with screenshots — attempted but not included; see the note below.
  • Public docs/changelogs are updated where needed — n/a.

If any required check was skipped, explain why:

  • Local dev-server screenshot capture (Playwright, VITE_DEMO_MODE=1) hit a pre-existing sandbox
    environment crash — the client bundle pulls in packages/loopover-engine/dist/miner/deny-hook-synthesis.js,
    which calls node:crypto's createHash at module load time, and Vite's browser externalization
    throws before React can mount. This reproduces identically on the already-shipped, unmodified
    /run-history route in this same sandbox, so it is not caused by this change. Validation instead
    rests on the full green typecheck/lint/build/test suite above, and the new route's structure is a
    line-for-line mirror of run-history.tsx's already-shipped, already-screenshotted layout.

Notes

  • New files: apps/loopover-miner-ui/src/lib/ranked-candidates.ts (typed fetch client + payload
    validation, mirrors lib/run-history.ts), apps/loopover-miner-ui/src/routes/ranked-candidates.tsx
    (the route, mirrors routes/run-history.tsx), apps/loopover-miner-ui/src/ranked-candidates.test.tsx
    (route + lib tests, mirrors run-history.test.tsx's cases: fixture rendering, loading skeleton,
    error/empty states, pagination above/below 20 rows, live-refresh polling, fetch payload validation
    including both sides of the htmlUrl: string | null branch, and demo-mode).
  • Changed files: src/lib/demo-data.ts (+DEMO_RANKED_CANDIDATES fixture, scope comment updated),
    src/lib/demo-data.test.ts (+ a shape-invariant test for the new fixture), src/routes/__root.tsx
    (+nav entry), src/routeTree.gen.ts (regenerated by vite build for the new route, per the repo's
    generated-artifact convention).

/api/ranked-candidates already exposes the browser extension's
opportunity-badge data -- the last discover run's full per-issue
discovery breakdown (laneFit/freshness/potential/feasibility/dupRisk)
-- but no miner-ui dashboard route consumed it. Adds a read-only
Ranked candidates route mirroring run-history.tsx's exact
data-fetching (usePolledFetch), loading-state (StateBoundary + a
content-shaped Skeleton), and pagination conventions. No changes to
the ranking logic or the existing /api/ranked-candidates endpoint.

Closes JSONbored#7675
@galuis116
galuis116 requested a review from JSONbored as a code owner July 21, 2026 09:52
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 21, 2026
@loopover-orb

loopover-orb Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-21 09:57:43 UTC

7 files · 1 AI reviewer · no blockers · readiness 98/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This adds a read-only ranked-candidates dashboard route that consistently mirrors run-history.tsx's conventions (usePolledFetch, StateBoundary, Skeleton, client-side Pagination) and closes issue #7675, backed by a typed fetch client with payload-shape validation and a demo-mode fixture. The implementation is well-scoped, purely additive/presentational, and the routeTree.gen.ts changes are consistent with a normal TanStack Router codegen diff for a new route file. Test coverage is thorough, covering loading/error/empty states, pagination boundaries, payload validation (including the htmlUrl null/string/invalid arms), and demo mode.

Nits — 4 non-blocking
  • apps/loopover-miner-ui/src/routes/ranked-candidates.tsx: the demo/magic numeric literals in demo-data.ts (rankScore, laneFit, etc.) are fine as fixture data but the external brief's flag on routeTree.gen.ts:28 `as any` is a pre-existing codegen pattern, not new risk — no action needed.
  • apps/loopover-miner-ui/src/routes/ranked-candidates.tsx:129 — `RankedCandidatesView` is a bit large (pagination JSX inline); consider extracting the pagination controls into a small subcomponent for readability, mirroring run-history.tsx if it does the same.
  • apps/loopover-miner-ui/src/lib/demo-data.ts:59,72 — demo fixture URLs point to real github.com issue paths (fake org/issue numbers); consider using a clearly fake domain like example.com to avoid any confusion with real GitHub issues in a public demo build.
  • Consider extracting the `<Pagination>` block in RankedCandidatesView into a shared/reusable component if run-history.tsx has near-identical markup, to avoid drift between the two pagination implementations.

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #7675
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 1950 registered-repo PR(s), 1280 merged, 53 issue(s).
Contributor context ✅ Confirmed Gittensor contributor galuis116; Gittensor profile; 1950 PR(s), 53 issue(s).
Improvement ✅ Minor risk: clean · value: minor
Linked issue satisfaction

Addressed
The PR adds a new `ranked-candidates.tsx` route consuming `/api/ranked-candidates`, explicitly mirroring `run-history.tsx`'s usePolledFetch/StateBoundary/Skeleton/Pagination conventions and naming that mirrored route in the description, plus nav wiring, demo-data fixtures, and route-level tests matching existing package conventions.

Review context
  • Author: galuis116
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: JavaScript, Python, Dart, TypeScript, HTML, MDX, Rust, C++
  • Official Gittensor activity: 1950 PR(s), 53 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

Visual preview
Route Viewport Before (production) After (this PR's preview) Diff
/ranked-candidates desktop before /ranked-candidates
before /ranked-candidates
after /ranked-candidates
after /ranked-candidates
/ranked-candidates mobile before /ranked-candidates (mobile)
before /ranked-candidates (mobile)
after /ranked-candidates (mobile)
after /ranked-candidates (mobile)
/ desktop before /
before /
after /
after /
/ mobile before / (mobile)
before / (mobile)
after / (mobile)
after / (mobile)

Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy.

Scroll preview
Route Before (production) After (this PR's preview)
/ranked-candidates before /ranked-candidates (scroll)
before /ranked-candidates (scroll)
after /ranked-candidates (scroll)
after /ranked-candidates (scroll)
/ before / (scroll)
before / (scroll)
after / (scroll)
after / (scroll)

A short scroll-through clip (desktop) — click either thumbnail to open the full animation. Evidence for scroll-linked behavior a single screenshot can't show.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LoopOver approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit 3a9450b into JSONbored:main Jul 21, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add miner dashboard route consuming /api/ranked-candidates (currently extension-only)

1 participant