Skip to content

fix(miner-ui): render oldestQueuedAgeMs in the overview portfolio card (#6185) - #6451

Merged
JSONbored merged 1 commit into
JSONbored:mainfrom
shin-core:fix/render-oldest-queued-age-6185
Jul 16, 2026
Merged

fix(miner-ui): render oldestQueuedAgeMs in the overview portfolio card (#6185)#6451
JSONbored merged 1 commit into
JSONbored:mainfrom
shin-core:fix/render-oldest-queued-age-6185

Conversation

@shin-core

Copy link
Copy Markdown
Contributor

Summary

  • apps/loopover-miner-ui/src/lib/portfolio-queue.ts computes and validates oldestQueuedAgeMs, and the module's own header promises the miner-ui "serves the SAME per-repo dashboard shape the CLI's queue dashboard command computes ... so the miner-ui and the CLI share one data path." The CLI renders it (packages/loopover-miner/lib/portfolio-dashboard.js → "oldest-queued: Xm"), but the web OverviewPortfolioCard never read the field — the parity claim wasn't actually delivered.
  • Render oldestQueuedAgeMs as an "Oldest queued" stat in OverviewPortfolioCard (routes/index.tsx), formatted with the CLI's exact Math.round(oldestQueuedAgeMs / 60000)m minutes rounding. It's conditionally shown only when the value is non-null, matching the CLI, which omits the age line on an empty queue.
  • CLI rendering (portfolio-dashboard.js) is untouched — it's the formatting reference. UI-only change under apps/**.

Closes #6185

Scope

  • The PR title follows type(scope): short summary Conventional Commit format.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves (Closes #6185).

Validation

  • git diff --check
  • npm run typecheck (repo-wide) clean.
  • @loopover/ui-miner workspace: tsc --noEmit clean, vitest run --coverage green — 134 tests pass (adds a test asserting the "Oldest queued" stat renders "90m" for a 5,400,000 ms age, and that it is omitted when the age is null), coverage stays above the workspace's own 85% thresholds.
  • npm run test:ci (validates the rest of the repo is unaffected — apps/** is excluded from the root coverage suite by design).
  • npm audit --audit-level=moderate
  • Captured the change in a real browser (Vite preview build + Playwright) — see UI Evidence.

If any required check was skipped, explain why:

  • No OpenAPI/cf-typegen/migration/env-reference regeneration needed — a view-only addition with no API, binding, schema, or generated-doc surface.

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: none touched.
  • API/OpenAPI/MCP behavior is updated and tested where needed. — N/A: no API/OpenAPI/MCP surface changed.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks. — the stat reads the live portfolio.summary.oldestQueuedAgeMs from the same fetched result the card already renders; the card's existing loading/error/empty states are unchanged.
  • Visible UI changes include a UI Evidence section below with a captioned JPG/PNG thumbnail.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs. — N/A.

UI Evidence

State / title JPG/PNG evidence
Overview — Portfolio queue card now shows "Oldest queued: 90m" (desktop, 1280×800) Overview Portfolio queue card rendering the Oldest queued stat as 90m

Notes

  • The rendered age uses the same minutes rounding as the CLI so the two surfaces read identically; a null age (empty queue) shows no "Oldest queued" row, exactly as the CLI omits its age line.

JSONbored#6185)

portfolio-queue.ts computes and validates oldestQueuedAgeMs and its header
promises the miner-ui shares one data path with the CLI's queue dashboard,
which renders "oldest-queued: Xm" -- but OverviewPortfolioCard never read the
field. Render it as an "Oldest queued" stat using the CLI's exact
Math.round(ms / 60000)m minutes formatting, shown only when non-null (matching
the CLI, which omits the age on an empty queue). Adds tests for the populated
and null cases. CLI rendering is untouched.

Closes JSONbored#6185
@shin-core
shin-core requested a review from JSONbored as a code owner July 16, 2026 08:41
@superagent-security superagent-security Bot added the contributor:flagged Contributor flagged for review by trust analysis. label Jul 16, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

🚨 Contributor flagged. Click here for more info: Superagent Dashboard

@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:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 16, 2026
@loopover-orb

loopover-orb Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Warning

⏸️ LoopOver review result - manual review recommended

Review updated: 2026-07-16 08:49:47 UTC

2 files · 1 AI reviewer · no blockers · CI green · unstable

⏸️ Suggested Action - Manual Review

Review summary
This is a small, well-targeted UI fix that renders the already-computed `oldestQueuedAgeMs` field as an "Oldest queued" stat in `OverviewPortfolioCard`, matching the CLI's exact rounding formula (`Math.round(ms/60000)m`) and conditional omission when null. The change is correct, minimal, and covered by two new tests (empty-queue omission and 5,400,000ms → "90m" rendering) that exercise the real rendered DOM via `statValue`, not a fabricated path. It closes issue #6185 as required and stays scoped to the single file plus its test.

Nits — 4 non-blocking
  • apps/loopover-miner-ui/src/routes/index.tsx:88 — the `60000` divisor is a repeated magic number matching the CLI's formula; consider a shared `MS_PER_MINUTE` constant (or import from the CLI's shared module if one exists) to keep the two rounding implementations from drifting apart.
  • The large inline JSX comment in routes/index.tsx (3 lines) is more verbose than the file's existing single-line doc comments; could be trimmed to one line consistent with the surrounding style.
  • Consider extracting the minutes-rounding formula into a small shared utility (e.g. `formatAgeMinutes(ms)`) used by both the CLI's `portfolio-dashboard.js` and this component, to guarantee parity is enforced by code rather than by comment/convention.
  • The new test only covers one non-null value (5,400,000ms); a boundary case like 0ms or a very small value could clarify rounding behavior, though this is optional given the CLI's formula is just mirrored.
Flagged checks (non-blocking)
  • Contributor trust — Contributor flagged for review

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 #6185
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: 45 registered-repo PR(s), 21 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor shin-core; Gittensor profile; 45 PR(s), 0 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: minor
Linked issue satisfaction

Addressed
The PR adds rendering of oldestQueuedAgeMs as an "Oldest queued" stat in OverviewPortfolioCard, formatted identically to the CLI's Math.round(ms/60000)m, conditionally omitted when null just like the CLI, and includes tests covering both cases.

Review context
  • Author: shin-core
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: TypeScript, JavaScript, Solidity, Dart, Python, CSS, PHP, Rust
  • Official Gittensor activity: 45 PR(s), 0 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 <question> answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat <question> 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
/ 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.

🟩 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 added the manual-review Gittensor contributor context label Jul 16, 2026
@JSONbored
JSONbored merged commit 0d69db2 into JSONbored:main Jul 16, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor:flagged Contributor flagged for review by trust analysis. gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(miner-ui): oldestQueuedAgeMs computed/validated but never displayed, breaking the stated CLI/web-UI shared-data-path contract

2 participants