-
-
Notifications
You must be signed in to change notification settings - Fork 2
fix: enable glossary term tooltips on mobile via tap interaction #159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
On mobile devices, highlighted glossary terms in practice questions couldn't show their definitions since tooltips require hover (which doesn't exist on touch devices). - Add GlossaryTermTooltip component that renders Popover on mobile, Tooltip on desktop - Add GlossaryTermProvider context to ensure only one definition shows at a time when tapping terms - Mobile: tap term to show definition, tap elsewhere to dismiss Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Updates to Preview Branch (fix/mobile-glossary-tooltips) ↗︎
Tasks are run on every commit but only new migration files are pushed.
View logs for this Workflow Run ↗︎. |
Pull Request Review: Mobile Glossary Term TooltipsOverviewThis PR successfully addresses mobile accessibility for glossary term definitions by implementing a responsive wrapper that uses Popover on mobile (tap-to-show) and Tooltip on desktop (hover). The solution is well-architected with clean separation of concerns. ✅ Strengths1. Excellent Architectural Design
2. Responsive Design Pattern
3. Code Quality
4. Minimal Changes
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #159 +/- ##
==========================================
+ Coverage 86.79% 86.83% +0.03%
==========================================
Files 115 116 +1
Lines 14521 14565 +44
Branches 2231 2238 +7
==========================================
+ Hits 12603 12647 +44
Misses 1918 1918
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
- Add comprehensive tests for mobile (Popover) and desktop (Tooltip) behavior - Test single-popover constraint via context - Document SSR/hydration behavior in component comments Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
PR Review: Mobile Glossary Term TooltipsGreat work on addressing the mobile interaction issue! This is a well-thought-out solution that properly adapts the UX for touch devices. Here's my detailed review: ✅ Strengths1. Clean Architecture
2. Excellent Test Coverage
3. Follows Project Conventions
4. Good UX Design
🔍 Issues & Recommendations1. Initial Render Flash on Mobile (Low Priority)Location: The comment acknowledges this: // Note: useIsMobile returns false during SSR/initial render, then updates after hydration.
// This means mobile users briefly see Tooltip (hover) behavior before Popover activates.Issue: Mobile users will briefly see the tooltip (which requires hover) before the popover activates. This could cause a momentary flash or incorrect interaction state. Recommendation: Consider initializing 2. Context Robustness (Low Priority)Location: Issue: The mobile popover uses optional chaining for context access. If the Recommendation: Either:
The test file shows this is handled (line 181-196), but the runtime behavior could be clearer. 3. Accessibility Consideration (Medium Priority)Issue: The mobile popover doesn't appear to have explicit ARIA attributes for screen reader users. When a glossary term is clicked on mobile, screen readers should announce that a definition has been revealed. Recommendation: Consider adding 4. Popover Styling Discrepancy (Low Priority)Location: The popover content uses 5. Test Isolation (Low Priority)Location: Observation: The tests mock 🔒 Security Review✅ No security concerns identified:
⚡ Performance Review✅ Performance looks good:
📝 Additional ObservationsPositive:
Questions:
🎯 Final VerdictRecommendation: Approve with minor suggestions This is a solid implementation that solves a real UX problem. The issues I've identified are minor and mostly nice-to-haves. The code is:
Before merging:
Great work on this feature! 🎉 |
Summary
Problem
Highlighted glossary terms in practice questions show definitions via tooltips on desktop (hover), but on mobile there was no way to view definitions because touch devices don't have hover states.
Solution
Created a responsive
GlossaryTermTooltipwrapper component that:Tooltipwith existing hover behaviorPopoverwith tap-to-show, tap-away-to-dismiss behaviorTest plan
🤖 Generated with Claude Code