diff --git a/frontend/src/components/shared/AllToolsNavButton.tsx b/frontend/src/components/shared/AllToolsNavButton.tsx index cd1824693..79fd36ae1 100644 --- a/frontend/src/components/shared/AllToolsNavButton.tsx +++ b/frontend/src/components/shared/AllToolsNavButton.tsx @@ -29,7 +29,8 @@ const AllToolsNavButton: React.FC = ({ activeButton, set ); return ( - + +
(({ {buttonConfigs.slice(0, -1).map((config, index) => ( - +
void; arrow?: boolean; @@ -23,6 +24,7 @@ export interface TooltipProps { logo?: React.ReactNode; }; delay?: number; + containerStyle?: React.CSSProperties; } export const Tooltip: React.FC = ({ @@ -32,13 +34,15 @@ export const Tooltip: React.FC = ({ tips, children, offset: gap = 8, - maxWidth = 280, + maxWidth, + minWidth, open: controlledOpen, onOpenChange, arrow = false, portalTarget, header, delay = 0, + containerStyle={}, }) => { const [internalOpen, setInternalOpen] = useState(false); const [isPinned, setIsPinned] = useState(false); @@ -135,8 +139,8 @@ export const Tooltip: React.FC = ({ ''; }; - // Only show tooltip when position is ready and correct - const shouldShowTooltip = open && (sidebarTooltip ? positionReady : true); + // Always mount when open so we can measure; hide until positioned to avoid flash + const shouldShowTooltip = open; const tooltipElement = shouldShowTooltip ? (
= ({ position: 'fixed', top: coords.top, left: coords.left, - maxWidth, + width: (maxWidth !== undefined ? maxWidth : '25rem'), + minWidth: minWidth, zIndex: 9999, - visibility: 'visible', - opacity: 1, + visibility: positionReady ? 'visible' : 'hidden', + opacity: positionReady ? 1 : 0, color: 'var(--text-primary)', + ...containerStyle, }} className={`${styles['tooltip-container']} ${isPinned ? styles.pinned : ''}`} onClick={handleTooltipClick} diff --git a/frontend/src/components/shared/quickAccessBar/TopToolIndicator.tsx b/frontend/src/components/shared/quickAccessBar/TopToolIndicator.tsx index bae269303..43f238498 100644 --- a/frontend/src/components/shared/quickAccessBar/TopToolIndicator.tsx +++ b/frontend/src/components/shared/quickAccessBar/TopToolIndicator.tsx @@ -68,7 +68,7 @@ const TopToolIndicator: React.FC = ({ activeButton, setAc {indicatorTool && (
- +