Repository navigation
Description
Three problems in the phone app, found while working on #3254 and #3338. Part of #1902. They are separate and can be fixed one at a time.
- 1. iOS: the soft keyboard doesn't turn with the phone while it is up
- 2. iOS: after a turn, the window's safe area is still the one from before it
- 3. The Capture form drops text of a replaced text field without a word
1. iOS: the soft keyboard doesn't turn
With winit's keyboard up, turning the phone turns the app and leaves the keyboard as it was, on its side. Seen on the iPhone 17 Simulator, where it was still so 32 seconds later. The window is 874 × 402 and the keyboard 233 × 402, at the right-hand end of it:
Steps, in the Simulator: give winit's view the keyboard (a test hook called becomeFirstResponder on it, which is what a focused egui text field leads to), then turn to landscape. A keyboard opened for #3338's text field with the phone already turned is right; winit's wasn't tried that way.
iOS's own text field (#3338) closes on a turn because of this. The fields the desktop interface draws still type through winit's keyboard.
Expected: the keyboard turns with the app, or is closed and can be opened again.
2. iOS: the safe area is stale after a turn
safe_area in apps/rustgis-mobile/src/ios.rs (the window's safeAreaInsets, read past the subclass fill_screen gives it) gives the same values in portrait and in landscape. Logged on the iPhone 17 Simulator:
| Window | Left | Top | Right | Bottom |
|---|---|---|---|---|
| 402 × 874 | 0 | 62 | 0 | 34 |
| 874 × 402 | 0 | 62 | 0 | 34 |
The app also started in landscape with the second row. The 62 points the camera takes should be at a side then. Ios::insets gives these to egui, so in landscape the interface should keep clear of the top and not of the camera. That consequence is read from the code; nobody has looked at it on a phone. #3338's bar works around it for itself.
Expected: the safe area of the window as it is now.
3. The Capture form drops a replaced field's text
Opening another text field closes the first only after the form has gone over to the new one. What was typed in the first since the last frame then comes as Typed::Text with the old field's id, and take_typed in crates/ui-touch/src/lib.rs passes over it (_ => {}): it isn't kept, and no notice says so, which breaks AGENTS.md's "Never silent". The Assistant's fields had the same and say it since #3254.
Found by reading; not reproduced on a device. On Android the shell hands over what is pending as the old field is dismissed (enterText in MainActivity.java). On iOS each change is told as it is made, so little or nothing is left to come late.
Expected: the text is kept in the field it was typed for, or a notice says it wasn't.
Version
f9434243f, built from source. 1 and 2: iOS Simulator (iPhone 17) on a GitHub macOS runner, debug build.

Activity