Skip to content

Add an optional ORB/Grafana footer link to the miner-ui root layout #5194

Description

@JSONbored

Context

apps/gittensory-miner-ui/src/routes/__root.tsx is the miner-ui's root layout, but there is no way today for a dual-role operator running both ORB and AMS on one machine to navigate from miner-ui to their own ORB dashboard or Grafana instance. grafana/dashboards/resource-hub.json already links the other direction (ORB out to other services) - this candidate closes the loop in reverse.

Dependencies

None - independently shippable. Purely additive: reads one optional env var and renders nothing when it is unset.

Requirements

  1. Introduce one optional environment variable - settle on a single name (e.g. MINER_UI_GRAFANA_URL or MINER_UI_ORB_DASHBOARD_URL) and use it consistently in code, tests, and docs.
  2. In __root.tsx, render a footer link to that URL only when the env var is set and non-empty; render nothing (no placeholder, no disabled link) when it is unset.
  3. The link must open in a new tab: target="_blank" rel="noopener noreferrer", since it points to an operator-configured external host.
  4. Never append any auth/session token, API key, or credential to the URL or as a query parameter - it is a plain navigational link to an operator-supplied dashboard address.
  5. Escape/render the env-var-derived URL safely (no dangerouslySetInnerHTML or unescaped interpolation) so a misconfigured value cannot inject markup into the footer.
  6. Do not change any other footer content, layout, or auth-guarded route logic in this PR.
  7. Document the new env var in the miner-ui's existing configuration documentation (README or equivalent config table).

Deliverables / Acceptance Criteria

  • __root.tsx conditionally renders the footer link based on the new env var
  • Link uses target="_blank" rel="noopener noreferrer"
  • No link/element rendered when the env var is unset or empty
  • New env var documented in miner-ui config docs
  • No other footer/layout content changed

Test Coverage Requirements

This PR must ship with full test coverage for every changed line and branch - the repo's Codecov patch gate requires 99%+ coverage and the house standard is to aim for 100%, including both sides of every conditional/nullish-coalescing branch introduced. Add: (1) unit/component tests covering both the 'env var set' (link renders with correct href/target/rel) and 'env var unset/empty' (nothing renders) branches, (2) an invariant test asserting 'the footer never renders a raw, unescaped env-var value that could inject markup, and never includes any token/credential in the href', and (3) no regression test is required since this is a net-new feature, not a bug fix.

Codecov visibility note: packages/gittensory-miner/**, apps/gittensory-miner-ui/**, and apps/gittensory-miner-extension/** currently sit entirely outside vitest's coverage.include glob, so codecov/patch cannot measure changes there yet — closing that gap is exactly what #4864 and #4865 (in this same milestone) do. Any part of this change under packages/gittensory-engine/src/** or the repo's own src/** remains fully Codecov-instrumented as usual. Either way, this does not lower the bar: treat the 100%-including-invariants-and-regression target above as the enforced house standard regardless of what Codecov can currently see, and it becomes gate-enforced for real once #4864/#4865 ship.

Expected Outcome

An operator running both ORB and AMS on one host can click straight from miner-ui to their own configured ORB/Grafana dashboard, instead of having to remember or re-navigate to that URL manually.

Links & Resources

  • apps/gittensory-miner-ui/src/routes/__root.tsx
  • grafana/dashboards/resource-hub.json (pattern reference, opposite direction)
  • Theme: Miner-ui/extension polish beyond Wave 5

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.visualUI/web visual work — owner-led, NOT for Gittensor contributors (extensions excepted)

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions