feat: add descriptive tooltips to StreakTracker stat cards#274
Conversation
|
@srinidhi-2006-bit is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Good idea — tooltips on stat cards help users understand the metrics. One fix needed: Remove the <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<circle cx="12" cy="12" r="10" />
<line x1="12" y1="16" x2="12" y2="12" />
<line x1="12" y1="8" x2="12.01" y2="8" />
</svg>Also fix the indentation on the new div (it's shifted relative to the surrounding code). Push once updated — will merge. |
|
Removed the Also fixed the indentation/alignment issue in the tooltip section and pushed the updated changes. Thank you for the review! |
Priyanshu-byte-coder
left a comment
There was a problem hiding this comment.
SVG inline approach is correct — heroicons dependency removed. One bug and one nit:
Bug: <button> with no onClick
The info icon (ⓘ) button has no click handler — it just shows a title tooltip on hover. A <button> with no action is semantically wrong and confusing for keyboard users (pressing Enter/Space does nothing). Change to a non-interactive element:
<span
aria-hidden="true"
title={stat.tooltip}
className="text-[var(--muted-foreground)] hover:text-[var(--accent)] cursor-help"
>
<svg .../>
</span>The tooltip text is already readable by screen readers via the parent div's aria-label.
Nit: indentation
The moved <div className="text-xl mb-1" ...\> is now at 10 spaces instead of 12 (same as surrounding elements). Align to match.
d2ca360 to
9f1d279
Compare
Priyanshu-byte-coder
left a comment
There was a problem hiding this comment.
1. <button> with no onClick is wrong semantic — if the element is decorative/tooltip-only, use <span> instead. A button that does nothing on click is an accessibility violation.
2. Duplicate tooltip — title={stat.tooltip} is already on the parent card div. Adding it again on the nested button causes inconsistent browser behavior. Remove it from the button.
3. Indentation regression — <div className="text-xl mb-1"> is outdented 2 spaces relative to its siblings. Fix to match surrounding code.
b0077c0 to
9f1d279
Compare
|
Updated all requested changes:
Also verified lint and type-check pass locally. Thanks for the review! |
7988637
into
Priyanshu-byte-coder:main
|
🎉 Merged! Thanks for contributing to DevTrack. If the project has been useful to you, a ⭐ star on the repo is the easiest way to support it — it helps DevTrack get discovered by more developers. Keep an eye on open issues for your next contribution! |
|
Thank you for merging the PR. I noticed that the gssoc:approved label is currently missing from the PR. Could you please add it so the contribution can be counted under GSSoC'26? Thank you! |
Summary
Added descriptive tooltips and accessible info indicators to StreakTracker stat cards to improve usability and accessibility for new users.
Closes #205
Type of Change
Changes Made
How to Test
Screenshots (if UI change)
N/A
Checklist
npm run lintpasses locallynpm run type-check)