From 49486d2d3eacbb7d0aef1f4f6dc2530456ac251d Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Tue, 10 Nov 2026 04:39:21 +0200 Subject: [PATCH] Fix iOS thread number badge baseline after inline view patch (#12336) Co-authored-by: Claude Opus 5.5 --- .../components/ThreadItemPostNumber.tsx | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/screens/PostThread/components/ThreadItemPostNumber.tsx b/src/screens/PostThread/components/ThreadItemPostNumber.tsx index 667cb0708..9c320d4b6 100644 --- a/src/screens/PostThread/components/ThreadItemPostNumber.tsx +++ b/src/screens/PostThread/components/ThreadItemPostNumber.tsx @@ -24,6 +24,11 @@ const ANDROID_INLINE_OFFSETS = [ */ export const POST_NUMBER_INLINE_OFFSET = 14 +/** + * Descent of the iOS system font (SF Pro), as a fraction of the font size. + */ +const IOS_SYSTEM_FONT_DESCENT = 0.2412 + function getAndroidInlineOffset(fontScale: number) { return ANDROID_INLINE_OFFSETS.reduce((nearest, candidate) => Math.abs(candidate[0] - fontScale) < Math.abs(nearest[0] - fontScale) @@ -96,9 +101,20 @@ export function ThreadItemPostNumber({ }, ios: { /* - * For iOS, we just need to offset the padding we applied. + * Like Android, iOS puts the inline view's bottom on the + * text baseline (with our inline-view-baseline RN patch). + * Move it down by the padding plus the descent of the badge + * text so the two baselines line up. */ - transform: [{translateY: a.py_2xs.paddingBottom}], + transform: [ + { + translateY: + a.py_2xs.paddingBottom + + a.text_xs.fontSize * + nativeFontScale * + IOS_SYSTEM_FONT_DESCENT, + }, + ], }, web: { /* -- knotmirror 0.0.1