Skip to content

feat(ios): add experimental SwiftUI client - #5178

Open
t3dotgg wants to merge 267 commits into
mainfrom
t3code/rebuild-mobile-app-swift
Open

feat(ios): add experimental SwiftUI client#5178
t3dotgg wants to merge 267 commits into
mainfrom
t3code/rebuild-mobile-app-swift

Conversation

@t3dotgg

@t3dotgg t3dotgg commented Aug 1, 2026

Copy link
Copy Markdown
Member

T3 Code's shipped mobile client is React Native. This experiment adds a standalone native SwiftUI client so the team can try its feel, performance, and connection workflows without replacing any existing surface.

The app lives entirely in apps/swift-ios, speaks the existing server contracts directly, and installs side by side as T3 Code (SwiftUI) with bundle ID com.t3tools.t3code.swiftui.

Try it

  1. Open apps/swift-ios/T3Code.xcodeproj in Xcode.
  2. Select the T3Code scheme and an iOS 17+ simulator or device.
  3. Build and pair with an existing T3 Code server using its URL and code, pairing link, or QR code.

See apps/swift-ios/README.md for architecture, included functionality, and known gaps.

What to test

  • Pairing, onboarding, and multiple environments
  • Web V2 home behavior with large thread collections
  • Message-first thread creation and model selection
  • Long Markdown transcripts, composer states, approvals, and input requests
  • Image attachments, reconnect behavior, project tools, and terminal sessions

Preview

Home Thread
SwiftUI home with a large thread collection SwiftUI long Markdown thread

Verification

  • 245 native simulator tests passed, 0 failed, 1 skipped

  • Repeated A to B to C to A long-thread navigation verified against an isolated real-data snapshot

  • Latest build compiled, installed, and launched on an iPhone 17 Pro simulator

  • Signed latest build installed on Big O and DevPhone15; automatic launch deferred because both devices were locked

  • Remove DO NOT MERGE only after explicit maintainer approval

This PR was built by GPT-5.6-sol using the Codex harness in T3 Code.


Note

High Risk
Introduces a second mobile surface plus security-sensitive T3 Connect auth (Clerk, DPoP, relay tokens); contract or auth bugs would not be covered by React Native testing alone.

Overview
Adds a standalone native SwiftUI iOS app under apps/swift-ios that talks to T3 servers on its own (alongside the existing React Native app in apps/mobile), with separate bundle IDs and dev identities so both can install side by side.

The diff includes a full T3 Connect stack for SwiftUI—Clerk session handling, relay HTTP client, DPoP signing/keychain identity, and managed-environment token exchange/WebSocket ticket prep—wired through T3ConnectController and related cloud modules.

Contributor and agent docs now treat mobile as two clients: skills (test-t3-mobile, ios-debugger-agent, test-t3-app) and AGENTS.md spell out when to build React Native vs SwiftUI and warn against using one client to verify the other.

CI adds .github/workflows/swift-ios.yml to check generated Swift wire fixtures from contracts and run native tests via apps/swift-ios/Scripts/ci-test.sh on macOS runners.

Reviewed by Cursor Bugbot for commit b994054. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add experimental SwiftUI iOS client with chat, widgets, share extension, and platform integrations

  • Introduces a complete native SwiftUI iOS app (apps/swift-ios/) with a NativeFeatureClient-backed FeatureRootModel, root view, and entry point in T3CodeApp.swift
  • Core layer adds WebSocket RPC (WebSocketRPC.swift), HTTP transport (HTTP.swift), pairing (PairingService.swift), Keychain credential persistence (Persistence.swift), and typed wire models for environments, providers, usage, pull requests, and workspaces
  • Feature layer covers chat composer with Markdown rendering, voice input, image/file attachments, approvals, context compaction; workspace with home thread list, new-task creation, project creation, source control, files, review, pull requests; settings with connections, providers, and environment preferences; usage analytics and limits; device management; and terminal with Ghostty surface
  • Adds Share extension, Widget extension (Live Activity + Recent Tasks), T3 Connect cloud delivery (Clerk auth, DPoP, relay), deep links, notifications, background refresh, App Intents/shortcuts, and a CI workflow (swift-ios.yml)
  • Includes extensive test suites across core, feature, platform, and extension targets, plus a wire-fixture generator (generate-swift-wire-fixtures.ts)
  • Risk: this is a large greenfield addition; the install-device.sh script has a known bug in device-ID resolution that prevents it from reaching build/install/launch steps

Macroscope summarized d241033.

@coderabbitai

coderabbitai Bot commented Aug 1, 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: Team

Run ID: 355f5cdf-7ba6-4194-ae4f-03b732623002

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

Warning

Your free Security trial is over. An organization admin can upgrade to Advanced for continuous pull request security review or dismiss this notice.


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

@t3dotgg t3dotgg added DO NOT MERGE Experimental pull request. Do not merge. enhancement Requested improvement or new capability. size:XXL 1,000+ changed lines (additions + deletions). labels Aug 1, 2026
@github-actions github-actions Bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Aug 1, 2026
Comment thread apps/swift-ios/App/NativeFeatureClient.swift
Comment thread apps/swift-ios/Features/Workspace/DailyUXModels.swift
Comment thread apps/swift-ios/Features/Chat/FeatureComposerRequestViews.swift Outdated
Comment thread apps/swift-ios/Features/Workspace/DailyUXModels.swift Outdated
Comment thread apps/swift-ios/Core/JSONValue.swift
Comment thread apps/swift-ios/Features/Workspace/DailyUXModels.swift Outdated
Comment thread apps/swift-ios/Features/Connection/ConnectionOnboardingView.swift
Comment thread apps/swift-ios/App/NativeFeatureClient.swift Outdated
Comment thread apps/swift-ios/Core/T3Client.swift
Comment thread apps/swift-ios/App/NativeFeatureClient.swift
Comment thread apps/swift-ios/App/NativeFeatureClient.swift Outdated
@macroscopeapp

macroscopeapp Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR adds a complete SwiftUI iOS product surface with extensive networking, persistence, extensions, background behavior, product defaults, and Clerk/DPoP/Keychain authentication. Its size and security-sensitive runtime scope require human review before merge.

Not approved because:

  • Monthly spending limit reached (workspace setting). Approvability relies on correctness review in order to determine eligibility

Review your spending limits in Billing settings. You can add or adjust custom eligibility rules. Learn more.

@t3dotgg

t3dotgg commented Aug 1, 2026

Copy link
Copy Markdown
Member Author

Provider logo follow-up

Replaced the generic CPU and initial badges with the repository's official OpenAI, Claude, Cursor, Grok, and OpenCode SVG artwork. The same driver-keyed component now covers model rows, model configuration, settings/new-task controls, and the compact composer trigger. Unknown custom providers retain the initial fallback.

Before After
Model picker before, using initial badges Model picker after, using the official Claude logo

OpenAI and OpenCode rendering:

Official OpenAI and OpenCode marks in the SwiftUI model picker

Verification:

  • Focused model-picker tests: 8 passed, 0 failed
  • Simulator build and visual inspection passed
  • Signed build installed and launched on DevPhone15

Commit: 8792d15f5

@t3dotgg

t3dotgg commented Aug 1, 2026

Copy link
Copy Markdown
Member Author

Mobile interaction polish

This pass replaces the generic home-row sparkle with the resolved harness mark, keeps the latest transcript content visible when the software keyboard changes the viewport, makes keyboard dismissal immediate, constrains long thread headers, and reduces mobile prompt controls to model + reasoning in the composer and Automatic / Full access in the thread menu.

Previous home Harness-aware home
Previous SwiftUI home SwiftUI home with harness icons
Previous thread Keyboard-pinned composer
Previous SwiftUI thread SwiftUI thread pinned above the software keyboard

Verification:

  • 23 focused simulator tests passed, 0 failed
  • Simulator build, software-keyboard transition, menu contents, title constraints, and composer layout inspected
  • Signed 04ccb7a9c build installed and launched on DevPhone15

Commits: 5ab663449 through 04ccb7a9c

Comment thread apps/swift-ios/Features/Workspace/NewThreadView.swift Outdated
Comment thread apps/swift-ios/App/NativeFeatureClient.swift Outdated
Comment thread apps/swift-ios/Features/Workspace/HomeThreadCollectionView.swift
Comment thread apps/swift-ios/Features/Chat/ThreadDetailView.swift
Comment thread apps/swift-ios/Core/T3Client.swift
Comment thread apps/swift-ios/Features/Workspace/ProjectCreationModels.swift
Comment thread apps/swift-ios/App/NativeFeatureClient.swift
Comment thread apps/swift-ios/App/NativeFeatureClient.swift
Comment thread apps/swift-ios/Features/Workspace/ProjectAndArchiveViews.swift
Comment thread apps/swift-ios/App/NativeFeatureClient.swift Outdated
Comment thread apps/swift-ios/Features/Workspace/WorkspaceView.swift Outdated
Comment thread apps/swift-ios/App/NativeFeatureClient.swift
Comment thread apps/swift-ios/Core/T3Client.swift
Comment thread apps/swift-ios/App/NativeFeatureClient.swift
Comment thread apps/swift-ios/Features/Workspace/NewThreadView.swift
Comment thread apps/swift-ios/Features/Workspace/NewThreadView.swift
Comment thread apps/swift-ios/Features/Workspace/ProviderModelPicker.swift
Comment thread apps/swift-ios/Features/Workspace/ProviderModelPicker.swift
Comment thread apps/swift-ios/Features/Workspace/NewThreadView.swift
Comment thread apps/swift-ios/Features/Connection/ConnectionOnboardingView.swift Outdated
Comment thread apps/swift-ios/Features/Chat/FeatureComposerRequestViews.swift Outdated
Comment thread apps/swift-ios/Features/Connection/ConnectionDetails.swift Outdated
Comment thread apps/swift-ios/Features/Workspace/ProviderModelPicker.swift
Comment thread apps/swift-ios/Features/Files/FeatureFilesView.swift
Comment thread apps/swift-ios/Features/Files/FeatureFilesView.swift Outdated
Comment thread apps/swift-ios/Core/WebSocketRPC.swift
Comment thread apps/swift-ios/App/NativeFeatureClient.swift
Comment thread apps/swift-ios/App/NativeFeatureClient.swift
Comment thread apps/swift-ios/App/NativeFeatureClient.swift
Comment thread apps/swift-ios/Features/Root/FeatureRootModel.swift
Comment thread apps/swift-ios/App/NativeFeatureClient.swift Outdated
Comment thread apps/swift-ios/App/NativeFeatureClient.swift
Comment thread apps/swift-ios/Core/WebSocketRPC.swift
Comment thread apps/swift-ios/App/Platform/PlatformNotifications.swift Outdated
Comment thread apps/swift-ios/Features/Root/FeatureRootModel.swift
Comment thread apps/swift-ios/Features/Root/FeatureRootModel.swift
Comment thread apps/swift-ios/Resources/Info.plist Outdated
Comment thread apps/swift-ios/App/Cloud/T3ConnectManagedAuthorization.swift
Comment thread apps/swift-ios/Features/Settings/SettingsView.swift Outdated
Comment thread apps/swift-ios/App/Cloud/T3ConnectRelayClient.swift Outdated
Comment thread apps/swift-ios/Features/Settings/SettingsView.swift
Comment thread apps/swift-ios/App/Cloud/T3ConnectConfiguration.swift
Comment thread apps/swift-ios/Scripts/ci-test.sh
Comment thread apps/swift-ios/Core/T3Client.swift Outdated
Comment thread apps/swift-ios/App/NativeFeatureClient.swift
Comment thread apps/swift-ios/App/Cloud/T3ConnectManagedAuthorization.swift
Comment thread apps/swift-ios/App/Platform/PlatformDeepLinks.swift Outdated
Comment thread apps/swift-ios/Extensions/Share/SharePayloadLoader.swift
Comment thread apps/swift-ios/Extensions/Share/SharePayloadLoader.swift Outdated
Comment thread apps/swift-ios/App/Platform/PlatformCloudDelivery.swift Outdated
Comment thread apps/swift-ios/App/Platform/PlatformAgentAwareness.swift
Comment thread apps/swift-ios/Features/Root/FeatureRootModel.swift
Comment thread apps/swift-ios/App/Platform/PlatformAgentAwareness.swift
Comment thread apps/swift-ios/App/NativeFeatureClient.swift Outdated
Comment thread apps/swift-ios/Scripts/resolve-device-udid.swift Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

There are 48 total unresolved issues (including 47 from previous reviews).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 854c822. Configure here.

Comment thread scripts/swift-testflight.ts Outdated
config.issuerId,
],
{ stdio: "inherit" },
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upload omits required export path

High Severity

xcodebuild -exportArchive is invoked without -exportPath. That flag is required together with -archivePath and -exportOptionsPlist, including when export options use destination=upload. The upload command fails at launch, so the documented API-key TestFlight path cannot ship a build.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 854c822. Configure here.

@github-actions github-actions Bot removed the 📱 Native Change Changes the native fingerprint; merging blocks production OTAs until a new store build ships. label Sep 5, 2026
@github-actions github-actions Bot added the 📱 Native Change Changes the native fingerprint; merging blocks production OTAs until a new store build ships. label Sep 6, 2026
saphid and others added 7 commits September 6, 2026 15:33
Co-authored-by: Theo Browne <me@t3.gg>
Co-authored-by: Theo Browne <me@t3.gg>
…cker (#8621)

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Theo Browne <me@t3.gg>
@github-actions github-actions Bot removed the 📱 Native Change Changes the native fingerprint; merging blocks production OTAs until a new store build ships. label Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Requested improvement or new capability. size:XXL 1,000+ 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.

4 participants