Skip to content

Add tooltips to buttons and icons for better UX - #122

Merged
Ryan-Millard merged 15 commits into
Ryan-Millard:mainfrom
sarvesh0415:add-tooltips
Dec 21, 2025
Merged

Add tooltips to buttons and icons for better UX#122
Ryan-Millard merged 15 commits into
Ryan-Millard:mainfrom
sarvesh0415:add-tooltips

Conversation

@sarvesh0415

@sarvesh0415 sarvesh0415 commented Dec 16, 2025

Copy link
Copy Markdown
Contributor

Fixes #103

What’s changed

  • Added tooltips to buttons and icons that were not clear.
  • Tooltips show on hover (and focus where needed).

Why

  • Makes the UI easier to understand.
  • Helps users know what each action does.

Scope

  • Covered main interactive buttons and icons across the app.
  • Used simple and clear tooltip text.
Screenshot 2025-12-16 160051
  • Screenshot attached showing tooltip on hover.

Summary by CodeRabbit

  • New Features

    • Tooltips added across the app (nav, links, buttons, avatars, CTAs) for clearer hover/focus guidance.
    • Updated Home hero text for a more detailed description.
  • Documentation

    • Added comprehensive Tooltip component docs and testing guidance.
    • Updated docs navigation labels to remove emoji prefixes and added a React Components docs category.
  • Tests

    • Added unit tests for Tooltip behavior and a ResizeObserver mock in test setup.
  • Chores

    • Added react-tooltip dependency.

✏️ Tip: You can customize this high-level summary in your review settings.

@Ryan-Millard Ryan-Millard left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is nice. Please will you add it to more components and pages, though.

@sarvesh0415

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback!
Sure, I'll extend the tooltips to more components and pages and update this PR.

Repository owner deleted a comment from coderabbitai Bot Dec 17, 2025
@Ryan-Millard

Copy link
Copy Markdown
Owner

@CodeRabbit full review

@coderabbitai

coderabbitai Bot commented Dec 17, 2025

Copy link
Copy Markdown
Contributor
✅ Actions performed

Full review triggered.

@coderabbitai

coderabbitai Bot commented Dec 17, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Adds a new Tooltip component (wrapping react-tooltip), test coverage and docs, and applies tooltip wrappers across the UI (NavBar, pages, image processor, credits). Adds react-tooltip dependency and a ResizeObserver mock for tests.

Changes

Cohort / File(s) Summary
Tooltip component & tests
src/components/Tooltip.jsx, src/components/Tooltip.test.jsx
New Tooltip component (props: content, children, id, dynamicPositioning) implemented around react-tooltip; unit tests for visibility on hover/focus and hiding behavior.
Documentation
docs/docs/reference/react/components/Tooltip/index.md, docs/docs/reference/react/components/Tooltip/tests.md, docs/docs/reference/react/components/_category_.json
New docs for the Tooltip component and testing guidance; added docs category metadata for React components.
Global dependency & test setup
package.json, src/test/setup.js
Added react-tooltip@^5.30.0; added a global ResizeObserver mock in test setup.
Navigation & layout updates
src/components/NavBar.jsx, src/components/WasmImageProcessor.jsx
Wrapped nav items, logo, hamburger, upload UI, and action buttons with Tooltip wrappers; minor UI formatting and helper for dimension calc in image processor.
Home page copy & tooltips
src/pages/Home/index.jsx
Added tooltips to GlassCard headers and expanded Hero description text.
Credits pages
src/pages/Credits/ContributorsCreditsCard.jsx, src/pages/Credits/DependencyCreditsCard.jsx, src/pages/Credits/StaticCreditsCard.jsx
Wrapped avatars, usernames, dependency URLs, and external resource links with tooltips; DependencyCreditsCard refactored query creation (createQueries) and consolidated useQueries usage; external links gain rel="noopener noreferrer".
About pages
src/pages/About/Author.jsx, src/pages/About/CTA.jsx, src/pages/About/Motivation.jsx, src/pages/About/TechStack.jsx, src/pages/About/WhatIsThis.jsx
Replaced inline title attributes with Tooltip wrappers for GitHub/LinkedIn/project links; preserved navigation behavior.
Docs category labels
docs/docs/guidelines/_category_.json, docs/docs/project-scripts/_category_.json
Removed emoji prefixes from category label values.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Files span multiple pages but follow a consistent wrapping pattern.
  • Pay attention to:
    • Tooltip content consistency and wording across components.
    • Proper placement of data-tooltip-* attributes (especially for non-element children).
    • DependencyCreditsCard.jsx query refactor and loading/data extraction logic.
    • Tests and the added ResizeObserver mock for potential flakiness.

Poem

🐰 I nibble hints on every link,
I tuck small whispers where you blink;
Icons hum and buttons sing,
Little tips on every thing —
Hop, discover, gentle wink ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Out of Scope Changes check ❓ Inconclusive Minor out-of-scope changes detected: emoji removal from docs/category.json files and ResizeObserver mock addition are unrelated to tooltip functionality, though likely necessary infrastructure adjustments. Clarify whether emoji removals and ResizeObserver mock are intentional refactoring or if they should be separated into a dedicated PR for documentation/testing infrastructure improvements.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately summarizes the main change: adding tooltips to buttons and icons for improved UX, which is the primary focus across all modified components.
Linked Issues check ✅ Passed The PR fully addresses issue #103 requirements: tooltips added to non-self-explanatory buttons/icons across components, keyboard focus accessibility implemented via react-tooltip, comprehensive coverage of affected files, and includes test suite and documentation.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (3)
src/components/WasmImageProcessor.jsx (1)

183-183: Title attribute on hidden input is ineffective.

The title attribute on a hidden input provides no accessibility benefit since the element is not visible or focusable by users. Consider removing it.

-      <input ref={inputRef} id={inputId} type="file" accept="image/*" hidden title="Choose an image file to upload" onChange={handleSelect} />
+      <input ref={inputRef} id={inputId} type="file" accept="image/*" hidden onChange={handleSelect} />
src/pages/Home/index.jsx (1)

17-24: Consider whether titles on non-interactive cards add value.

These GlassCard components are informational (not interactive), and already have clear <h3> headings describing their purpose. The title attributes ("Performance feature", "Integration feature") will show generic tooltips on hover that don't provide additional information beyond the visible headings.

For accessibility, title is most useful on interactive elements where it clarifies an action. For purely informational cards, these titles may add tooltip noise without benefit.

src/components/NavBar.jsx (1)

39-39: Minor inconsistency in tooltip text.

Line 12 defines the Home link tooltip as "Go to the home page" (with "the"), but the logo link here uses "Go to home page" (without "the"). Consider aligning for consistency.

-        <Link to="/" title="Go to home page">Img2Num</Link>
+        <Link to="/" title="Go to the home page">Img2Num</Link>
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f5106cb and b398585.

📒 Files selected for processing (4)
  • src/components/NavBar.jsx (2 hunks)
  • src/components/WasmImageProcessor.jsx (4 hunks)
  • src/data/contributor-credits.json (1 hunks)
  • src/pages/Home/index.jsx (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/pages/Home/index.jsx (1)
src/components/GlassCard.jsx (1)
  • GlassCard (4-8)
🔇 Additional comments (7)
src/components/WasmImageProcessor.jsx (3)

138-140: Good tooltip additions for the empty state UI.

The titles on the Upload icon and "Choose File" span provide helpful context for users.


155-163: LGTM!

Clear tooltip explaining the button action.


172-180: LGTM!

The title on the GlassCard drop zone provides helpful context for the drag-and-drop interaction.

src/data/contributor-credits.json (1)

23-29: LGTM!

New contributor entry follows the established schema and JSON structure is valid.

src/components/NavBar.jsx (3)

12-15: Good approach to centralize tooltip definitions with links.

Clean pattern that keeps tooltip text co-located with link configuration.


42-42: LGTM!

Good addition of title alongside the existing aria-label — the aria-label serves screen readers while the title provides a visual tooltip for sighted users.


23-28: LGTM!

Tooltips are properly applied to both external and internal links, with a helpful additional tooltip on the external link icon indicating it opens in a new tab.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
src/pages/Home/index.jsx (1)

18-18: Reconsider using title attributes on large container elements.

Adding title attributes to GlassCard components creates native browser tooltips on entire card containers. This UX pattern is unusual because:

  1. Native title tooltips appear after a delay and only show on hover (not useful for touch/mobile)
  2. Tooltips on large containers can be confusing—users don't expect cards to have tooltips
  3. The PR objective mentions "tooltips to buttons and icons," but these are feature cards, not interactive controls

If these titles are meant to improve accessibility or provide metadata, consider alternative approaches like aria-label or visually hidden text. If tooltips are truly needed, they should target specific interactive elements within the cards.

💡 Consider removing the title attributes:
-        <GlassCard title="Performance feature">
+        <GlassCard>
           <h3>⚡ Fast & Lightweight</h3>
           <p>Compiled C++ runs in your browser via WebAssembly with near-native speed.</p>
         </GlassCard>
-        <GlassCard title="Integration feature">
+        <GlassCard>
           <h3>🛠️ Easy to Integrate</h3>
           <p>Minimal dependencies, works with any project or workflow.</p>
         </GlassCard>

Also applies to: 22-22

src/pages/Credits/ContributorsCreditsCard.jsx (1)

24-24: Consider using consistent tooltip text for both links.

Both the avatar and login links navigate to the same GitHub profile URL but use different verbs ("Open" vs "Visit"). Using consistent wording improves clarity.

💡 Apply this diff for consistency:
-                    <a href={c.html_url} target="_blank" rel="noopener noreferrer" title={`Open ${c.login}'s Github profile`}>
+                    <a href={c.html_url} target="_blank" rel="noopener noreferrer" title={`Visit ${c.login}'s GitHub profile`}>
                       <FallbackImage
                         src={c.avatar_url}
                         fallback={<User color={'var(--color-text-light)'} />}
                         alt={c.login}
                         width="28"
                         height="28"
                         style={{ borderRadius: '50%' }}
                       />
                     </a>
-                    <a href={c.html_url} target="_blank" rel="noopener noreferrer" title={`Visit ${c.login}'s Github profile`}>
+                    <a href={c.html_url} target="_blank" rel="noopener noreferrer" title={`Visit ${c.login}'s GitHub profile`}>
                       {c.login}
                     </a>

Note: Also corrected "Github" → "GitHub" (proper capitalization).

Also applies to: 36-36

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b398585 and d8af22e.

📒 Files selected for processing (4)
  • src/pages/Credits/ContributorsCreditsCard.jsx (2 hunks)
  • src/pages/Credits/DependencyCreditsCard.jsx (1 hunks)
  • src/pages/Credits/StaticCreditsCard.jsx (3 hunks)
  • src/pages/Home/index.jsx (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/pages/Home/index.jsx (2)
src/components/Hero.jsx (1)
  • Hero (4-9)
src/components/GlassCard.jsx (1)
  • GlassCard (4-8)
🪛 Biome (2.1.2)
src/pages/Credits/StaticCreditsCard.jsx

[error] 13-13: Avoid using target="_blank" without rel="noopener" or rel="noreferrer".

Opening external links in new tabs without rel="noopener" is a security risk. See the explanation for more details.
Safe fix: Add the rel="noopener" attribute.

(lint/security/noBlankTarget)


[error] 22-22: Avoid using target="_blank" without rel="noopener" or rel="noreferrer".

Opening external links in new tabs without rel="noopener" is a security risk. See the explanation for more details.
Safe fix: Add the rel="noopener" attribute.

(lint/security/noBlankTarget)


[error] 27-27: Avoid using target="_blank" without rel="noopener" or rel="noreferrer".

Opening external links in new tabs without rel="noopener" is a security risk. See the explanation for more details.
Safe fix: Add the rel="noopener" attribute.

(lint/security/noBlankTarget)


[error] 38-38: Avoid using target="_blank" without rel="noopener" or rel="noreferrer".

Opening external links in new tabs without rel="noopener" is a security risk. See the explanation for more details.
Safe fix: Add the rel="noopener" attribute.

(lint/security/noBlankTarget)


[error] 42-42: Avoid using target="_blank" without rel="noopener" or rel="noreferrer".

Opening external links in new tabs without rel="noopener" is a security risk. See the explanation for more details.
Safe fix: Add the rel="noopener" attribute.

(lint/security/noBlankTarget)


[error] 46-46: Avoid using target="_blank" without rel="noopener" or rel="noreferrer".

Opening external links in new tabs without rel="noopener" is a security risk. See the explanation for more details.
Safe fix: Add the rel="noopener" attribute.

(lint/security/noBlankTarget)

🔇 Additional comments (1)
src/pages/Credits/DependencyCreditsCard.jsx (1)

66-66: LGTM! Well-implemented tooltip with proper security attributes.

The title attribute provides clear context, and the link correctly includes rel="noopener noreferrer" for security.

Comment thread src/pages/Credits/StaticCreditsCard.jsx Outdated
Comment thread src/pages/Home/index.jsx Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/pages/About/Author.jsx (1)

13-21: LGTM! Tooltips successfully added.

The title attributes provide clear, descriptive tooltips that enhance UX by clarifying link destinations. The implementation is straightforward and meets the PR objectives.

Optional enhancement for future consideration:

While title attributes work well for mouse users, they have some accessibility limitations:

  • Not available to touch screen users
  • Inconsistent behavior with screen readers
  • May not appear on keyboard focus in all browsers

For stronger accessibility, consider using aria-label or a dedicated tooltip library (like react-tooltip) in future iterations. However, since the original issue #103 explicitly accepted title attributes as a valid approach, the current implementation is perfectly acceptable.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d8af22e and 8fb9b6b.

📒 Files selected for processing (1)
  • src/pages/About/Author.jsx (1 hunks)

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/pages/About/CTA.jsx (1)

9-9: Tooltip doesn't add meaningful value.

The title attribute repeats information already conveyed by the visible link text ("Launch Img2Num"). For accessibility, tooltips implemented via title attributes have limited support—they're not consistently announced by screen readers, unavailable on touch screens, and not fully keyboard-accessible.

Consider either removing the title attribute or providing genuinely additional context. For example, if you want to clarify what "Img2Num" means, you might use: title="Go to homepage and start converting images to color-by-number". Otherwise, omit the tooltip when the visible text is already clear.

Note: Based on the enriched summary, this pattern appears across multiple components in this PR. You may want to review all added tooltips to ensure they provide unique, helpful information rather than duplicating visible text.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8fb9b6b and 2b091c4.

📒 Files selected for processing (1)
  • src/pages/About/CTA.jsx (1 hunks)

@sarvesh0415

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback! I’ve added tooltips to more components and pages, and also fixed the external links by adding rel="noopener noreferrer". Please let me know if anything else needs changes.

@coderabbitai

coderabbitai Bot commented Dec 18, 2025

Copy link
Copy Markdown
Contributor

Note

Docstrings generation - SUCCESS
Generated docstrings for this pull request at #138

coderabbitai Bot added a commit that referenced this pull request Dec 18, 2025
Docstrings generation was requested by @Ryan-Millard.

* #122 (comment)

The following files were modified:

* `src/components/NavBar.jsx`
* `src/pages/Credits/ContributorsCreditsCard.jsx`
* `src/pages/Credits/DependencyCreditsCard.jsx`
* `src/pages/Credits/StaticCreditsCard.jsx`
@Ryan-Millard

Copy link
Copy Markdown
Owner

Thanks for the feedback! I’ve added tooltips to more components and pages, and also fixed the external links by adding rel="noopener noreferrer". Please let me know if anything else needs changes.

I'll be reviewing it soon. Thank you for your contribution!

@sarvesh0415

Copy link
Copy Markdown
Contributor Author

Thanks! Happy to make any changes if needed.

@Ryan-Millard Ryan-Millard left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very good and I'm happy with it!

There are just a few minor tweaks I'd like you to implement, which are addressed on individual files.

Additionally, although it isn't part of #103), please will you consider adding react-tooltip to this PR (as CodeRabbit mentioned) because it will handle cases we probably won't even think of (see below).

Image

I strongly recommend creating a reusable component for this as well as it will allow us to have a way to trigger errors when someone forgets to add something (like a title) as a prop. This will greatly help people (such as myself) who are more focused on creating a feature than a user-friendly interface at times.

That'll also beef up your contributions and the overall impact you have on this project - which will look nice on a CV when this repository grows.

Comment thread src/pages/About/Author.jsx Outdated
Comment thread src/pages/Home/index.jsx Outdated
Comment thread src/pages/About/CTA.jsx Outdated
@Ryan-Millard

Copy link
Copy Markdown
Owner

Thank you again for the great work you've done so far, @sarvesh0415!

@sarvesh0415

Copy link
Copy Markdown
Contributor Author

Hi Ryan 👋
I’ve addressed all requested changes across the Home, About, and CTA pages, removed the unused Hero prop, fixed the spacing issue, and added a reusable react-tooltip component.

Please let me know if anything else needs tweaking. Thanks again!

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (1)
src/pages/About/Author.jsx (1)

25-29: Address the past review comment regarding spacing.

The previous review comment from Ryan-Millard requested a specific format that removes the {' '} fragments and consolidates the line. The current implementation still includes these fragments and doesn't match the suggested format.

Additionally, there's an inconsistency in the tooltip approach: external links (GitHub, LinkedIn) use native title attributes, while this internal Link uses the Tooltip component. Consider standardizing on one approach—either use title attributes everywhere or use the Tooltip component consistently.

Apply the suggested format from the past review:
-      While I led this project, I had some help from others—see the{' '} 
-      <Tooltip content="View project credits">
-        <Link to="/credits">Credits page</Link>
-      </Tooltip>{' '}
-      for details.
+      While I led this project, I had some help from others—see the <Link to="/credits" title="View project credits">Credits page</Link> for details.

This approach:

  • Matches the format requested in the past review
  • Uses native title attribute consistent with the external links above
  • Simplifies the code by removing the Tooltip wrapper and {' '} fragments

Based on past review comments.

🧹 Nitpick comments (1)
src/components/Tooltip.jsx (1)

13-15: Consider potential styling and accessibility implications of the span wrapper.

The span wrapper is a common pattern for react-tooltip, but it may affect:

  • Layout/styling if children are inline elements or have specific display requirements
  • Accessibility tree structure
  • Event bubbling or propagation

This is likely fine for most use cases, but be aware of these potential edge cases when wrapping complex components.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b9f251d and 9764226.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • package.json (1 hunks)
  • src/components/Tooltip.jsx (1 hunks)
  • src/pages/About/Author.jsx (2 hunks)
  • src/pages/About/CTA.jsx (1 hunks)
  • src/pages/Home/index.jsx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • package.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/pages/About/CTA.jsx
  • src/pages/Home/index.jsx
🧰 Additional context used
🧬 Code graph analysis (1)
src/pages/About/Author.jsx (1)
src/components/Tooltip.jsx (1)
  • Tooltip (4-20)
🔇 Additional comments (4)
src/pages/About/Author.jsx (2)

4-4: LGTM!

The Tooltip import is correctly placed and follows the established import pattern in the file.


16-21: Good accessibility addition with title attributes.

The title attributes and rel="noopener noreferrer" on external links improve both accessibility and security.

src/components/Tooltip.jsx (2)

1-2: LGTM!

Imports are correctly structured and the react-tooltip library is properly imported.


22-26: LGTM!

PropTypes are correctly defined with appropriate types and required flags.

Comment thread src/components/Tooltip.jsx Outdated
Comment thread src/components/Tooltip.jsx Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
src/components/Tooltip.jsx (2)

22-26: Consider guarding against empty content strings.

The content prop is marked as required, but PropTypes allows empty strings. If content="" is passed, the tooltip will render but display nothing, which could confuse users.

🔎 Add a custom validator or runtime check:

Option 1: Custom PropTypes validator

 Tooltip.propTypes = {
-  content: PropTypes.string.isRequired,
+  content: function(props, propName, componentName) {
+    const value = props[propName];
+    if (!value || typeof value !== 'string') {
+      return new Error(
+        `Invalid prop \`${propName}\` supplied to \`${componentName}\`. Expected a non-empty string.`
+      );
+    }
+  },
   children: PropTypes.node.isRequired,
   id: PropTypes.string,
 };

Option 2: Runtime check (development only)

 export default function Tooltip({ content, children, id }) {
+  if (process.env.NODE_ENV !== 'production' && !content?.trim()) {
+    console.warn('Tooltip: content prop should not be empty');
+  }

   const reactId = useId();
   const tooltipId = id || `tooltip-${reactId}`;

1-20: Previous feedback addressed; consider performance optimization.

The component now correctly uses useId() for stable ID generation, addressing the previous issue with Math.random(). The runtime error throwing has also been removed. Great improvements!

However, creating a new ReactTooltip instance for each tooltip (line 17) is not optimal. The recommended pattern with react-tooltip v5 is to render a single <ReactTooltip /> at the app or page level, then reference it via data-tooltip-id from multiple elements. This reduces overhead when many tooltips exist.

🔎 Optional: Refactor for better performance with a global ReactTooltip

App-level approach (recommended):

  1. Remove <ReactTooltip id={tooltipId} /> from this component:
 export default function Tooltip({ content, children, id }) {
   const reactId = useId();
   const tooltipId = id || `tooltip-${reactId}`;

   return (
-    <>
       <span data-tooltip-id={tooltipId} data-tooltip-content={content}>
         {children}
       </span>
-
-      <ReactTooltip id={tooltipId} />
-    </>
   );
 }
  1. Then add a single <ReactTooltip /> in your root layout or App component (without an id prop—it will handle all tooltips):
import { ReactTooltip } from 'react-tooltip';

function App() {
  return (
    <div>
      {/* your app content */}
      <ReactTooltip />
    </div>
  );
}

This way, one tooltip instance serves all tooltip triggers across the app.


Minor: Remove unnecessary blank lines.

Lines 6 and 10 contain extra blank lines that can be removed for cleaner formatting.


Verify react-tooltip v5 API usage.

Please confirm the current pattern (one ReactTooltip per tooltip) works as expected in react-tooltip v5.30.0, especially for accessibility (keyboard focus, screen readers) and when multiple tooltips are rendered on the same page.

#!/bin/bash
# Verify react-tooltip v5 usage pattern and check for multiple ReactTooltip instances

# Find all usages of the Tooltip component
rg -n --type=tsx --type=jsx -C3 '<Tooltip'

# Find if a global ReactTooltip is already rendered elsewhere
rg -n --type=tsx --type=jsx '<ReactTooltip'
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9764226 and 17b09f2.

📒 Files selected for processing (1)
  • src/components/Tooltip.jsx (1 hunks)

@sarvesh0415

Copy link
Copy Markdown
Contributor Author

I’ve addressed the requested changes by adding a keyboard accessibility test for the Tooltip component.
All tests are passing locally now.

Please let me know if anything else is needed.

@Ryan-Millard

Ryan-Millard commented Dec 21, 2025

Copy link
Copy Markdown
Owner

I’ve addressed the requested changes by adding a keyboard accessibility test for the Tooltip component.
All tests are passing locally now.

Please let me know if anything else is needed.

Thank you very much! It looks great. I'll review it as soon as I can - hopefully before tomorrow.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
docs/docs/reference/react/components/Tooltip/index.md (1)

31-37: Add blank line before props table for proper markdown formatting.

Markdown best practices require blank lines around tables for consistent rendering across parsers.

🔎 Proposed fix
 
 ## Props
+
 | Prop                 |     Type | Required |   Default | Notes                                                                                                                                                                                                |
src/components/NavBar.jsx (1)

57-63: Consider aligning tooltip and aria-label text for consistency.

The tooltip says "Toggle navigation menu" while the aria-label says "Toggle menu". While both are clear, using identical text ensures consistency for users who rely on different assistive technologies.

🔎 Proposed alignment
-      <Tooltip content="Toggle navigation menu">
+      <Tooltip content="Toggle menu">
         <button className={styles.hamburger} onClick={() => setIsOpen(!isOpen)} aria-label="Toggle menu">

Or alternatively, expand the aria-label to match the tooltip.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7746058 and 4ae912f.

📒 Files selected for processing (9)
  • docs/docs/guidelines/_category_.json (1 hunks)
  • docs/docs/project-scripts/_category_.json (1 hunks)
  • docs/docs/reference/react/components/Tooltip/index.md (1 hunks)
  • docs/docs/reference/react/components/Tooltip/tests.md (1 hunks)
  • docs/docs/reference/react/components/_category_.json (1 hunks)
  • src/components/NavBar.jsx (1 hunks)
  • src/components/Tooltip.jsx (1 hunks)
  • src/components/Tooltip.test.jsx (1 hunks)
  • src/components/WasmImageProcessor.jsx (6 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/components/Tooltip.jsx
  • src/components/Tooltip.test.jsx
  • src/components/WasmImageProcessor.jsx
🧰 Additional context used
🧬 Code graph analysis (1)
src/components/NavBar.jsx (2)
src/pages/Editor/index.jsx (1)
  • useLocation (7-7)
src/components/Tooltip.jsx (1)
  • Tooltip (5-44)
🪛 Biome (2.1.2)
docs/docs/reference/react/components/_category_.json

[error] 9-10: Expected a property but instead found '}'.

Expected a property here.

(parse)

🪛 markdownlint-cli2 (0.18.1)
docs/docs/reference/react/components/Tooltip/index.md

32-32: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


37-37: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)

🔇 Additional comments (8)
docs/docs/guidelines/_category_.json (1)

2-2: LGTM! Emoji removal for consistency.

The label cleanup improves consistency across documentation categories.

docs/docs/project-scripts/_category_.json (1)

2-2: LGTM! Consistent label cleanup.

Aligns with the emoji removal pattern applied to other documentation categories.

docs/docs/reference/react/components/Tooltip/index.md (1)

1-127: Excellent documentation! Past feedback addressed.

The documentation now includes comprehensive coverage of:

  • Props table with types, requirements, defaults, and detailed usage notes
  • Implementation details explaining the wrapper approach, portal rendering, and ID generation
  • Multiple practical examples for different use cases
  • Accessibility guidance with good/bad pattern examples
  • Testing tips with code samples

This thoroughly addresses the previous review feedback requesting props explanation and implementation details.

docs/docs/reference/react/components/Tooltip/tests.md (1)

1-44: Comprehensive test documentation! Past feedback addressed.

The documentation now provides:

  • Clear overview of the test suite's purpose and scope
  • Detailed explanations of individual test cases and their assertions
  • Technical depth on common issues: portal timing, animations, jsdom environment, event ordering, double focus, strict mode warnings
  • Practical code examples for handling test flakiness
  • Clear testing recommendations for maintainability

This thoroughly addresses the previous review feedback requesting an overview and more technical depth.

src/components/NavBar.jsx (4)

13-16: LGTM! Clear and descriptive tooltip text.

The tooltip messages are concise and effectively communicate each link's purpose.


25-35: Excellent! Single tooltip approach addresses past feedback.

The external link now uses a single tooltip wrapping the entire anchor with a combined message that includes both the link purpose and the new-tab behavior. This resolves the previous concern about dual tooltips causing confusion.


37-41: LGTM! Clean internal link tooltip integration.

The Tooltip correctly wraps the Link component, allowing the tooltip attributes to attach directly to the focusable element.


52-54: LGTM! Clear logo tooltip.

The tooltip provides helpful context for the logo's navigation behavior.

Comment thread docs/docs/reference/react/components/_category_.json

@Ryan-Millard Ryan-Millard left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the great work you put in!

@Ryan-Millard
Ryan-Millard merged commit b3bded4 into Ryan-Millard:main Dec 21, 2025
2 checks passed
@sarvesh0415

Copy link
Copy Markdown
Contributor Author

Thank you so much for the review and for merging the PR!
I really appreciate the feedback and improvements you added.
Looking forward to contributing more in the future 🙌

@sarvesh0415

Copy link
Copy Markdown
Contributor Author

Hi @Ryan-Millard,

I noticed a small UX issue on the website: the tooltip for the “Fast & Lightweight” section appears to be clipped / partially hidden (possibly due to an overflow or z-index constraint).

Just wanted to flag this in case it helps — happy to look into it later if needed.
Screenshot 2025-12-22 205703

@Ryan-Millard

Copy link
Copy Markdown
Owner

Hi @Ryan-Millard,

I noticed a small UX issue on the website: the tooltip for the “Fast & Lightweight” section appears to be clipped / partially hidden (possibly due to an overflow or z-index constraint).

Just wanted to flag this in case it helps — happy to look into it later if needed.
Screenshot 2025-12-22 205703

Hi. Thanks for spotting that! Please will you open an issue for this. The correct issue template is the bug one.

I think the issue is about z-index, it may need to be applied to every tooltip.

@sarvesh0415

Copy link
Copy Markdown
Contributor Author

Sure, I’ll open a bug issue for this shortly. Thanks!

@Ryan-Millard

Copy link
Copy Markdown
Owner

Sure, I’ll open a bug issue for this shortly. Thanks!

Thank you! Have a good day!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add tooltips for buttons and icons

2 participants