[DO NOT MERGE] feat(ios): add experimental SwiftUI client - #5178
[DO NOT MERGE] feat(ios): add experimental SwiftUI client#5178t3dotgg wants to merge 71 commits into
Conversation
| } label: { | ||
| Label("Cloud environments", systemImage: "cloud.slash") | ||
| } | ||
| } |
There was a problem hiding this comment.
T3 Connect UI never reachable
High Severity
Settings only opens T3ConnectView when model.client conforms to T3ConnectCapable, but NativeFeatureClient never adopts that protocol or implements connectT3Environment. The Cloud environments entry always stays on the unavailable path, so the new T3 Connect flow cannot be reached or tested.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 3dfa445. Configure here.
| case let .pair(endpoint, code): | ||
| didConnect = await model.pair(endpoint: endpoint, token: code) | ||
| case let .activate(id, _): | ||
| didConnect = await model.activateEnvironment(id) |
There was a problem hiding this comment.
Activate success skips connection check
Medium Severity
Onboarding now treats a non-throwing activateEnvironment as connected. That return value only means activation and snapshot install succeeded, while initialSnapshot can still leave connection.state as .disconnected when the server is unreachable. The previous check against the connected snapshot state is gone, so success and onConnected() can run without an active connection.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit d4bc68a. Configure here.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
There are 5 total unresolved issues (including 3 from previous reviews).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a5f4313. Configure here.
| return | ||
| } | ||
| presenter.present(picker, animated: true) | ||
| } |
There was a problem hiding this comment.
Photo library presentation race
Medium Severity
presentPhotoLibrary waits a fixed 0.35s then imperatively presents PHPickerViewController from the key window. If the confirmation dialog is still dismissing, UIKit can ignore present with no error handling or delegate cleanup, so Photo Library appears to do nothing and the retained delegate can leak. The delay is also long enough for navigation away before presentation, which can show the picker over the wrong screen.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit a5f4313. Configure here.
| } | ||
| onSelect(images) | ||
| FeaturePhotoLibraryPresenter.finish(picker) | ||
| } |
There was a problem hiding this comment.
Silent photo load failures
Medium Severity
Selected photo results load with try? and failed items are skipped. If every item fails, onSelect still receives an empty array and loadPhotoSelection returns without setting errorMessage, so the picker dismisses and the user gets no attachments and no error—unlike the Files and Camera paths.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit a5f4313. Configure here.


Caution
DO NOT MERGE. This is an experimental PR for teammate testing only.
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 IDcom.t3tools.t3code.swiftui.Try it
apps/swift-ios/T3Code.xcodeprojin Xcode.T3Codescheme and an iOS 17+ simulator or device.See
apps/swift-ios/README.mdfor architecture, included functionality, and known gaps.What to test
Preview
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 MERGEonly after explicit maintainer approvalThis PR was built by GPT-5.6-sol using the Codex harness in T3 Code.
Note
High Risk
New authentication, OAuth, DPoP token exchange, and Keychain-backed crypto on the critical path for cloud environment access; mistakes could leak credentials or break managed connections.
Overview
Adds the T3 Connect stack under
App/Cloud/so the SwiftUI client can sign in with T3 accounts and attach to relay-managed environments instead of only manual pairing.Clerk OAuth (
T3ConnectClerkSession) wraps ClerkKit for Google/GitHub sign-in, session refresh, and relay JWTs from a configurable template, witht3code://redirect handling.Relay HTTP client (
T3ConnectRelayClient) lists linked environments, fetches status, connects for bootstrap credentials, links/unlinks, and registers devices and Live Activities. Relay calls use DPoP access tokens from Clerk JWT token exchange, with caching and 401 retry.Device DPoP (
T3ConnectDPoPSigner) keeps a P-256 key in the Keychain and builds ES256 DPoP proofs for relay and environment requests.Managed environment auth (
T3ConnectManagedEnvironmentAuthorizer,T3ConnectRuntimeAuthorization) exchanges bootstrap credentials for environment DPoP tokens, authorizes HTTP with per-request proofs, issues WebSocket tickets, and coalesces credential refresh viaManagedEnvironmentAuthorizing.Orchestration (
T3ConnectController) drives account state, environment list refresh with parallel status, connect/credential flows, sign-out with best-effort device unregister, and postst3ConnectSessionChanged. Configuration is resolved from Info.plist with HTTPS relay URL validation.Also adds Swift/iOS
.gitignoreentries for DerivedData and xcuserdata.Reviewed by Cursor Bugbot for commit a5f4313. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add experimental SwiftUI iOS client with widgets, share extension, and cloud relay support
apps/swift-ios) including a workspace/thread browser, chat composer with Markdown rendering, file browser, terminal, source control, and review screensWebSocketRPCClient) with reconnection, request coalescing, deadlines, and permessage-deflate supportMacroscope summarized f1df601.