Repository navigation
Stop the iOS keyboard test seam renegotiating a Mac-constrained grid - #13932
Conversation
`setKeyboardHeightForTesting` ended with `syncSurfaceGeometry(shouldReassertNaturalSize: true)`, written when the keyboard was still a grid input. #10616 removed the stretch-to-fill auto-fit and took the keyboard out of the grid container, so the production keyboard leg (`GhosttySurfaceHostView.beginKeyboardLeg` -> `setHostedKeyboardState`) now seats the dock and schedules no geometry negotiation at all. The seam kept its `set_size`. That pass is a no-op resize — `TerminalViewportCoordinator` does not read the keyboard — except for the reassert, which re-reports capacity whenever the effective grid sits below natural. That is exactly a Mac-constrained terminal, so "mac-constrained rows letterbox at base font; keyboard toggles change nothing" saw one viewport report per toggle (1 -> 2 -> 3) that no real keyboard produces. The unconstrained sibling passed because there the effective grid equals natural and the reassert branch never fires. The same test also captured its settled snapshot too early: the letterbox pump accepted the grant (`effectiveGrid`, set synchronously by `applyConfirmedViewSize`) while the render was still full height, so the asynchronous shrink landed during the keyboard phase and read as the keyboard moving the render. The pump now waits for the render to reach the pin, and the test asserts the letterbox positively: the top slack is the 12 rows the Mac withheld, and the separator border is visible. No assertion was relaxed, deleted, or dropped; the keyboard-toggle phase is unchanged and the test now asserts strictly more. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
|
Warning Review limit reachedNext included review available in 27 minutes. View limit detailsLimit details: You’ve used all 10 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository: manaflow-ai/cmux/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
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 |
|
All contributors have signed the CLA ✍️ ✅ |
|
Independent review. I checked the load-bearing claim rather than accepting it, and it holds — with one gap and one point in the PR's favour that the description does not make. The production path really does not negotiate geometry on a keyboard leg. The asymmetry argument is also right where it matters:
The other four call sites argue for this change, and the PR should say so. The seam has three consumers, not one:
Gap: this does not fix the other failure on This PR's diff is two hunks — Verification scope. The dispatch on this branch (run 35829281069) filters Holding merge until 35829281069 reports. — Zarathustra g1 🌱 |
41f6862 ci: integrate canonical app-host compilation paths (manaflow-ai#13854) 165b05c ci: run the CmuxMobileShell package tests serially (manaflow-ai#13935) ca53e05 test: repair the renderer gate and tmux mirror sizing fixtures (manaflow-ai#13873) a1029b2 test(ios): stop the keyboard test seam renegotiating the grid (manaflow-ai#13932) 587f661 ci: namespace the compat cache and guard perf-activation's restore (manaflow-ai#13933) # Conflicts: # .github/workflows/ci-macos-compat.yml # .github/workflows/ci-macos.yml # .github/workflows/nightly.yml # .github/workflows/perf-activation.yml # .github/workflows/test-ios.yml
On a Mac-constrained terminal, every keyboard show/hide in the iOS test
harness emitted a viewport capacity report to the daemon and moved the
render rect.
TerminalViewportSpacingTests"mac-constrained rowsletterbox at base font; keyboard toggles change nothing" failed on four
assertions in run 35827250480:
reports went 1 → 2 → 3, one per toggle.
The assertion is right and stays. The keyboard is not a grid input, and
the product honours that:
GhosttySurfaceHostView.beginKeyboardLegcallssetHostedKeyboardState, which seats the dock and explicitly schedulesno geometry negotiation, and
TerminalViewportCoordinatornever readsthe keyboard when it computes the grid container. What was stale is the
DEBUG test seam.
The seam
GhosttySurfaceView.setKeyboardHeightForTestingended withsyncSurfaceGeometry(shouldReassertNaturalSize: true). That line datesfrom when the keyboard was a grid input; #10616 (
15d8701035) removedthe stretch-to-fill auto-fit and took the keyboard out of the grid
container, and the production keyboard path dropped its geometry pass.
The seam kept it.
The resize itself is a no-op — the container size does not change with
the keyboard — but the reassert is not. In
applyGeometryResult:effectiveMatchesNaturalis false for exactly one state: a grant belowthe phone's capacity, i.e. a Mac-constrained terminal. So the seam
re-reported capacity on every toggle there, and only there. That is why
the unconstrained sibling, "keyboard toggle emits no report and leaves
grid and render untouched", passes on the same seam: its effective grid
equals natural, so the reassert branch never fires.
Removing the call makes the seam drive what a real keyboard leg drives.
The reassert itself is untouched: it remains the self-heal that re-tells
a Mac its phone's capacity when the grant sits below it, on the real
geometry triggers (bounds change, safe-area change, zoom settle, attach).
The settled snapshot
The same test also captured
settledtoo early. Its letterbox pumpaccepted the grant —
effectiveGrid, whichapplyConfirmedViewSizesets synchronously — while the render was still full height, so the
asynchronous shrink to the pinned rows landed during the keyboard phase
and read as the keyboard moving the render.
The pump now waits for the render to reach the pin (through the
renderMatchesPinhelper already in the file), and the test asserts theletterbox positively rather than inferring it: the top slack is the 12
rows the Mac withheld (12 cells plus the sub-cell remainder the natural
grid floors away), and the separator border is visible. No assertion was
relaxed, deleted, or dropped, and the keyboard-toggle phase is byte for
byte unchanged — the test asserts strictly more than before.
Validation
test-ios.ymldispatch on this branch, filtercmuxFeatureTests/TerminalViewportSpacingTests, iPhone only:run 35829281069
passed —
Test run with 7 tests in 1 suite passed, including"mac-constrained rows letterbox at base font; keyboard toggles change
nothing" and the unconstrained sibling that already passed.
The control dispatch on
mainwith the same filter,run 35828536622,
reproduces the same four issues, so the failure is not introduced here.
The iOS lane is dispatch-only, so PR CI runs no iOS job here.
Two other suites drive the same seam and were NOT executed by this
filter:
TerminalKeyboardFullHeightPinTestsandTerminalArtifactChipKeyboardTests. Both also assert that a keyboardseat emits no report, and both assert dock/chip/render placement, none of
which consumes the keyboard through the grid container — so dropping a
keyboard-independent resize cannot move them. That is reasoning, not a
run.
— Zarathustra g1 🌱
Run: run_cmux_mainred_triage_20260923_c6
🤖 Generated with Claude Code