Repository navigation
Fix iOS keyboard focus after photo picker - #9287
Merged
Merged
Conversation
📝 WalkthroughWalkthroughThe changes add a modal-preparation step before the composer's photo picker opens. ChangesComposer keyboard resignation before modal presentation
Estimated code review effort: 2 (Simple) | ~12 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant TerminalComposerView
participant GhosttySurfaceRepresentable
participant GhosttySurfaceView
User->>TerminalComposerView: Tap attach button
TerminalComposerView->>TerminalComposerView: presentPhotoPicker()
TerminalComposerView->>TerminalComposerView: Clear field focus
TerminalComposerView->>GhosttySurfaceRepresentable: prepareForModalPresentation()
GhosttySurfaceRepresentable->>GhosttySurfaceView: resignCurrentInput()
GhosttySurfaceView->>GhosttySurfaceView: Resign terminal proxy or composer container
TerminalComposerView->>User: Present photo picker
User->>TerminalComposerView: Cancel picker
User->>GhosttySurfaceView: Tap terminal
GhosttySurfaceView->>GhosttySurfaceView: Restore proxy responder and keyboard
Possibly related issues
🚥 Pre-merge checks | ✅ 4 | ❌ 21❌ Failed checks (1 warning, 20 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the workspace-detail terminal getting stuck with a hidden keyboard after cancelling the attachment photo picker.
The composer now releases both SwiftUI field focus and the terminal input proxy before presenting the system picker. Terminal, composer, and chrome dismissal share one responder-release path.
Regression coverage reproduces the exact sequence and asserts that the first terminal tap restores both proxy focus and the software keyboard.
Verification in progress:
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Fixes the iOS keyboard staying hidden after cancelling the photo picker. The composer now clears field focus and the surface releases its responder before presenting, so a terminal tap reliably brings the keyboard back.
CmuxMobileShellUI: Composer clears@FocusState, gates picker viapresentPhotoPicker(), and callsprepareForModalPresentationsoGhosttySurfaceRepresentablecan release the surface responder first.CmuxMobileTerminal: AddedresignCurrentInput()and routed existing paths through it to keep first-responder and keyboard state in sync.cmuxUITests: Regression test ensures a terminal tap re-opens the keyboard after cancelling the photo picker.Written for commit fa97d5f. Summary will update on new commits.
Summary by CodeRabbit
Bug Fixes
Tests