feat(miner-ui): add an optional ORB/Grafana footer link to the root layout - #5403
Conversation
…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
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-12 18:59:14 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk 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.
Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands Visual preview
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.
|
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.tsxunconditionally, so whenVITE_MINER_UI_GRAFANA_URLwas unset the inner component returned null but an empty, padded footer still rendered — violating "render nothing when unset." NowGrafanaFooterLinkowns the whole<footer>and returns null for all of it when unset;__root.tsxjust renders<GrafanaFooterLink />. No empty wrapper.Behavior (matches the issue)
VITE_-prefixed env var (VITE_MINER_UI_GRAFANA_URL) — Vite only exposesVITE_*to the client bundle.target="_blank" rel="noopener noreferrer"); URL rendered verbatim as a plainhref(React-escaped, no injection); no token/credential ever appended.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).tscclean (my files); prettier-clean; no secrets.apps/**is codecov-ignored (codecov/patch vacuous).Closes #5194