Part of the mobile UI plan (see Phase 1 issue for overview).
Goal
Chart point/legend details currently only show on mouseover via d3.tip, duplicated across five files. On touch devices there's no hover, so this detail is invisible on mobile.
Affected: static/js/voteCharts.js (~line 528), static/js/party.js (~lines 428, 494), static/js/committee.js (~line 347), static/js/personIdeology.js (~line 253), static/js/district.js (~line 375).
Scope
- Extract the repeated
d3.tip mouseover pattern into one shared helper.
- Gate on
matchMedia('(pointer: coarse)'): mouse/pointer-fine keeps hover behavior; touch gets tap-to-toggle (tap opens, tap elsewhere or a close affordance dismisses).
- Ensure toggled tooltips are keyboard/focus accessible too (consistent with the existing WCAG pass).
Test plan
🤖 Generated with Claude Code
https://claude.ai/code/session_013KJMYfgTNsxrmjHZpZKAHT
Part of the mobile UI plan (see Phase 1 issue for overview).
Goal
Chart point/legend details currently only show on
mouseoverviad3.tip, duplicated across five files. On touch devices there's no hover, so this detail is invisible on mobile.Affected:
static/js/voteCharts.js(~line 528),static/js/party.js(~lines 428, 494),static/js/committee.js(~line 347),static/js/personIdeology.js(~line 253),static/js/district.js(~line 375).Scope
d3.tipmouseover pattern into one shared helper.matchMedia('(pointer: coarse)'): mouse/pointer-fine keeps hover behavior; touch gets tap-to-toggle (tap opens, tap elsewhere or a close affordance dismisses).Test plan
🤖 Generated with Claude Code
https://claude.ai/code/session_013KJMYfgTNsxrmjHZpZKAHT