Skip to content

fix(ios): confirm keyboard absence before settle diff - #5426

Open
diadiushko wants to merge 1 commit into
callstack:mainfrom
diadiushko:fix/5417-keyboard-settle-diff
Open

diadiushko wants to merge 1 commit into
callstack:mainfrom
diadiushko:fix/5417-keyboard-settle-diff

Conversation

@diadiushko

@diadiushko diadiushko commented Dec 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

On iOS, confirm keyboard disappearance for 1.5 seconds before a settled diff reports it. A capture can temporarily omit the keyboard window while the keyboard stays visible. Keyboard appearance and ordinary fills keep the normal settle window. Fixes #5417.

Before / after

With a keyboard visible before fill --settle and omitted from post-action captures until 900 ms:

  • Before: the loop settled at 502 ms on the incomplete tree and could report - [keyboard].
  • After: it waits through the omission, then returns a capture with the keyboard; the diff has no keyboard or prediction-bar removal.
  • A sustained keyboard disappearance still settles after at least 1.5 s.

Validation

Tested 050185bc5cc143faa4bd3ae601a3789ae5dfb634. New regression tests failed before the fix; focused tests passed (39/39). pnpm check:affected --run --head 050185bc5cc143faa4bd3ae601a3789ae5dfb634 passed with exactCommit=true in a no-space checkout on Node 26: format, lint, typecheck, layering, fallow, build, related Vitest, and unit (22,905 passed; 105 skipped).

On an isolated iPhone 17 simulator (iOS 26.5), repeated Contacts fills kept the keyboard visible without a false removal; discarding the contact hid it. iOS 27.2, where the report reproduces, is unavailable here. The simulator and session were removed. Cold self-review completed; CI and independent review are pending.


Show it working
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

View guided diff

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 3 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/command-runtime/src/commands/interaction/runtime/stable-capture.ts">

<violation number="1" location="packages/command-runtime/src/commands/interaction/runtime/stable-capture.ts:427">
P2: `hadKeyboard` only recognizes a `type: Keyboard` node, while the settle chrome classifier also recognizes role-only iOS keyboard surfaces. Include those role-based shapes here so their disappearance receives the 1.5-second confirmation window too.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

platform: AgentDeviceRuntime['backend']['platform'];
}): StableCaptureConfirmation {
const hadKeyboard = params.baseline?.nodes.some(
(node) => normalizeType(node.type ?? '') === 'keyboard',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: hadKeyboard only recognizes a type: Keyboard node, while the settle chrome classifier also recognizes role-only iOS keyboard surfaces. Include those role-based shapes here so their disappearance receives the 1.5-second confirmation window too.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At packages/command-runtime/src/commands/interaction/runtime/stable-capture.ts, line 427:

<comment>`hadKeyboard` only recognizes a `type: Keyboard` node, while the settle chrome classifier also recognizes role-only iOS keyboard surfaces. Include those role-based shapes here so their disappearance receives the 1.5-second confirmation window too.</comment>

<file context>
@@ -407,6 +419,28 @@ function broadTransitionConfirmation(params: {
+  platform: AgentDeviceRuntime['backend']['platform'];
+}): StableCaptureConfirmation {
+  const hadKeyboard = params.baseline?.nodes.some(
+    (node) => normalizeType(node.type ?? '') === 'keyboard',
+  );
+  return {
</file context>

@thymikee

thymikee commented Dec 6, 2026

Copy link
Copy Markdown
Member

Thanks for the fix.

The change at 050185b needs live evidence before merge. This is a device-facing settle and capture change, and the only live run was on iOS 26.5, where the author says the omission does not occur. No run shows the fix on a build that reproduces #5417 (iOS 27.2 simulator, simulator-ax-bridge producer). The 1.5 s window in stable-capture.ts is also not measured against how long the real capture omits the keyboard. The tests use a fake that returns the keyboard at 900 ms or never, and the issue's one correct run settled at 1540 ms, so the real omission length is unknown. If it outlasts 1500 ms, the fix does not work on the reported route. Please run the issue's Contacts loop (open com.apple.MobileAddressBook, press 'label=Add' --settle, then 8x fill 'label="First name" editable=true' NameN --settle) on an iOS 27.x simulator, base against head. Record the count of - [keyboard] and - [scroll-area] lines and each settled after Nms. Also record one real dismissal, such as Return or discarding the sheet, that still reports - [keyboard] and settles at 1500 ms or more. If 27.x is unavailable, a recorded bad capture or a timed trace of the omitted-keyboard capture sequence is acceptable.

The open inline thread that says role-only keyboard surfaces could produce - [keyboard] does not apply: the diff keeps only the [Keyboard] container and strips other chrome indexes, so the type-only check matches the reported symptom. Please resolve it: #5426 (comment)

Not verified here: any test or device run, the new tests failing on base (checked by tracing the base loop only), and the author's iOS 26.5 run. The two Body rules checks show cancelled, not failed. They run on the PR body, and this diff touches only command-runtime source and tests, so a re-run is likely enough. The other checks are not failing. The next step before merge is the live iOS 27.x evidence above.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iOS: fill --settle diff reports - [keyboard] while the keyboard stays on screen

2 participants