iOS: harden keyboard accessory toggles and sizing
Summary
- Make the toolbar keyboard button invert reducer-owned intent immediately and restore whichever input last owned typing, including the composer field during rapid interrupted hide/show transitions.
- Keep the accessory self-sizing as the composer grows, preserve the cached keyboard key-plane reservation until a new UIKit frame arrives, and use one transparent material backing across toolbar and composer.
- Harden HIDE, photo-picker dismissal, app re-entry, and surface reattachment so responder ownership and the keyboard-down dock seat converge without timers.
- Extend the workspace surface host through the bottom safe area and paint the dock accessory's home-indicator band with the terminal background: the accessory is a
UIInputView, so its system backdrop follows the OS appearance and left a white 34pt stripe under a dark dock on light-mode phones. - Drop pending keyboard-visibility intents that already match the system fact: a same-keyboard responder handoff (closing the composer while typing) posts no frame, so the stored intent could never be acknowledged and pinned the stale hide glyph through swipe-dismiss, re-summoning a dismissed keyboard on the next composer close.
- Revert the reload workflow's iOS
singlefilecompilation switch: the failures it chased were a 502 during setup and an x86_64 runner linking arm64-only GhosttyKit, and it broke-O wholemoduleparity withios/scripts/reload.sh.
Testing
swift test --package-path Packages/iOS/CmuxMobileTerminalKit --filter TerminalInputSessionReducerTests(16 tests)CmuxMobileTerminalTestson the CI iPhone simulator lane: 16 tests, 7 suites pass (2 responder-dependent contracts record known issues on CI runners, which reject text-input first-responder acquisition; the pre-existingGhosttyRuntimeActionTestsfailure is attributed againstmainin 31231536377)- Tagged
kbfx1sim build verified visually: home-indicator band renders terminal material in light system appearance (was a white stripe) - Localization audit: no user-facing strings added or changed
- iPhone build signed and queued for auto-install (device offline at build time)
Demo Video
- Video URL or attachment: pending tagged dogfood
Checklist
- I tested the change locally
- I added or updated tests for behavior changes
- I updated docs/changelog if needed (not needed; no user-facing copy or public docs changed)
- I requested bot reviews after my latest commit (not requested; explicit opt-in only)
- All code review bot comments are resolved
- All human review comments are resolved
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.
[!NOTE]
Medium Risk
Changes are concentrated in first-responder, keyboard-frame modeling, and terminal grid geometry—high user-impact UI paths with broad regression test coverage, but no auth or data-layer changes.
Overview
Hardens the iOS terminal keyboard dock so toolbar toggles, grid reservation, and bottom chrome stay aligned through interrupted UIKit transitions and composer growth.
The input session reducer adds toggleKeyboard(showOwner:) and keyboardResumeOwner, and GhosttySurfaceView routes the hide/show button through toggleSoftwareKeyboard() with pendingKeyboardVisibilityIntent so the glyph updates immediately while keyboard notifications still own geometry. Intents that already match the system fact are dropped so frameless composer handoffs do not pin a stale hide glyph or re-summon a dismissed keyboard.
Keyboard key-plane height is cached when a new tracked frame arrives (accessory height is not re-subtracted on later composer growth), and overlap tests expect key-plane-only grid reservation. The dock accessory self-sizes (intrinsicContentSize, invalidation on composer/safe-area changes), uses transparent toolbar/composer backing, and paints a terminal-themed safe-area band under the home indicator. WorkspaceDetailView extends the host with ignoresSafeArea(.container, edges: .bottom) so dock material is not clipped above the system fallback.
seatDockAtBottomIfPossible() re-seats the keyboard-down dock on app active, chrome show, picker dismiss, and after hide; queued Ghostty work passes surface handles as bit patterns for Sendable-safe async use. macOS reload CI runs install-rust-ci.sh so Rust sidecar builds do not depend on the runner image.
Reviewed by Cursor Bugbot for commit 8b37df78c744c959ddcb8cf58e53dc86b79648ae. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by cubic
Hardened the iOS keyboard dock so toggles update instantly and restore the right input owner, the grid reservation stays stable as the composer grows, and the dock’s material cleanly continues through the home indicator.
-
Bug Fixes
- Keyboard toggle flips immediately via reducer intent, restores the last typing owner (composer or terminal), drops intents that match the system fact so the glyph never sticks, and stays coherent under rapid taps.
- Cached key‑plane height decouples from accessory height so composer growth doesn’t shrink the terminal’s reservation before the next keyboard frame.
- Dock stays seated with the keyboard down on app re‑entry, chrome show, and after picker dismissal; the host underlaps the bottom safe area and the accessory paints its home‑indicator band with the terminal background; toolbar and composer share one transparent backing.
-
Refactors
- Reducer adds
toggleKeyboard(showOwner:)and trackskeyboardResumeOwner; a pending visibility bridge keeps the glyph coherent while notifications remain authoritative. - Accessory self-sizes via
intrinsicContentSize(including bottom insets) and invalidates on composer/safe‑area changes. - Queued Ghostty surface handles use bit patterns for Sendable-safe work across queues.
- CI/tests: macOS reloads provision Rust via
install-rust-ci.sh; mark responder‑dependent dock tests known‑intermittent on CI.
- Reducer adds