Skip to content

feat(miner-ui): add an optional ORB/Grafana footer link to the root layout - #5401

Closed
davion-knight wants to merge 1 commit into
JSONbored:mainfrom
davion-knight:feat-miner-ui-grafana-footer
Closed

feat(miner-ui): add an optional ORB/Grafana footer link to the root layout#5401
davion-knight wants to merge 1 commit into
JSONbored:mainfrom
davion-knight:feat-miner-ui-grafana-footer

Conversation

@davion-knight

Copy link
Copy Markdown
Contributor

Renders a footer link to an operator-configured ORB/Grafana dashboard in the miner-ui root layout (#5194).

Behavior (matches the issue exactly)

  • One optional env varVITE_MINER_UI_GRAFANA_URL. VITE_-prefixed because Vite only exposes VITE_* to the client bundle (a bare name would be silently undefined at build).
  • Conditional — the link renders only when the var is set and non-empty; nothing (no placeholder, no disabled link) when unset/empty.
  • New tabtarget="_blank" rel="noopener noreferrer".
  • No credentials — the URL is rendered verbatim as a plain href; no token/session/API key is ever appended.
  • Safe — rendered as a normal href attribute (React escapes it; no dangerouslySetInnerHTML), so a misconfigured value cannot inject markup.
  • Extracted as a small GrafanaFooterLink component; no other footer/layout/auth logic changed. Documented in the miner-ui README.

Validation

  • src/grafana-footer-link.test.tsx (3 tests): env-set → link with correct href/target/rel; env-unset/empty → nothing renders; invariant → href is the URL verbatim with no token/credential appended.
  • tsc clean (my files); prettier-clean; no secrets. apps/** is codecov-ignored, so codecov/patch is vacuous — the branch-covering suite ships regardless.

Closes #5194

…ayout

Render a footer link to an operator-configured ORB/Grafana dashboard (JSONbored#5194), shown only when
VITE_MINER_UI_GRAFANA_URL is set and non-empty (nothing rendered otherwise). Vite exposes only
VITE_-prefixed vars to the client bundle, so the name is VITE_-prefixed — a bare name would be
undefined at build. Opens in a new tab (target=_blank rel=noopener noreferrer); the URL is
rendered as a plain href (React escapes it, no dangerouslySetInnerHTML) and no token/credential
is ever appended. Extracted as a small GrafanaFooterLink component for direct testing.

Closes JSONbored#5194
@davion-knight
davion-knight requested a review from JSONbored as a code owner July 12, 2026 16:39
@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 12, 2026
@loopover-orb

loopover-orb Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Caution

🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥

🛑 Gittensory review result - reject/close recommended

Review updated: 2026-07-12 16:43:53 UTC

4 files · 2 AI reviewers · 1 blocker · readiness 100/100 · CI green · clean

🛑 Suggested Action - Reject/Close

  • AI reviewers agree on a likely critical defect: apps/gittensory-miner-ui/src/routes/__root.tsx:32 renders the footer wrapper unconditionally, so when `VITE_MINER_UI_GRAFANA_URL` is unset `GrafanaFooterLink` returns null but users still get an empty `py-4` footer instead of no visible footer/placeholder
  • move the conditional to the layout or have `GrafanaFooterLink` own the footer wrapper and return null for the whole footer. — Resolve the flagged defect, or override if the AI reviewers are mistaken, then re-run the gate.

Review summary
Small, well-scoped feature adding an optional footer link controlled by VITE_MINER_UI_GRAFANA_URL, rendered conditionally with safe href handling and no credential leakage. Implementation matches the issue description closely, is properly tested (set/unset/verbatim-URL cases), documented in the README, and the diff is minimal and self-contained. No correctness or security issues are visible in this diff.

Blockers

  • apps/gittensory-miner-ui/src/routes/__root.tsx:32 renders the footer wrapper unconditionally, so when `VITE_MINER_UI_GRAFANA_URL` is unset `GrafanaFooterLink` returns null but users still get an empty `py-4` footer instead of no visible footer/placeholder; move the conditional to the layout or have `GrafanaFooterLink` own the footer wrapper and return null for the whole footer.
Nits — 5 non-blocking
  • Consider basic URL validation (e.g. restricting to http/https) since a misconfigured value like a `javascript:` URI, though only settable by the operator via build-time env var and not user input, would still be an unusual href to render verbatim.
  • The env var is read directly in the component (`import.meta.env.VITE_MINER_UI_GRAFANA_URL`) rather than through a shared config module — fine for a single optional var, but worth confirming this matches the project's existing convention for other env-driven UI features if one exists.
  • apps/gittensory-miner-ui/src/components/grafana-footer-link.tsx: optionally guard against non-http(s) schemes before rendering the href.
  • README table formatting is a bit wide/unwieldy — consider wrapping the description column for readability.
  • apps/gittensory-miner-ui/src/components/grafana-footer-link.tsx:7 treats whitespace-only values as configured, so consider trimming before deciding whether to render if operators commonly set env vars through templated config.

Why this is blocked

  • apps/gittensory-miner-ui/src/routes/__root.tsx:32 renders the footer wrapper unconditionally, so when `VITE_MINER_UI_GRAFANA_URL` is unset `GrafanaFooterLink` returns null but users still get an empty `py-4` footer instead of no visible footer/placeholder; move the conditional to the layout or have `GrafanaFooterLink` own the footer wrapper and return null for the whole footer.
Signal Result Evidence
Code review ❌ 1 blocker 2 reviewers, synthesized
Linked issue ✅ Linked #5194
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: 119 registered-repo PR(s), 87 merged, 1 issue(s).
Contributor context ✅ Confirmed Gittensor contributor davion-knight; Gittensor profile; 119 PR(s), 1 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
Improvement ✅ Minor risk: clean · value: minor — Code changes are accompanied by test evidence. LLM value judgment: minor — The diff is a small, correctly targeted feature that directly closes the linked issue #5194 with matching behavior, tests, and docs, but it's a narrow single-component addition with limited overall codebase impact.
Linked issue satisfaction

Addressed
The PR adds a single optional VITE_MINER_UI_GRAFANA_URL env var, conditionally renders a target=_blank/rel=noopener noreferrer footer link only when set, uses a plain href with no credential appended, and includes tests covering both branches plus an invariant check; the env var is also documented in the README and no other footer/layout content is touched.

Review context
  • Author: davion-knight
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 119 PR(s), 1 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.
[BETA] Chat with Gittensory

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

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

Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands

Visual preview
Route Viewport Before (production) After (this PR's preview) Diff
/ desktop before / after /
/ mobile before / (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 Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@loopover-orb

loopover-orb Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Gittensory is closing this pull request on the maintainer's behalf (AI reviewers agree on a likely critical defect: apps/gittensory-miner-ui/src/routes/__root.tsx:32 renders the footer wrapper unconditionally, so when `VITE_MINER_UI_GRAFANA_URL` is unset `GrafanaFooterLink` returns null but users still get an empty `py-4` footer instead of no visible footer/placeholder; move the conditional to the layout or have `GrafanaFooterLink` own the footer wrapper and return null for the whole footer.). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

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 an optional ORB/Grafana footer link to the miner-ui root layout

1 participant