Skip to content

perf(ios): reuse current focus for native text replacement - #4192

Merged
thymikee merged 6 commits into
callstack:mainfrom
damian-kolasinski:perf/ios-focused-text-replacement
Nov 4, 2026
Merged

thymikee merged 6 commits into
callstack:mainfrom
damian-kolasinski:perf/ios-focused-text-replacement

Conversation

@damian-kolasinski

@damian-kolasinski damian-kolasinski commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Local native iOS fill reuses focus when the current command identifies the target and reads its keyboard focus. Clearing tries verified select-all/delete before a fallback caret tap. Newly focused inputs retain caret preparation.

9 files cover the native path, regression witnesses/tests, CLI help and user docs. Fixture extraction keeps the existing host file below its size gate. No public API or wire changes. No linked issue.

Validation

Base c8ad8fb1257787ce0973cf74271cb9a4fafb51d9 → tested head 5b26c9c6aae3ac7b2eb257e1d16f011e5284c1ec.

  • pnpm check:affected --run --head 5b26c9c6a: passed, exactCommit: true; 14 local checks, 17,138 unit passes and one existing unit skip.
  • iOS/macOS arm64 builds passed. All 37 selected iOS tests passed without skips, including nine new tests and both landscape directions.
  • The original eight regressions: base five pass/three fail; head eight pass. An isolated broad-deferral mutation fails the required caret-preparation test.
  • Five paired synthetic rounds: focused empty fill 2648→1807 ms (31.8%), replacement 4188→2705 ms (35.4%), clear 2950→1480 ms (49.8%). Each improved in all five pairs. Unfocused medians varied within 1.2%. No full-suite gain claim.

Aggregates, receipt summary and reproducer. Independent review has no remaining findings. All owned fixtures, leases, sessions and daemons are cleaned. GitHub Actions awaits maintainer approval for this fork; Vercel preview requires deployment authorization. Physical-device execution was not performed.


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

View guided diff

@vercel

vercel Bot commented Nov 3, 2026

Copy link
Copy Markdown

@damian-kolasinski is attempting to deploy a commit to the Callstack Team on Vercel.

A member of the Team first needs to authorize it.

@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.

No issues found across 9 files

View guided diff | Re-trigger cubic

@thymikee

thymikee commented Nov 3, 2026

Copy link
Copy Markdown
Member

I found no code defect at 5b26c9c, but this changes how native fill replaces text, so it needs a live run before merge. Could you provide accessible exact-head artifacts for the required cases, especially seeded secure fields on coordinate fill? The existing masked-fill test omits x/y and cannot reach this branch.

Please include device and OS, rebuilt runner and daemon provenance, commands, responses, and runner logs for native fill in focused empty and prefilled inputs, clear, an initially unfocused input, and a target after a neighbour takes focus. Show the requested text and unchanged neighbour, with focus-reuse evidence and tap witnesses distinguishing skipped taps from retained caret preparation. Include rejected select-all fallback and seeded secureTextField and AX-masked fields, both focused and unfocused, with app-owned actual-value assertions proving replacement and clear; masked accessibility output alone is insufficient. Include the linked exact-head test receipt and paired successful-command measurements. Existing runs may cover cases, and simulator evidence is sufficient. The validation gist was inaccessible, so the performance, native execution, mutation, and cleanup claims remain unverified; direct native witnesses and source tracing do not establish live production-route behavior.

The Vercel check appears unrelated: its captured comment reports fork deployment authorization before execution, with no failing build excerpt; native CI success is not established. There are no known conflicts. Before merge, provide the live evidence and clear the required CI authorization and check obligations.

@thymikee

thymikee commented Nov 3, 2026

Copy link
Copy Markdown
Member

This branch now conflicts with main. Please rebase and resolve the conflicts; the review at 5b26c9c still applies, and the live fill run is still the remaining evidence.

@damian-kolasinski
damian-kolasinski force-pushed the perf/ios-focused-text-replacement branch from 5b26c9c to ea1024a Compare November 4, 2026 12:40
@damian-kolasinski
damian-kolasinski force-pushed the perf/ios-focused-text-replacement branch from ea1024a to abf90ad Compare November 4, 2026 12:45
@thymikee

thymikee commented Nov 4, 2026

Copy link
Copy Markdown
Member

At abf90ad, the earlier conflict is fixed. The rebase only adapts the text-entry calls to main's throwing signatures, so the focus-reuse behavior is the same as at 5b26c9c, and focus is still reused only for the proven target.

The evidence so far is the XCUITest cases and the synthetic timing rounds. The live CLI fill run I asked for earlier is still missing. On one simulator at this head, could you run fill through the normal command route for:

  • a focused field, empty and prefilled, plus a clear;
  • an initially unfocused field;
  • a secure text field, focused and unfocused.

Please show the final values, that a neighbouring field is unchanged, and the runner log lines that show whether a focus or caret tap happened.

No GitHub Actions checks have run on this head yet; they need maintainer approval for the fork. The only failing check is the Vercel deployment authorization, which is not a code problem. No conflicts are known.

@damian-kolasinski

damian-kolasinski commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor Author

Added CLI verification at abf90ad on iPhone 17 Pro Max / iOS 26.2. All nine cases passed. The test bundle includes commands/responses, exact app-owned values, unchanged-neighbour assertions, and correlated focus/caret tap logs.

@thymikee

thymikee commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

At abf90ad, the code looks good, and your CLI evidence covers what I asked for. The focused fill, replace and clear cases skip the focus and caret taps. Unfocused targets, a neighbour holding focus, and secure and masked fields keep them. Every case keeps the neighbour unchanged and lands the exact value.

Not blocking, take or leave:

No GitHub Actions checks have run on this head yet; runs from the fork need maintainer approval. The only failing check is the Vercel deployment authorization, which is not a code problem. No conflicts are known.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 4, 2026
@thymikee
thymikee merged commit 876e4b2 into callstack:main Nov 4, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants