fix: bake standard tooltip styling into TooltipContent component

Added font-mono tabular-nums text-stat-value directly to the
TooltipContent base styles so every tooltip in the app inherits
the same look without per-instance wrappers. Removed the now-
redundant span from StackRow's RowTooltip.
This commit is contained in:
SaelixCode
2026-07-03 15:22:36 -04:00
parent f83f01417c
commit ef85f57cf2
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ function RowTooltip({ trigger, label }: { trigger: ReactNode; label: string }) {
<Tooltip>
<TooltipTrigger asChild>{trigger}</TooltipTrigger>
<TooltipContent side="bottom" sideOffset={4} align="center">
<span className="font-mono text-xs tabular-nums text-stat-value">{label}</span>
{label}
</TooltipContent>
</Tooltip>
</TooltipProvider>
@@ -43,7 +43,7 @@ describe('StackRow', () => {
});
it('wraps the partial pill in a hover tooltip', () => {
const { container } = render(<StackRow {...base({ status: 'partial', running: 3, total: 5 })} />);
render(<StackRow {...base({ status: 'partial', running: 3, total: 5 })} />);
const trigger = screen.getByText('PT');
// Radix TooltipTrigger adds data-state to the wrapped element.
expect(trigger.getAttribute('data-state')).toBe('closed');
+1 -1
View File
@@ -19,7 +19,7 @@ const TooltipContent = React.forwardRef<
ref={ref}
sideOffset={sideOffset}
className={cn(
'z-50 overflow-hidden rounded-md border border-glass-border bg-popover px-3 py-1.5 text-xs text-popover-foreground backdrop-blur-[10px] backdrop-saturate-[1.15]',
'z-50 overflow-hidden rounded-md border border-glass-border bg-popover px-3 py-1.5 font-mono text-xs tabular-nums text-stat-value backdrop-blur-[10px] backdrop-saturate-[1.15]',
'origin-[--radix-tooltip-content-transform-origin]',
'animate-in fade-in-0 zoom-in-95 duration-150',
'data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95',