Skip to content

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

Merged
JSONbored merged 1 commit into
JSONbored:mainfrom
davion-knight:feat-miner-ui-grafana-footer-v2
Jul 12, 2026
Merged

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

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). (Resubmit — fixes the empty-footer defect below.)

Fix vs the prior submission (#5401, closed on review)

The prior version put the <footer className="…py-4…"> wrapper in __root.tsx unconditionally, so when VITE_MINER_UI_GRAFANA_URL was unset the inner component returned null but an empty, padded footer still rendered — violating "render nothing when unset." Now GrafanaFooterLink owns the whole <footer> and returns null for all of it when unset; __root.tsx just renders <GrafanaFooterLink />. No empty wrapper.

Behavior (matches the issue)

  • One optional VITE_-prefixed env var (VITE_MINER_UI_GRAFANA_URL) — Vite only exposes VITE_* to the client bundle.
  • Renders the footer+link only when set and non-empty; nothing at all (no footer element, no placeholder) when unset.
  • New tab (target="_blank" rel="noopener noreferrer"); URL rendered verbatim as a plain href (React-escaped, no injection); no token/credential ever appended.
  • No other footer/layout/auth logic changed; documented in the miner-ui README.

Validation

  • src/grafana-footer-link.test.tsx (3 tests): env-set → a <footer> (contentinfo) with the correctly-attributed link; env-unset → NO footer wrapper at all (queryByRole("contentinfo") is null — the exact regression); href-verbatim invariant (no credential appended).
  • tsc clean (my files); prettier-clean; no secrets. apps/** is codecov-ignored (codecov/patch vacuous).

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:49
@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

Tip

🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

✅ Gittensory review result - approve/merge recommended

Review updated: 2026-07-12 18:59:14 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR adds a GrafanaFooterLink component that owns its entire <footer> wrapper and returns null when VITE_MINER_UI_GRAFANA_URL is unset, correctly fixing the empty-padded-footer regression from the prior closed PR #5401. The implementation is simple, correctly scoped to the linked issue #5194, uses the required VITE_ prefix for client exposure, and includes tests covering both the set and unset states plus a verbatim-href/no-credential-leak check. The URL is rendered as a plain href attribute which React escapes, so no injection risk from a misconfigured value.

Nits — 5 non-blocking
  • grafana-footer-link.tsx has no href scheme validation, so a misconfigured env var like `javascript:alert(1)` would technically render, though this is operator-controlled config rather than user input so the risk is minimal.
  • The component doesn't trim the url before the truthiness check, so a value of whitespace-only string (e.g. " ") would pass `!url` and render a broken/blank link — worth a `.trim()` guard for defensive hardening.
  • Consider trimming and validating the URL scheme (http/https) in grafana-footer-link.tsx before rendering, to guard against obviously malformed operator config.
  • The README table formatting is a bit wide/unaligned for the long description cell — could wrap or shorten for readability, purely stylistic.
  • nit: apps/gittensory-miner-ui/src/components/grafana-footer-link.tsx:1 has a long explanatory header comment that repeats the README and tests; I would trim this to the env-var contract plus the empty-render invariant so the component stays easier to scan.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
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: 124 registered-repo PR(s), 89 merged, 2 issue(s).
Contributor context ✅ Confirmed Gittensor contributor davion-knight; Gittensor profile; 124 PR(s), 2 issue(s).
Gate result ✅ Passing No configured blocker found.
Improvement ✅ Minor risk: clean · value: minor — Code changes are accompanied by test evidence.
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: 124 PR(s), 2 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 &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @gittensory chat &lt;question&gt; 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 added the manual-review Gittensor contributor context label Jul 12, 2026
@JSONbored
JSONbored merged commit d307658 into JSONbored:main Jul 12, 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. manual-review Gittensor contributor context

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

2 participants