feat(scraps): Add Tooltip.Header, Body, Row and Footer - #121983
Draft
ChrisandraVaz wants to merge 2 commits into
Draft
feat(scraps): Add Tooltip.Header, Body, Row and Footer#121983ChrisandraVaz wants to merge 2 commits into
ChrisandraVaz wants to merge 2 commits into
Conversation
Contributor
Story previewsPreview the stories changed in this PR on the Vercel deployment: Preview deployment: https://sentry-3mt5o1sus.sentry.dev |
Tooltip content that is a row of labelled values rather than a sentence currently has to fight the overlay: it hardcodes `padding: md lg` and `text-align: center`, so a card wanting full-width sections has to cancel both with negative margins. That pattern is already hand-rolled twice, in logsTimeTooltip and breadcrumbsTimeline, and RelativeTime was about to be the third. Adds a `padding` prop (defaulting to the current `md lg`, so no existing tooltip changes) and four sections that own their own spacing. `Tooltip.Body` owns the grid and `Tooltip.Row` renders as `display: contents`, so a column stays aligned across rows even when one row's cell is wider than the same cell above it. Also forwards `padding` through InfoText, which is the path TimeSince takes to the tooltip.
ChrisandraVaz
force-pushed
the
cv/scraps/tooltip-compound
branch
from
August 13, 2026 18:20
72282b6 to
93523fd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Splitting #121854 into three PRs based on the review feedback. This is the first one, and it only adds the tooltip primitives so the RelativeTime card has something to build on.
Right now
TooltipContenthardcodespadding: md lgandtext-align: center. That's fine for a sentence but wrong for a card, so anything card shaped has to cancel both by hand. We already do that in three places:logsTimeTooltip,breadcrumbsTimeline, andgroup.tsx. RelativeTime was about to be the fourth.paddingdefaults to today'smd lg, so nothing existing changes. Set it to"0"when you're composing sections.Tooltip.Header/Footertake a label plus an optionaltrailingvalue. Sentence case, no bottom border.Tooltip.Bodyowns the grid the rows line up against.Tooltip.Rowrenders asdisplay: contentsso its cells become items of the body's grid. That's what keeps columns aligned across rows when one cell is wider than the one above it.Also forwards
paddingthroughInfoText, since that's the pathTimeSincetakes to get to the tooltip. Primitives only here, nothing migrated yet.Stack
Bottom of a 3 PR stack:
1 and 2 don't touch each other so they can go in parallel. 3 needs both of them.
Test plan
tooltip.spec.tsxcovers the padding default, the opt out, the sections, and row alignment. Green.pnpm typecheck,lint:js, and 783 tests across 72 core suites. Green.tooltip.mdx.Open questions
EVENTSingroup.tsxis still uppercase. Migrating that is what would actually standardize things. Happy to do it here or in PR 3.Tooltip.Footerhas no consumer yet. The "Add your local timezone" link inlogsTimeTooltiplooks like a likely first one, but I can drop it until something needs it.HeaderandFooterare nearly identical, they only differ onboldvsvariant="muted". I left them separate because the design system guidance says two adjacent copies aren't worth abstracting, but say the word if you'd rather have one.