The author name link was the only `leading_tight` fragment in the notification
text. It is also the paragraph's first fragment, and TextKit takes paragraph
line metrics from the paragraph's first character, so it set the line height for
the whole block: every line laid out at 17pt instead of the 20pt the
surrounding text asks for (measured 51px line spacing at @3x).
That also squeezed the inline badges. At 17pt the ascent budget is 13.4pt, less
than the 14pt badge box, so TextKit had to shift the attachment up to make it
fit and the box bottom no longer landed on the baseline. With snug leading the
ascent budget is 16.4pt and the box sits where `RCTTextLayoutManager` puts it,
which is what the cap-height sizing assumes.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pgeau3P52qsMTcnDeJm8Zn
The verification/bot/beta badges rendered inline after the author name in a
notification row ("liked by xyz") sat too high on iOS after the new
architecture switch.
The badges are a `View` nested inside a `<Text>`, so iOS lays them out as a
text attachment. The old architecture measured the attachment box with
`sizeThatFitsMinimumSize:` (which folds the inline view's margins into the box)
and positioned it at `lineFragmentBottom - boxHeight + font.descender`, so the
`marginBottom: -6` hack shifted the badges down. On the new architecture
`ParagraphShadowNode` measures the box with `LayoutableShadowNode::measure`,
which returns the node's own frame size with margins excluded, and then
overwrites the box origin with the frame `RCTTextLayoutManager` computed at
`lineTop + baseline - boxHeight`. Margins and `top` are both ignored, leaving
the badges pinned to the text baseline.
Box height is the only remaining lever, so add an `inlineFontSize` prop to
`ProfileBadges` that constrains the container to the cap height of the
surrounding text. The box then covers exactly the capital letters and the
existing `align_center` centers the badges on them, regardless of which badges
are visible or how tall they are.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pgeau3P52qsMTcnDeJm8Zn