Skip to content

fix(swift-ios): keep caret after command completion - #8428

Open
mackinleysmith wants to merge 1 commit into
pingdotgg:t3code/rebuild-mobile-app-swiftfrom
mackinleysmith:t3code/fix-swiftui-composer-picker-cursor
Open

fix(swift-ios): keep caret after command completion#8428
mackinleysmith wants to merge 1 commit into
pingdotgg:t3code/rebuild-mobile-app-swiftfrom
mackinleysmith:t3code/fix-swiftui-composer-picker-cursor

Conversation

@mackinleysmith

@mackinleysmith mackinleysmith commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

What Changed

Selecting a skill or slash command in the SwiftUI composer could leave the caret at the old trigger endpoint. Continuing to type then inserted text inside the completed command.

The composer now computes the target offset from the original draft, publishes the replaced text, and only then sends the one-shot selection request.

Why

SwiftUI can update the UIKit representable between the two state writes. Publishing the selection request first allowed it to be applied and clamped against the shorter pre-replacement text, then marked as consumed.

UI Changes

No visual styling changed.

Before, completing $file as $file-pr could leave the caret after $file. After, the caret lands after the completed token and its trailing space.

Verified on a physical iPhone 14 Pro with T3 Swift Dev.

Verification

  • T3CodeTests/FeatureComposerPowerTests: 25 passed
  • Physical iPhone 14 Pro: skill and command completion keeps subsequent typing after the inserted token

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • No visual styling changed
  • The interaction change was verified on a physical device

Built with gpt-5.6-sol at xhigh reasoning effort in the T3 Code Codex harness.


Note

Cursor Bugbot is generating a summary for commit 39a4d5e. Configure here.

Note

Fix caret placement after command completion in FeatureComposerView

Reorders the trigger insertion handler in FeatureComposerView.swift to publish textSelectionRequest after updating the text. This prevents the cursor from being clamped against the pre-replacement draft content.

Macroscope summarized 39a4d5e.

@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

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: 6dae848a-6239-4719-afec-ad3d44228569

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

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

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Aug 27, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 39a4d5e

Macroscope's review found this PR approvable — This is a narrowly scoped Swift iOS bug fix that reorders two existing state updates so command completion places the caret after the inserted text. It changes no schemas, integrations, infrastructure, or sensitive code and has a limited component-level impact.

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

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

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant