Repository navigation
refactor(apple-runner): extract the keyboard return control lookup - #4589
Conversation
Size Report
Startup median (7 runs, lower is better):
|
There was a problem hiding this comment.
All reported issues were addressed across 3 files
You’re at about 96% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Apex Sentinel · ✅ ApproveSince the last review: 0 new · 0 still open · 0 no longer raised No open findings. 1 finding below 💬 Talking to SentinelIn a finding's thread, reply with:
On this conversation, comment Earlier reviewsReview of
|
|
The extraction in 1a6fc6c looks behavior-preserving, and I found nothing that blocks it. All 20 checks pass, including the swift-runner iOS and macOS lanes that compile and run the touched runner files. There are no conflicts. Not blocking, and you can take or leave it: The three open inline threads still apply: the macOS/tvOS nil meaning, the Before merge, please resolve those three threads and decide whether |
Pulls the keyboard's return-key lookup out of the enter press into findKeyboardReturnControl(in:) and one pure rule, RunnerKeyboardReturnKey, that maps a return key's label or identifier to a normalized kind. The press probes the same labels in the same order and taps what it found, so the behavior is unchanged. The kind is what a later keyboard status operation reports as returnKey. Checks the mapping in the in-bundle unit tests, which run on the macOS host lane on every PR and the iOS nightly lane.
1a6fc6c to
cc7940a
Compare
|
Addressed in cc7940a. Keeping All three inline threads are fixed and resolved: the doc comment distinguishes the iOS Validated at cc7940a: |
|
I found no problems in cc7940a, and the three earlier findings from #4589 (comment) are fixed. The nil-return comment, the The three review threads on those points are fixed at this head, so you can resolve them: #4589 (comment), #4589 (comment) and #4589 (comment). CI shows 20 checks with none failing. The swift-runner iOS and macOS lanes passed at the earlier head 1a6fc6c, and the changes since then are comments, one test split and one added test, with no production logic change. How iOS labels the Google and Yahoo return keys is unverified, but the code is correct either way. Nothing else from this review needs to happen before merge as long as CI stays green at cc7940a. |
#4589 moved the return-control lookup into findKeyboardReturnControl and left tapKeyboardReturnControl calling XCUIElement.tap() on every platform. tap() is unavailable on tvOS, so the tvOS runner build in the release job failed. Restore the iOS guard the original function had. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Extracts the keyboard return-control lookup from the
keyboard enterpress path into one reusable function, so a later PR can report the return key inkeyboard status(approved design, Feature C). No behavior change.Layer 1 of 2:
kind(of:)and its cases are read by #4602. Per review on 1a6fc6c, the mapping and its tests stay with the lookup they name.findKeyboardReturnControl(app:)owns the ordered label probe (RunnerKeyboardReturnKey.probeLabels, same labels, same order);tapKeyboardReturnControltaps what it returns.RunnerKeyboardReturnKey.kind(of:)maps a return key's label/identifier togo|search|send|next|done|join|route|continue|enter|unknown. Exact case-insensitive matches only; Apple's brandedGoogle/Yahookeys,Emergency Call, and localized or ambiguous labels stayunknownon purpose.Touched files: 3. No TypeScript changes, no public API change.
Validation
Tested at
cc7940a31646865a7f452fbb9f81eabd60d188c5.pnpm check:affected --run --head cc7940a: passed,exactCommit: true(native-dupes,xctest-selection,packaged-runner-swift).swift-runner-*andreplay-*are GitHub-authoritative lanes (CI obligations). At head 1a6fc6c all 20 CI checks passed, including both swift-runner lanes.AGENT_DEVICE_XCUITEST_INCLUDE_UNIT_TESTS=1: succeeded. Method-selected simulator run: 7 executed, 0 failures, including the 5 new mapping tests and the existing keyboard-return tests. At 1a6fc6c the busy-keyboard tap path also passed locally.pnpm format,pnpm check:quick: clean.