Skip to content

fix(mobile): iOS composer text stays vertically aligned at every text size - #17855

Open
akbarakma wants to merge 1 commit into
pingdotgg:mainfrom
akbarakma:fix/mobile-composer-text-centering
Open

akbarakma wants to merge 1 commit into
pingdotgg:mainfrom
akbarakma:fix/mobile-composer-text-centering

Conversation

@akbarakma

Copy link
Copy Markdown
Contributor

Problem

On iOS, the collapsed composer's text is not vertically aligned with its pill when Settings > Appearance > Text size is not the default. At 22pt the text hangs low, and at 11pt it rides high. The +, mic and send icons stay centered, so the text looks misplaced next to them.

Change

The collapsed editor is a fixed 36pt box with a fixed 6pt vertical inset, tuned for the default 16pt text. The text size setting scales the font and its line height, and iOS puts a line's spare height above the glyphs. So the letters move inside the box as the size changes, while the inset stayed at 6.

The inset now starts from the default 6pt and shifts by how far the lowercase midline moved at the current size, using DM Sans's descender and x-height. At the default size the shift is zero, so the default layout is unchanged. Android is untouched, since it already centers the single line natively.

Scope and approval

A very small, focused fix for an obvious visual bug: one helper and one prop in ThreadComposer.tsx, with no change at the default text size.

Verification

  • iOS 27.0 simulator (iPhone 17 Pro Max, debug build, showcase thread fixture). Text size set through the Appearance slider, fix toggled off and on with Fast Refresh, composer rows compared in 1320x2868 screenshots. Offsets are the middle of the lowercase letters against the pill's vertical center:
    • 22pt: from 7.7pt below center to 1.7pt below.
    • 11pt: from 2.2pt above center to 1.8pt below.
    • 16pt (default): the placeholder occupies the same pixel rows with the fix off and on. Typed text sits 2.3pt below center, which is the position the other sizes now match.
  • At 22pt the inset reaches 0. Neither the draft text nor the placeholder is clipped.
  • Sizes 12 to 21 were not captured. By the formula they land between 1.6pt and 2.4pt below center.
  • vp fmt --check on the file and vp run --filter @t3tools/mobile typecheck pass. vp lint on the file shows the same 7 warnings as main.
  • Built with Xcode 27.0, which needed the #if compiler(>=6.4) block in T3LayoutMetricsView.swift compiled out locally. That is not part of this PR.
  • Not checked: a physical device, iPad, Android (its code path is unchanged).

Before / after at 22pt:

Before:

image

After:

image

All three sizes. The dashed line is the pill's vertical center:

image

Built with Claude Opus 5.5 through Claude Code, running in T3 Code.

… size

The collapsed editor used a fixed 6pt vertical inset tuned for the default 16pt text. iOS puts a line's spare height above the glyphs, so the letters moved inside the 36pt box as the text size changed. Start from the default inset and shift it by how far the lowercase midline moved.
@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Oct 10, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 21776af

Macroscope's review found this PR approvable — This is a narrowly scoped iOS alignment fix that preserves the default 16pt layout and leaves expanded and Android composer behavior unchanged. Its small, isolated calculation has no broader product, schema, infrastructure, security, billing, or static-analysis impact.

Notes:

  • Diff unchanged. Approvability was decided on eligibility alone.

You can add or adjust custom eligibility rules. Learn more.

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Oct 10, 2026
@coderabbitai

coderabbitai Bot commented Oct 10, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 07bdc8df-150d-42fa-92d3-ebcb55912850

📥 Commits

Reviewing files that changed from the base of the PR and between a11f464 and 21776af.


📒 Files selected for processing (1)
  • apps/mobile/src/features/threads/ThreadComposer.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.



📝 Walkthrough

Walkthrough

ThreadComposer now calculates the collapsed iOS editor’s vertical inset from scaled body-text metrics. Expanded editors and Android layouts continue to use a zero inset.

Changes

Thread Composer Inset

Layer / File(s) Summary
Calculate and apply the collapsed editor inset
apps/mobile/src/features/threads/ThreadComposer.tsx
The composer calculates a rounded, non-negative inset relative to the base body text role. The collapsed iOS editor uses this value instead of a fixed 6-point inset. Expanded editors and Android layouts continue to use zero.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: juliusmarminge


Merge Risk: ⚪ Minimal · up to 21776

The collapsed iOS composer keeps text near the pill’s center across supported text sizes, with the default placement preserved. No merge-blocking issue is established.

Pre-merge checks | Passed 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: keeping iOS composer text vertically aligned across text sizes. It follows the repository’s conventional commit style.
Description check Passed The description includes the required Problem, Change, Scope and approval, and Verification sections. It explains the cause and fix, documents simulator results, screenshots, tests, warnings, and unve…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 11, 2026 — with ChatGPT Codex Connector
@macroscopeapp
macroscopeapp Bot dismissed their stale review October 11, 2026 06:27

Dismissing prior approval to re-evaluate 21776af

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants