Skip to content

fix: align tooltip-wrapped buttons with non-wrapped buttons - #1341

Merged
stevenle merged 1 commit into
mainfrom
claude/rootjs-issue-1340-rlguef
Jul 30, 2026
Merged

fix: align tooltip-wrapped buttons with non-wrapped buttons#1341
stevenle merged 1 commit into
mainfrom
claude/rootjs-issue-1340-rlguef

Conversation

@stevenle

@stevenle stevenle commented Jul 30, 2026

Copy link
Copy Markdown
Member

Summary

Fixes vertical alignment issues in the ActionLogs component where tooltip-wrapped buttons were misaligned with non-wrapped buttons. Mantine's <Tooltip> wrapper uses display: inline-block, which establishes a line box and adds extra vertical space. This caused buttons next to tooltips to sit at different heights.

Fixes #1340

Changes

  • New Tooltip component (packages/root-cms/ui/components/Tooltip/): A drop-in replacement for Mantine's <Tooltip> that wraps the child in a flex box instead of an inline-block div. This shrink-wraps the wrapper around its child without establishing a line box, keeping the layout neutral.

    • Tooltip.tsx: Component that applies the custom CSS class to Mantine's tooltip.
    • Tooltip.css: Sets display: inline-flex on the wrapper to override Mantine's inline-block.
  • Updated ActionLogs: Changed import from Mantine's Tooltip to the new custom Tooltip component.

  • Added visual test (ActionLogs.visual.test.tsx): Tests that verify buttons are vertically aligned both within a row and across multiple rows, ensuring the fix works correctly.

Implementation Details

The custom Tooltip component uses joinClassNames to apply the Tooltip class alongside Mantine's classes, ensuring the flex display rule wins over Mantine's inline-block without relying on stylesheet order. This maintains full compatibility with Mantine's tooltip API while fixing the alignment issue.

https://claude.ai/code/session_01RiTPcKxHMvqMR7vyy4VzSh

Mantine wraps a tooltip's child in an `inline-block` div, which establishes a
line box and ends up a few pixels taller than the child. In the action logs,
some quick links are tooltip-wrapped and some aren't, so the extra space
knocked adjacent buttons (e.g. "Open doc" and "Show changes") out of
alignment.

Adds a shared `<Tooltip>` wrapper that makes Mantine's wrapper element
shrink-wrap its child, and uses it in the action logs. This replaces the
ad-hoc `.mantine-Tooltip-root` display overrides that several components
already carry.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RiTPcKxHMvqMR7vyy4VzSh
@stevenle
stevenle merged commit 5aa77be into main Jul 30, 2026
1 check passed
@stevenle
stevenle deleted the claude/rootjs-issue-1340-rlguef branch July 30, 2026 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Action buttons misaligned on recent actions view

2 participants