Repository navigation
perf(android): share one post-press focus read between the escape guard and the dialog check - #5211
Conversation
…rd and the dialog check A successful local press read Android focus three times: the before-command dialog check, the escape guard, and the after-command dialog check. The last two ran back to back after the dispatch. When one post-dispatch read proves no blocking dialog and the session app focused, it now answers both. Any other answer keeps the current order and separate reads. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Size Report
Startup median (7 runs, lower is better):
|
There was a problem hiding this comment.
All reported issues were addressed across 6 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
This comment has been minimized.
This comment has been minimized.
…nd escape guard An inconclusive shared read was thrown away, so an unknown focus cost 12 window dumps instead of 10. The after-command check now acts on that read, and a read that names another focused package answers the escape guard's app-focus question. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 1a80a72. The verdict and the full list are in the summary comment.
…helper focus requests at the adapter The daemon press test asserts expectedPackage and foregroundPackage on the refusal and names its focus-answering fake for what it counts: adapter reads. platform-android's observation test proves a live helper answers each blocking-dialog and app-focus read with one focus request and no dump. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ard's own reads When the shared post-press read names no focused package, the escape guard reads the foreground, and the after-command check now reads again instead of acting on the older shared read. The guard skips its app-focus read after a shared read: the shared read already asked the helper, and the foreground read repeats the dump fallback. Reads stay at or below main on every path. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Apex Sentinel · ✅ Approve · review of
|
| Finding | Fixed by | Where |
|---|---|---|
| After-command dialog check acts on a read taken seconds before the escape guard's own dumps | thymikee | a3f270f · reply |
Reviewed with this repository's own Sentinel configuration (47e3fbe2758c).
💬 Talking to Sentinel
In a finding's thread, reply with:
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
|
This PR is ready to merge at a3f270f, and the required checks pass, including Android Smoke Tests, Integration Tests, Coverage, and Lint/Typecheck; the canceled "Body rules" entries are superseded by a passing run and do not touch the changed device route. Not blocking: these can be taken or left: could the shared read be reused only when its focused package equals the session app's, because a blocking dialog that appears during the guard's later foreground read after a read naming another package is missed and the press returns ok (otherwise the readiness doc comment could state this window and soften "Outcomes do not change"), which would cost one extra dump on routes such as the permission prompt but would also reduce the reuse rule now derived in both the guard and the readiness wrapper (whose unused-today These review threads no longer apply and can be resolved: the expected and foreground package assertion is now in the test; the daemon fake is renamed to The Android smoke lane (API 36 emulator) passed |
Summary
A local Android
press(alsoclick,longpress,hover) read focus before the dispatch, then separately for the escape guard and the after-command dialog check.The readiness wrapper now takes one post-dispatch blocking-dialog read and shares it. If the session app is focused with no dialog, that read answers both checks. If it names another package, the escape guard reads only the foreground, and the after-command check acts on the shared read. If it names no package, the guard reads only the foreground (the shared read already asked the helper), and the after-command check reads again after the guard, as on main. Outcomes do not change.
Before / after
Post-dispatch reads, counted at the adapter seam:
The longpress cold-helper ledger passes (worst case at or below main).
Validation
Head a3f270f.
interaction-touch-android-press-focus-reads.test.tsasserts the counts, the permission warning, the launcher refusal's typed details, and that a blocking dialog appearing during the guard's reads after an unknown focus is reported. The readiness tests and the longpress ledger pass. CI is pending.🤖 Generated with Claude Code