fix(ui): swap raw one-off values for design tokens in metagraphed components batch 4/5#8192
Conversation
…h 4/5 Converts 35 of the 39 no-restricted-syntax violations (arbitrary text-[Npx] sizes, two hand-rolled card shells, and raw <a target=_blank> anchors) across the 17 files in this batch to the matching primitive/token, no visual/behavioral change intended: - Plain-sans micro text (10-11px, no font-mono) snaps to mg-type-caption (12px) -- the smallest sans step on the scale, same sub-2px normalization tolerance JSONbored#8183 established. - Mono-context 9/9.5px sites move onto mg-type-data-sm, dropping the now-redundant font-mono; the profile panel 2-char provider-initials chip takes mg-type-micro (the canonical uppercase-mono idiom). - The two font-display headline figures (14px profile stat, 15px priority-highlight value) get exact-match inline styles against the reserved --mg-type-body/--mg-type-body-lg vars -- no utility class exists at those steps; same recipe JSONbored#8183 used for subnets-highlights. - Both stake-amount-input segmented controls wrap in <Panel> with the flex layout moved to bodyClassName -- byte-for-byte the recipe JSONbored#8183 established for take-management-modal. - states.tsx Open API URL action and subnet-masthead resource-rail anchors move onto <ExternalLink bare>; the masthead ones sit behind a wrapper span that carries the Radix TooltipTrigger Slot ref, since ExternalLink does not forward refs (same recipe as JSONbored#8168). Deliberately left, per the issue req-2 escape hatch: - subnets-compare-drawer.tsx sticky-cell z-[1]/z-[2] (3 sites) -- CONTRIBUTING.md documents this exact pattern as the one standing exception to the --mg-z-* scale; JSONbored#8183 made the identical call for the sibling validators-compare-drawer. - registry-empty.tsx evidence anchor -- its evidenceHref is a same-origin relative artifact path, which ExternalLink's safeExternalUrl rejects outright; converting would break the link. Closes JSONbored#8170.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8192 +/- ##
=======================================
Coverage 97.82% 97.82%
=======================================
Files 415 415
Lines 28893 28893
Branches 10850 10850
=======================================
Hits 28265 28265
Misses 141 141
Partials 487 487 🚀 New features to boost your workflow:
|
|
Warning ⏸️ LoopOver review result - manual review recommendedReview updated: 2026-07-26 05:28:39 UTC
Review summary Nits — 7 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionPartially addressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk 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.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. Visual preview
Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy. Scroll preview
A short scroll-through clip (desktop) — click either thumbnail to open the full animation. Evidence for scroll-linked behavior a single screenshot can't show. 🟩 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.
|


design-tokens: ratchet-clean apps/ui components batch 4/5
Converts 35 of the 39
no-restricted-syntaxBone & Ink violations across the 17 files in this batch to the matching primitive/token per each eslint message, with zero visual/behavioral change intended. The remaining 4 are documented residuals (see "Deliberately left" below).What was swapped, by fix type
Bare arbitrary text sizes →
mg-type-*utilities / reserved-scale vars (31 sites)text-[10px]/text-[11px], nofont-mono) →mg-type-caption(12px) — the smallest sans step on the scale; same sub-2px normalization tolerance batch 5/5 (fix(ui): swap raw Bone & Ink one-off values for design tokens in batch 5/5 #8183) established. Applies to the search-box result subtitle, settings-popover hints/descriptions and density/theme segmented buttons, the shortcuts-popover tooltip, the Delegate pills (sponsored-validator-callout, subnet-validators-preview), the stake-unstake-modal indexing hint, states.tsx's Retry / Open API URL / EmptyState action buttons, registry-empty's freshness + verify paragraphs, both subnet-compare-drawer controls, the health-matrix and profile-panel tooltips, the price-ticker items, the priority-highlights hint, and the profile-panel lineage pill / provider rows / "No ownership keys recorded."mg-type-data-sm(10px mono), dropping the now-redundantfont-mono: status-diagnostics' classification-mix chips (text-[9px]), health-matrix netuid cell numbers (text-[9px], keepsfont-semibold leading-none tabular-nums tracking-tight), and subnet-masthead's uptime-delta chip + curation-level span (bothtext-[9.5px]).font-mono text-[9px] uppercase) →mg-type-micro— the canonical uppercase-mono idiom at 9.5px.font-display text-[14px]headline figure (subnet-profile-panel) → inlinestyle={{ fontSize: "var(--mg-type-body)" }}andfont-display text-[15px]value line (subnet-priority-highlights) → inlinestyle={{ fontSize: "var(--mg-type-body-lg)" }}— exact-match against the already-defined-but-unconsumed reserved scale steps (no.mg-type-body*utility class exists), the same recipe fix(ui): swap raw Bone & Ink one-off values for design tokens in batch 5/5 #8183 used for subnets-highlights' 15px value.Hand-rolled
rounded border bg-cardshells →<Panel>(2 sites)<Panel as="div" role="tablist" flush bodyClassName="inline-flex items-center !p-0.5">— byte-for-byte the recipe fix(ui): swap raw Bone & Ink one-off values for design tokens in batch 5/5 #8183 established for take-management-modal's direction toggle (the identical original classes).Raw
<a target="_blank">→<ExternalLink>from@jsonbored/ui-kit(2 sites)<ExternalLink bare>(keeps its custom icon/classes pixel-identical;safeUrlis already absolute).<ExternalLink bare>behind a wrapper<span className="inline-flex">that carries the RadixTooltipTrigger asChildSlot ref/props, since ExternalLink doesn't forward refs to its anchor — same wrapper recipe as batch 2/5 (design-tokens: ratchet-clean apps/ui components batch 2/5 (17 files, 47 violations) #8168)'s icon-only row action. The unsafe-href fallback branch keeps its existing plain<span>.RATCHETED_DIRSintentionally not touched —src/components/metagraphed/**still has other violating files outside this batch (issue req 3).Deliberately left (documented residuals, still warn-tier)
subnets-compare-drawer.tsx:232/234/250— sticky corner-cellz-[1]/z-[2]: CONTRIBUTING.md's one standing exception to the--mg-z-*scale (local table stacking context, not a global layer; the sites even carry the in-code#7841comment). fix(ui): swap raw Bone & Ink one-off values for design tokens in batch 5/5 #8183 made the identical call for the sibling validators-compare-drawer.tsx and deliberately left this file's pattern untouched; there is no--mg-z-*token for micro-steps 1/2, so converting would fight the documented intent.states/registry-empty.tsx:141— the "evidence & sources" anchor stays raw (now with an in-code comment): itsevidenceHrefis a same-origin relative artifact path (/metagraph/gaps.jsonon the gaps page,/metagraph/surfaces.jsonon surfaces), and<ExternalLink>'ssafeExternalUrlrejects relative URLs outright — converting would render the "blocked unsafe URL" fallback and break the link. Flagged here per the issue's req-2 escape hatch (no matching primitive for a same-origin new-tab artifact link).Verification
npx eslinton all 17 files: 39 warnings → 4 (the documented residuals above), 0 errorsnpx tsc --noEmit(npm run typecheck): cleannpx prettier --checkon all touched files: cleannpx vitest run: 191 files, 1460 tests, all passnpm run build(vite build): succeedsgit diff --check: cleanBefore/after screenshots
Captured per the Phase C2 contract with
apps/ui/tests/e2e/capture-pr-screenshots.ts(plus the same script's viewport/theme matrix driven through the popover/typed-search/forced-error/drawer interactions it has no flags for): fixed viewports only (desktop 1280×800, tablet 768×1024, mobile 375×812), both themes forced viamg-theme, before = merge-base6a156b4(origin/main), after = this branch. One table per touched surface; every touched component that renders reachably in the app appears in at least one table./— home, subnet price tickerTouched component(s) in frame:
subnet-price-ticker.tsx(the marquee strip under the header)before
after
before
after
before
after
before
after
before
after
before
after
/subnets/74— page top, sponsored callout + top validatorsTouched component(s) in frame:
sponsored-validator-callout.tsx,subnet-validators-preview.tsx(Delegate pills)before
after
before
after
before
after
before
after
before
after
before
after
/subnets/74— subnet mastheadTouched component(s) in frame:
subnet-masthead.tsx(resource links rail, uptime-delta chip, curation-level span)before
after
before
after
before
after
before
after
before
after
before
after
/subnets/74— priority highlights stripTouched component(s) in frame:
subnet-priority-highlights.tsxbefore
after
before
after
before
after
before
after
before
after
before
after
/subnets/74— subnet profile panelTouched component(s) in frame:
subnet-profile-panel.tsx(field tiles, lineage pill, top-providers rows, ownership block)before
after
before
after
before
after
before
after
before
after
before
after
/subnets/74— compare drawer openTouched component(s) in frame:
subnet-compare-drawer.tsx(trigger pill + drawer compare form)before
after
before
after
before
after
before
after
before
after
before
after
/health— subnet health matrixTouched component(s) in frame:
subnet-health-matrix.tsx(netuid cell numerals)before
after
before
after
before
after
before
after
before
after
before
after
/status— Source health tableTouched component(s) in frame:
status-diagnostics.tsx(classification-mix chips in the provider rows)before
after
before
after
before
after
before
after
before
after
before
after
/subnets/1023— netuid with no published profile artifact (natural error state)Touched component(s) in frame:
states.tsx(ErrorStateheading, detail, and Retry action)before
after
before
after
before
after
before
after
before
after
before
after
Settings popover (opened on
/)Touched component(s) in frame:
settings-popover.tsx(theme/density segmented buttons, palette descriptions, hint paragraphs)before
after
before
after
before
after
before
after
Mobile omitted: the header settings trigger collapses into the mobile menu at this viewport, so the popover has no standalone trigger to open.
Keyboard-shortcuts trigger tooltip/popover (opened on
/)Touched component(s) in frame:
shortcuts-popover.tsxbefore
after
before
after
before
after
before
after
Mobile omitted: the keyboard-shortcuts trigger (and its hover tooltip) has no pointer-hover affordance on a touch viewport and is not rendered there.
/agents— registry search with resultsTouched component(s) in frame:
search-box.tsx(result subtitles)before
after
before
after
before
after
before
after
before
after
before
after
/gaps— filtered-to-empty registry stateTouched component(s) in frame:
states/registry-empty.tsx(freshness + verify paragraphs; residual evidence anchor)before
after
before
after
before
after
before
after
before
after
before
after
Not shown above:
stake-amount-input.tsxandstake-unstake-modal.tsxrender only inside the wallet-gated stake flow (a connected extension account is required before the amount step or the post-broadcast status view mounts), which a headless capture cannot exercise -- their swaps are covered by the eslint/tsc/vitest gates, and the<Panel>recipe used is byte-for-byte the one already merged (and screenshot-reviewed) for take-management-modal in #8183.subnets-compare-drawer.tsxcarries no code change in this PR (residual-only file, see "Deliberately left").Closes #8170