fix(swift-ios): keep composer controls above keyboard #5829
Closedsaphid(GitHub profile, opens in a new tab)wants to merge 181 commits into
t3code/rebuild-mobile-app-swift fromrefs/pull/5829/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
- apps/swift-ios/Features/Chat/FeatureComposerView.swift lines 137 to 143Resolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -116,3 +133,10 @@116133 .task(id: pathSearchRequest) {117134 await updatePathSearch()118135 }136+ .onReceive(137+ NotificationCenter.default.publisher(138+ for: UIResponder.keyboardWillChangeFrameNotification139+ )140+ ) { notification in141+ updateSoftwareKeyboardState(from: notification)142+ }
- apps/swift-ios/Features/Chat/FeatureComposerView.swift line 515OutdatedResolvedby saphid(GitHub profile, opens in a new tab)@@ -448,0 +495,21 @@495+ dockedSoftwareKeyboardOccupiesScreen = false496+ return497+ }498+499+ dockedSoftwareKeyboardOccupiesScreen =500+ FeatureComposerKeyboardLayout.softwareKeyboardOccupiesScreen(501+ keyboardFrame: window.keyboardLayoutGuide.layoutFrame,502+ screenBounds: window.bounds,503+ isLocal: true504+ )505+ }506+507+ private func updateSoftwareKeyboardState(508+ from notification: Notification,509+ in window: UIWindow?510+ ) {511+ guard let window,512+ window.windowScene?.activationState == .foregroundActive,513+ let frame = notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey]514+ as? CGRect515+ else { return }
- apps/swift-ios/Features/Chat/FeatureComposerView.swift line 103Resolvedby saphid(GitHub profile, opens in a new tab)@@ -90,3 +94,17 @@9094 .padding(.horizontal, 12)9195 .padding(.top, 12)9296 .padding(.bottom, 10)97+ .background(alignment: .top) {98+ if usesAccessibilityKeyboardMetrics {99+ T3Colors.background100+ .frame(height: 52)101+ .offset(y: -52)102+ }103+ }104+ .offset(105+ y: FeatureComposerKeyboardLayout.verticalOffset(106+ dynamicTypeSize: dynamicTypeSize,107+ softwareKeyboardIsVisible: focused.wrappedValue108+ && dockedSoftwareKeyboardOccupiesScreen109+ )110+ )
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
saphid(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.




📝 Walkthrough
Walkthrough#
FeatureComposerViewnow tracks docked software keyboards and adapts composer sizing for keyboard visibility and accessibility Dynamic Type. New helpers classify keyboard frames and calculate line limits and offsets. Tests cover these layout rules.Changes#
Keyboard-aware composer
apps/swift-ios/Features/Chat/FeatureComposerView.swiftapps/swift-ios/Features/Chat/FeatureComposerView.swiftapps/swift-ios/Tests/FeatureTests/FeatureComposerPowerTests.swiftEstimated code review effort: 3 (Moderate) | ~20 minutes
Sequence Diagram(s)#
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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