fix(ui): make activity-heatmap day cells keyboard-focusable#4957
fix(ui): make activity-heatmap day cells keyboard-focusable#4957philluiz2323 wants to merge 1 commit into
Conversation
|
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 #4957 +/- ##
=======================================
Coverage 97.94% 97.94%
=======================================
Files 163 163
Lines 19418 19418
Branches 7376 7376
=======================================
Hits 19018 19018
Misses 53 53
Partials 347 347 🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-13 00:44:10 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 7 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.
|
JSONbored
left a comment
There was a problem hiding this comment.
Screenshots are all blank, closing.

Closes #3955
What
activity-heatmap.tsx's day cells were bare<div>s wrapped in a RadixTooltipTrigger asChild, withonPointerMove/onPointerLeave-driven hover as the only way to reveal the per-day probe/incident tooltip. There was notabIndex/focus handling, so keyboard-only and screen-reader users got only the parent grid's single staticaria-labelsummary and never the per-day detail mouse users see on hover.Building on a prior, correctly-reviewed attempt
An earlier PR (#4652) took the straightforward fix — swap the
<div>for a<button>— and was reviewed favorably (readiness 95/100, no blockers) before being closed. That review flagged a real, unaddressed wrinkle: the day cells sit inside a parent<div role="img" aria-label="Registry activity heatmap...">.role="img"tells assistive tech the element is a single atomic graphic with no interactive descendants — most screen readers flatten/hide arole="img"subtree, so nesting real<button>s inside it would restore keyboard tab focus but likely still fail to expose them to screen-reader users navigating by AT, defeating part of the point.This PR fixes both pieces:
activity-heatmap.tsx:127) becomes a<button type="button">, keeping the same className/style/aria-label, plus afocus-visible:ring-1 focus-visible:ring-ringring consistent with other focusable tiles in this codebase (e.g.stat-with-spark.tsx). Since Radix'sTooltipTrigger asChildalready wires its child's focus/blur to open/close the tooltip, this alone makes the existing tooltip reveal on keyboard focus — no new tooltip logic needed.activity-heatmap.tsx:116-120) changes fromrole="img"torole="group"with the samearia-label.groupis a container role that does not flatten or hide interactive descendants, so it keeps a labeled-region summary for the grid as a whole while letting each day cell be independently focusable and exposed to assistive tech — resolving the exact nested-interactive-in-atomic-image conflict the prior PR's review identified, rather than leaving it unaddressed.Screenshots
before
after
before
after
before
after
before
after
before
after
before
after
At rest the heatmap is pixel-identical before/after (confirmed above) — Tailwind's base reset already neutralizes native
<button>default styling, so no visual regression from the div→button swap.Keyboard interaction (animated)
/subnets/1(GitHub doesn't inline-render
.webmfrom araw.githubusercontent.comlink — click through to view. Before: repeatedly pressing Tab near the grid never lands on or reveals a day cell's tooltip. After: Tab reaches the first cell directly, and the Radix tooltip opens on focus exactly as it does on hover; continuing to Tab moves cleanly through subsequent cells.)Verification
<button>(confirmed viadocument.activeElement), and the RadixTooltipContentbecomesvisiblewith real per-day text (e.g."2026-04-19", "0 probes") — no separate tooltip-reveal code needed, sinceTooltipTrigger asChildalready wires this.role="img"anymore (walked the DOM tree in-browser) — the exact nested-interactive-in-atomic-image conflict the prior PR's review flagged is resolved.Acceptance criteria
activity-heatmap.tsxappears in the diffrole="img"replaced withrole="group"on the parent, which doesn't hide interactive descendantsTesting
npx tsc --noEmit: no new errors (2 pre-existing, unrelated errors reproduce identically on a cleanmaincheckout).npx prettier --checkandnpx eslinton the changed file: clean aside from pre-existing CRLF noise unrelated to this change.