Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(swift-ios): let the composer grow without a line cap #5801

Closedsaphid(GitHub profile, opens in a new tab)wants to merge 1 commit intot3code/rebuild-mobile-app-swift fromrefs/pull/5801/headopened View on GitHub

What Changed

Allow the existing vertical SwiftUI composer TextField to use its ideal wrapped height without a numeric line cap.

The field still starts at one line. A small view modifier keeps the layout behavior explicit, and integration-style tests host the production composer input in a UIHostingController: a 30-line prompt is substantially taller than a 3-line prompt when space is available, while a 100-line prompt yields to a 500-point viewport and remains scrollable.

Why

The composer had two independent constraints: its parent could compress it, and .lineLimit(1...7) forced it to stop growing after seven lines. The earlier PR version fixed only the parent compression, so longer prompts still stopped expanding. This revision removes that remaining cap.

Scope

  • apps/swift-ios/Features/Chat/FeatureComposerView.swift
  • apps/swift-ios/Tests/FeatureTests/FeatureComposerPowerTests.swift
  • no keyboard-clearance, protocol, signing, release, React Native, or bridge changes
  • rebased on t3code/rebuild-mobile-app-swift at 497f54f3e67acf1d2562d22d60eddd70aefc9627

Verification

  • Focused native suite: FeatureComposerPowerTests — 9 passed
  • Required native CI: apps/swift-ios/Scripts/ci-test.sh — 220 tests in 27 suites passed
  • Layout regression: production composer input, 3 lines versus 30 lines — passed; the long value exceeded the short value by more than 400 points
  • Viewport regression: production composer input, 100 lines inside a 500-point proposal — passed; height stayed at or below the viewport
  • Integrated simulator: New Thread accepted a 1,561-character draft, kept attachment/model/Send controls visible, and scrolled from the end back to the first line
  • Personal approved-branch integration: corresponding UIKit adapter regression suite — 15 passed
  • Independent Claude Opus 5 review was attempted, but the CLI exited 1 because the account had reached its weekly limit; no cross-provider review result is claimed

UI Changes

The existing screenshots and interaction recording below demonstrate the compact and growing states. They were captured for the preceding revision, which grew through seven lines; the new 30-line production-view test is the proof that this revision no longer stops there.

New thread — compact

New thread composer at compact empty height

New thread — expanded

New thread composer expanded with wrapped text

Existing thread — compact

Existing thread composer at compact empty height

Existing thread — expanded

Existing thread composer expanded for a long draft

Accessibility XXXL

Existing thread composer at Accessibility XXXL

Interaction video — composer growth

Animated preview of the SwiftUI composer growing with wrapped text

Open the MP4

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for the affected UI
  • I included a video for the interaction change

Built with GPT-5.6 Sol in the Codex harness.


Note

Low Risk Localized SwiftUI composer layout change with no auth, data, or API impact; regression risk is mainly chat input sizing on device.

Overview The chat composer TextField no longer stops growing after seven lines. Inline .lineLimit(1...7) is replaced by a FeatureComposerGrowingTextInput modifier that keeps a one-line minimum, uses an unbounded upper line limit (.lineLimit(1...)), and sets layoutPriority(1) so the field can take its ideal height instead of being compressed by siblings.

FeatureComposerPowerTests adds UIHostingController layout checks: a 30-line draft is much taller than a 3-line one when space allows, and a 100-line draft respects a bounded viewport height (scrollable behavior).

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 1b333c67a375643a4286ec3dbd1b06e8fa4844ad. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Remove 7-line cap on the iOS chat composer text input

Replaces .lineLimit(1...7) on the composer TextField with a new FeatureComposerGrowingTextInput view modifier that applies .lineLimit(1...) (unbounded) and .layoutPriority(1), allowing the input to grow with content up to the container's height. Two new tests in FeatureComposerPowerTests.swift verify that the input grows beyond three lines and respects the viewport height.

Macroscope summarized 1b333c6.
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: 67b37413-4097-487e-a79a-a87e0e70145f

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved 1b333c6

      Minor UI tweak removing a 7-line cap on the composer text input, allowing unlimited growth. Self-contained change with unit tests verifying the behavior.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. @t3dotgg This SwiftUI PR is ready for your review. Its exact head is mergeable; repository/native CI, MacroScope, Cursor, and review-thread audits are clean with zero unresolved threads. The only red status is the unrelated Vercel marketing authorization check.

    5. saphid(GitHub profile, opens in a new tab) changed the title

    6. Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

      Fix All in Cursor ❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot). Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 3faa42759f57c1f6d5fd47728540a8ef329be581. Configure [here](https://www.cursor.com/dashboard/bugbot).
    7. Closing as superseded by the richer final editor in #5610, now verified on its exact current mergeable head aed38c3b0. The desired feature outcome is preserved and extended: content is unlimited, visible height grows beyond three lines, caps at 50% of the viewport, scrolls internally with the caret visible, and keeps attachment/model/send controls reachable above the keyboard.

      Acceptance evidence: 237 native tests green, including explicit >3-line and unlimited-content/bounded-height tests, plus integrated New Task video: https://alexs-macbook-pro-1.tail4e5636.ts.net:8766/swiftui-final-editor-growth-keyboard-proof-20260810.mp4

      Landing this older implementation as well would duplicate composer sizing ownership. No useful feature is being discarded.

Sign in to join this conversation.