layer5 icon indicating copy to clipboard operation
layer5 copied to clipboard

[UI]: Migrate react-tooltip usages to CustomTooltip from @sistent/sistent

Open Maanvi212006 opened this issue 6 months ago β€’ 6 comments

Description

Several files in the codebase currently use react-tooltip for tooltip functionality, while the project has standardized on CustomTooltip from @sistent/sistent as the preferred tooltip component. This inconsistency means different parts of the website render tooltips with different styles, behaviors, and dependencies.

Expected Behavior

All tooltip usage across the codebase should use CustomTooltip from @sistent/sistent, consistent with the design system and existing usage in the codebase.

Rather than doing a direct find-and-replace of react-tooltip with CustomTooltip across every file, the cleaner long-term solution is to introduce a shared internal Tooltip wrapper component inside :

src/components/Tooltip/index.js

All files across the repo would then import from this single wrapper:

import Tooltip from "../../components/Tooltip";

Why this approach:

  • Single source of truth β€” if @sistent/sistent ever updates CustomTooltip, only one file needs to change
  • Makes future migrations easier

Screenshots

NA

Environment:

  • Host OS:
  • Browser:

Contributor Resources and Handbook

The layer5.io website uses Gatsby, React, and GitHub Pages. Site content is found under the master branch.

Join the Layer5 Community by submitting your community member form.

Maanvi212006 avatar May 23 '26 20:05 Maanvi212006

@Katotodan can you pls review the approach? Thanks

Maanvi212006 avatar May 23 '26 20:05 Maanvi212006

Rather than doing a direct find-and-replace of react-tooltip with CustomTooltip across every file, the cleaner long-term solution is to introduce a shared internal Tooltip wrapper component inside :

src/components/Tooltip/index.js

All files across the repo would then import from this single wrapper:

import Tooltip from "../../components/Tooltip";

I don't think that we need another wrapper, but we could just use the CustomTooltip (from sistent) where needed and import it where needed. @Rajesh-Nagarajan-11 could have a thought on this.

Katotodan avatar May 25 '26 17:05 Katotodan

Alright, whatever fits the best @Rajesh-Nagarajan-11 gentle ping!

Maanvi212006 avatar May 27 '26 18:05 Maanvi212006

Hi @Katotodan @Rajesh-Nagarajan-11 What is the decided approach? I would like to start working on it Thanks!

Maanvi212006 avatar May 30 '26 19:05 Maanvi212006

@Katotodan @Rajesh-Nagarajan-11 I think using a shared tooltip wrapper could still be useful here.

Instead of replacing react-tooltip imports with direct CustomTooltip imports in every file, we can centralise the usage through one internal component.

This would give us a single place to handle any future @sistent/sistent API changes, fallback behaviour, or import-related issues without updating multiple files across the codebase.

That said, if the preferred project convention is to import CustomTooltip directly from @sistent/sistent wherever needed.

What do you think would be better for long-term maintainability?

KatalKavya96 avatar Jun 04 '26 17:06 KatalKavya96

Hi @Katotodan @Rajesh-Nagarajan-11 β€” just following up on this. Could you share your final call on the direction? Happy to start the implementation as soon as we have clarity. Thanks!

Maanvi212006 avatar Jun 06 '26 22:06 Maanvi212006