Skip to content

fix(ios): find the navigation bar back button on iPhone Duo layouts - #4542

Merged
thymikee merged 1 commit into
mainfrom
fix/4527-duo-back-button
Nov 15, 2026
Merged

thymikee merged 1 commit into
mainfrom
fix/4527-duo-back-button

Conversation

@thymikee

@thymikee thymikee commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Summary

On the iPhone Duo (iOS 27.1) the system BackButton floats below the navigation bar, in another subtree (snapshot: bar About is node 51, parent 50; BackButton is node 113, parent 112). back searched only bar subtrees, found nothing and swiped; open pose: BACK_SWIPE_NO_CHANGE.

  • The lookup reads BackButton in the app's windows. Candidates are decided by geometry alone: buttons inside a navigation bar, or, when none is, buttons below a bar within a third of the window height. Others are not counted or compared; hittability only picks the tap target.
  • Rounds snapshot the buttons until still. The first round and one live read then agree on the bar count and, for an unlabeled button, the bar titles, so a retitling bar is never still. A button with no label under bars with no title is not pressed.
  • Docs: commands.md, RUNNER_PROTOCOL.md.

6 files. Closes #4527. Cut: swipe targeting the focused column (a button exists there in all three poses).

Validation (47ff6dbad7, base d78be6c887)

Before, Duo open: COMMAND_FAILED / BACK_SWIPE_NO_CHANGE, found=no.

After, raw runner lines (Settings > General > About, own state dirs):

  • Duo open: found=yes pressed=yes confirmed=yes lookupMs=755 confirmMs=419
  • Duo, two runs at this head: warm lookup open 748 ms, half-open 773, closed 704, confirm 373–483 ms; a cold first run took 1.1 s per lookup on the two-bar poses and still succeeded.
  • iPhone 17 (labelled, in-bar): found=yes pressed=yes confirmed=yes lookupMs=346 confirmMs=143

Runner unit tests built with the unit flag, run on an iPhone 17 simulator: all 33 back tests pass, including a floating unlabeled button (pressed=yes confirmed=yes), no bar (not pressed), a ticking title (not pressed), and a bar button beside an in-content BackButton, still, moving or just below the bar (pressed), and a back tap that presents an alert (unverified, not a pop). The iOS and macOS unit targets build.

Risk: the Duo has no CI lane; a loaded host can exceed the 1 s round budget and swipe instead.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.29 MB 6.29 MB +4.8 kB
Package (unpacked) 6.29 MB 6.29 MB +4.8 kB
Package (download) 1.91 MB 1.91 MB +1.2 kB

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 22.1 ms 22.1 ms -0.0 ms
CLI --help 42.0 ms 42.1 ms +0.1 ms

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

All reported issues were addressed across 3 files

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

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread website/docs/docs/commands.md Resolved
@apex-sentinel-staging

apex-sentinel-staging Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve

Since the last review: 1 new · 0 still open · 0 no longer raised

1 finding(s): 1 minor.

🟡 Minor (1)

Where Finding
apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Navigation.swift:622 🆕 In-content BackButton under a transparent bar makes the bar's own button ambiguous
Not in the reviewers' prompt (1 file)
  • website/docs/docs/commands.md: its very long or mostly numeric lines were cut; reviewers could still search them

Reviewed with this repository's own Sentinel configuration (7848a1a9283f).

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

Earlier reviews

Review of 8e0a3436 · 14.11.2026 16:04 UTC

Apex Sentinel · ✅ Approve

Since the last review: 0 new · 0 still open · 0 no longer raised

No open findings.

Not in the reviewers' prompt (1 file)
  • website/docs/docs/commands.md: its very long or mostly numeric lines were cut; reviewers could still search them

2 findings below minor hidden (user_settings.min_severity).

Reviewed with this repository's own Sentinel configuration (d78be6c88715).

Review of 33e1215a · 14.11.2026 15:10 UTC

Apex Sentinel · ✅ Approve

Since the last review: 0 new · 0 still open · 1 no longer raised (1 marked fixed)

No open findings.

Not in the reviewers' prompt (1 file)
  • website/docs/docs/commands.md: its very long or mostly numeric lines were cut; reviewers could still search them

Reviewed with this repository's own Sentinel configuration (d78be6c88715).

Review of 31c4999d · 14.11.2026 14:50 UTC

Apex Sentinel · ✅ Approve

Since the last review: 1 new · 0 still open · 0 no longer raised

1 finding(s): 1 minor.

🟡 Minor (1)

Where Finding
apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Navigation.swift:629 🆕 In-content BackButton below the bar is pressed once the bar's own button is hidden
Not in the reviewers' prompt (1 file)
  • website/docs/docs/commands.md: its very long or mostly numeric lines were cut; reviewers could still search them

2 findings below minor hidden (user_settings.min_severity).

Reviewed with this repository's own Sentinel configuration (d78be6c88715).

Review of 33db2657 · 14.11.2026 14:36 UTC

Apex Sentinel · ✅ Approve

Since the last review: 0 new · 0 still open · 1 no longer raised (1 marked fixed)

No open findings.

Not in the reviewers' prompt (1 file)
  • website/docs/docs/commands.md: its very long or mostly numeric lines were cut; reviewers could still search them

Reviewed with this repository's own Sentinel configuration (d78be6c88715).

Review of 0fab3751 · 14.11.2026 14:21 UTC

Apex Sentinel · 🟠 Request changes

Since the last review: 1 new · 0 still open · 0 no longer raised

1 finding(s): 1 major.

Required fixes

  • An in-content BackButton in the top third makes the back lookup ambiguous, so nothing is pressed

🟠 Major (1)

Where Finding
apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Navigation.swift:618 🆕 An in-content BackButton in the top third makes the back lookup ambiguous, so nothing is pressed
Not in the reviewers' prompt (1 file)
  • website/docs/docs/commands.md: its very long or mostly numeric lines were cut; reviewers could still search them

1 new finding away from what changed since 1865a55 not shown. Comment @apex-sentinel-staging review for a full review.

Reviewed with this repository's own Sentinel configuration (d78be6c88715).

Review of 1865a55b · 14.11.2026 14:11 UTC

Apex Sentinel · ✅ Approve

Since the last review: 0 new · 0 still open · 0 no longer raised

No open findings.

Not in the reviewers' prompt (1 file)
  • website/docs/docs/commands.md: its very long or mostly numeric lines were cut; reviewers could still search them

1 finding below minor hidden (user_settings.min_severity).

Reviewed with this repository's own Sentinel configuration (d78be6c88715).

Review of 222bbe65 · 14.11.2026 13:58 UTC

Apex Sentinel · ✅ Approve

Since the last review: 0 new · 0 still open · 1 no longer raised

No open findings.

Not in the reviewers' prompt (1 file)
  • website/docs/docs/commands.md: its very long or mostly numeric lines were cut; reviewers could still search them

Reviewed with this repository's own Sentinel configuration (d78be6c88715).

Review of 01e2c58f · 14.11.2026 13:44 UTC

Apex Sentinel · 🟠 Request changes

Since the last review: 1 new · 0 still open · 0 no longer raised

1 finding(s): 1 major.

Required fixes

  • In-content BackButton buttons block the press before the belongs-to-bar check runs

🟠 Major (1)

Where Finding
apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Navigation.swift:426 🆕 In-content BackButton buttons block the press before the belongs-to-bar check runs
Not in the reviewers' prompt (1 file)
  • website/docs/docs/commands.md: its very long or mostly numeric lines were cut; reviewers could still search them

1 finding below minor hidden (user_settings.min_severity).

Reviewed with this repository's own Sentinel configuration (d78be6c88715).

Review of 9c9d565a · 14.11.2026 13:34 UTC

Apex Sentinel · ✅ Approve

Since the last review: 1 new · 0 still open · 1 no longer raised (1 marked fixed)

1 finding(s): 1 minor.

🟡 Minor (1)

Where Finding
website/docs/docs/commands.md:127 🆕 New found=unprovable outcome is absent from the user-facing back reasons
Not in the reviewers' prompt (1 file)
  • website/docs/docs/commands.md: its very long or mostly numeric lines were cut; reviewers could still search them

1 finding below minor hidden (user_settings.min_severity).

1 new finding away from what changed since 1126d8a not shown. Comment @apex-sentinel-staging review for a full review.

Reviewed with this repository's own Sentinel configuration (d78be6c88715).

Review of 1126d8af · 14.11.2026 13:15 UTC

Apex Sentinel · ✅ Approve

Since the last review: 1 new · 0 still open · 0 no longer raised

1 finding(s): 1 minor.

🟡 Minor (1)

Where Finding
apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Navigation.swift:314 🆕 A self-retitling bar still confirms a no-op tap once the unlabeled button holds still
Not in the reviewers' prompt (1 file)
  • website/docs/docs/commands.md: its very long or mostly numeric lines were cut; reviewers could still search them

1 finding below minor hidden (user_settings.min_severity).

Reviewed with this repository's own Sentinel configuration (d78be6c88715).

Review of 01840126 · 14.11.2026 13:05 UTC

Apex Sentinel · ✅ Approve

Since the last review: 0 new · 0 still open · 2 no longer raised (2 marked fixed)

No open findings.

Not in the reviewers' prompt (1 file)
  • website/docs/docs/commands.md: its very long or mostly numeric lines were cut; reviewers could still search them

1 finding below minor hidden (user_settings.min_severity).

Reviewed with this repository's own Sentinel configuration (d78be6c88715).

Review of 9b9c7162 · 14.11.2026 12:15 UTC

Apex Sentinel · ✅ Approve

Since the last review: 1 new · 1 still open · 1 no longer raised

2 finding(s): 2 minor.

🟡 Minor (2)

Where Finding
apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Navigation.swift:551 Confirmation compares bar identifiers, so an accessibility-label-only title change fakes a pop
apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Navigation.swift:310 🆕 Unlabeled-button confirmation credits a self-retitling bar to the tap
Not in the reviewers' prompt (1 file)
  • website/docs/docs/commands.md: its very long or mostly numeric lines were cut; reviewers could still search them

1 finding below minor hidden (user_settings.min_severity).

Reviewed with this repository's own Sentinel configuration (d78be6c88715).

Review of bda03f14 · 14.11.2026 11:30 UTC

Apex Sentinel · ✅ Approve

2 finding(s): 2 minor.

🟡 Minor (2)

Where Finding
apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Navigation.swift:522 Pop confirmation reads the bar's accessibility identifier, not its title
apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Navigation.swift:236 A failed pre-tap titles read silently disables title confirmation for unlabeled back buttons
Not in the reviewers' prompt (1 file)
  • website/docs/docs/commands.md: its very long or mostly numeric lines were cut; reviewers could still search them

2 findings below minor hidden (user_settings.min_severity).

Reviewed with this repository's own Sentinel configuration (d78be6c88715).

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Apex Sentinel: 2 new findings on bda03f1. The verdict and the full list are in the summary comment.

@thymikee

Copy link
Copy Markdown
Member Author

Thanks for the Duo fix. At bda03f1 two open review threads still block merge, and a few other things should be settled.

All 22 checks are green, and there are no conflicts. Green CI says little about the Duo, which has no CI lane. I did not run a device or simulator, and I could not tell whether the Apple smoke job selected the back-navigation tests for this diff. The Duo evidence is your trace table, with no accessibility-tree snapshot to confirm the BackButton is a sibling of the bar.

Before merge, please resolve the two open threads on the window-wide BackButton match and RUNNER_PROTOCOL.md. Two lower-priority threads also still apply. Would requiring barCount >= 1 keep the Duo fix and stop an app element named BackButton from being pressed where the old lookup swiped? This thread does not apply: XCUITest uses the bar title as its identifier, as the fixtures at app.navigationBars["Detail"] show, and an app-set identifier only degrades to back_swipe_unverified. Please resolve it.

One rule is not yet enforced: the proof that confirms a pop must be decided once, before the tap, from the same state read. Line 430 decides from before.barTitles.isEmpty, while line 236 decides to read titles from an empty label. If the titles read fails or the frames differ (lines 244-249), an unlabeled BackButton is tapped with no title to compare. The pop happens, and the command returns back_swipe_unverified. Either refuse to tap when the button is unlabeled and no title was read, or carry titles in every state read. That also removes the readsBarTitles parameter and the second pre-tap read.

Please attach the Duo trace logs, and one run at bda03f1 on an iPhone 17 simulator at Settings > General > About that shows the labelled single-column trace line. The read now uses a window-wide query for every iOS layout, and the Duo lookup already takes 781-1077 ms against a 1000 ms budget. Confirming that the Apple smoke job ran testInAppBackPressesTheNavigationBarBackButton at this head would also do.

Not blocking, and fine to take or leave: the new test only calls navigationBarBackPopped with hand-built states, so removing the window-wide query would leave every test green (a floating unlabeled BackButton test pressing it and asserting pressed=yes confirmed=yes would cover it, or note why the test app cannot host one); the doc comments at Navigation.swift:313 and above testNavigationBarBackPoppedOnlyOnABarOrBackButtonChange omit the title signal; and the PR says "Closes #4527" while the swipe-targets-the-focused-column part is cut, so "Fixes part of" or an amended issue would be more accurate.

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

All reported issues were addressed across 5 files (changes from recent commits).

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

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread apple/runner/RUNNER_PROTOCOL.md Resolved
Comment thread apple/runner/RUNNER_PROTOCOL.md Resolved

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Apex Sentinel: 1 new finding and 1 moved to a new line on 9b9c716. The verdict and the full list are in the summary comment.

@thymikee

Copy link
Copy Markdown
Member Author

Thanks for the update. At 9b9c716 the Duo lookup is much closer: the missing bar requirement and the unprovable-title refusal from the earlier review (bda03f1) are now handled, but the new lookup has no live run, and one doc bullet no longer matches the code. All 22 checks pass, but no CI lane runs the iPhone Duo. I did not run a device or simulator; everything below is read from the code.

RunnerTests+Navigation.swift:383 changes the device-facing lookup. The still rounds now read only buttons, a new live read adds the bars, hittability and the canShowAPop refusal, and the second titles read is gone. The Duo table from bda03f1 predates this shape, and the labelled single-column path, which every iOS back uses, has not run live in this PR. A regression there (for example found=moving or found=unprovable falling back to the swipe) would not show anywhere. Please attach two runs at 9b9c716 with the raw runner log lines. First, iPhone Duo in the open pose on Settings > General > About: the AGENT_DEVICE_RUNNER_BACK_NAVIGATION_BAR_BUTTON line with found=yes pressed=yes confirmed=yes and its lookupMs, plus a snapshot before the tap that shows the BackButton outside the navigation bar. Second, the same screen on the iPhone 17 simulator with the labelled button. A smoke-job log showing testInAppBackPressesAFloatingUnlabeledBackButtonAndConfirmsThroughTheBarTitle and testInAppBackPressesTheNavigationBarBackButton passed at this head can replace the second run. I could not tell whether the Apple smoke job selected those tests for this diff.

commands.md:127 has two sentences that no longer match the code. 'Two reads of the navigation bars and back buttons ... agree' is not true: the still rounds read only the back buttons (:133, barCount is 0 at :542), and the bars are read once afterwards (:405). 'A bar's title alone never counts' is also not true for an unlabeled BackButton (:316 with :556), so a bar that retitles itself can confirm a tap that went nowhere. Readers of this text will expect a push that is still changing the bar count to be caught before the tap, and a ticking title never to give success. Neither holds on the Duo path. The doc should name exactly what the two still reads compare and which change confirms a pop for each kind of back button. The smallest fix is to count the bars in every still round and read the titles when a button is unlabeled, which makes the sentence true and also settles the two open threads r4573456925 and r4573456923. Otherwise, reword to 'two reads of the back buttons' and add: 'for a labelled back button a bar's title alone never counts; with an unlabeled one, a bar whose title updates itself can be misread as a pop'. Please mirror the same caveat in RUNNER_PROTOCOL.md.

Not blocking, and you can take or leave these: testInAppBackPressesAFloatingUnlabeledBackButtonAndConfirmsThroughTheBarTitle (RunnerTests+NavigationTests.swift:83) puts the floating button in detail.view, so the pop removes it and navigationBarBackPopped returns true with or without the title comparison; keeping the button across the pop (for example in the navigation controller's view) would cover the title path the Duo depends on, or the test could be renamed to say it confirms through the button count. The PR body still describes bda03f1 ('3 files, +96/-64', the title read just before the tap, and its validation table), while 9b9c716 touches 5 files, so it is worth refreshing the summary, size and validation SHA after the live runs.

Of the open inline threads, these still apply and need a fix: the threads on ticking-title confirmation (r4573456923 and r4573467471), bar count dropped (r4573456925), per-bar deadline check (r4573456931), and unlabeled-button scope (r4573456935), plus one minor thread. These are fixed at this head, so please resolve them: r4573315779 (the second titles read is gone, and !canShowAPop refuses the tap), r4573467467 (an empty bar identifier gives canShowAPop false, so the runner swipes), r4573294100 (the bar requirement and --hidden-bar test hold it), r4573294101 (the protocol doc now describes the window-wide lookup; the two stale phrases are in the open threads) and r4573294105 (the test is renamed and documents the title signal).

Before merge, please attach the two live runs at 9b9c716 and make commands.md:127 match what the still reads compare and when a bar title confirms a pop.

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

All reported issues were addressed across 5 files (changes from recent commits).

You’re at about 90% 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

Comment thread apple/runner/RUNNER_PROTOCOL.md Resolved
Comment thread website/docs/docs/commands.md Resolved
Comment thread website/docs/docs/commands.md Resolved

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Apex Sentinel: 1 new finding on 9c9d565. The verdict and the full list are in the summary comment.

Comment thread website/docs/docs/commands.md Resolved

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Apex Sentinel: 1 new finding on 01e2c58. The verdict and the full list are in the summary comment.

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

All reported issues were addressed across 2 files (changes from recent commits).

You’re at about 90% 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

Comment thread website/docs/docs/commands.md Resolved

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Apex Sentinel: 1 new finding on 0fab375. The verdict and the full list are in the summary comment.

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

All reported issues were addressed across 5 files (changes from recent commits).

You’re at about 91% 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

@thymikee

Copy link
Copy Markdown
Member Author

Most of the earlier findings (#4542 (comment)) are fixed at 31c4999, but one new defect remains: after the back tap, the confirmation can count a covered button as a pop.

RunnerTests+Navigation.swift:494 recomputes candidates with backButtonCandidates, and its tier choice (:638) reads isHittable. If the tap on a labelled in-bar back button opens an alert or sheet instead of popping (a backAction that confirms discard, or a modal), the button stays in the tree but is no longer hittable. The next read then falls to the floating tier, which is normally empty, so the labels go from ["Back"] to [], navigationBarBackPopped returns true and back answers ok. At 9b9c716 and on main the same tap answered back_swipe_unverified. The caller would continue on the wrong screen. The state compared across reads (still rounds, live read, every confirmation read) should come from one rule that does not depend on hittability, and hittability should only pick the tap target. Please choose the tier once in the live read and carry it into the confirmation reads, or make the tier geometric and filter hittability only in liveNavigationBarBackButton. A fixture test where the back press presents an alert over the bar, asserting the result is not confirmed, would cover it.

commands.md:127 says the floating button counts only "when none is" inside a navigation bar, and RUNNER_PROTOCOL.md says the same. The code now uses the floating button whenever no in-bar back button is hittable, so a non-hittable in-bar button plus a hittable floating one presses the floating one. Please change both sentences to match the tier rule, for example "inside a navigation bar, or, when none of those can be tapped, one floating below it". If you make the tier geometric for the first finding, the current text may already be right.

Could the delta be smaller? It added two tiers, a hittability-dependent tier choice, the known-bars cache (barsWereRead and its reset rules) and a fresh live-read budget. One alternative is to read the bars in every round, drop knownBars/barsWereRead/barsRead, and compare the full state between consecutive rounds. The tier would be geometric (in-bar buttons if any exist, else floating), so state membership never depends on hittability, and the confirmation would carry the tier chosen before the tap. That would also remove the first finding.

Not blocking, take or leave: the live read has its own budget (liveDeadlineMs at Navigation.swift:398), so a lookup can run to about 2 s while both docs say reads start for up to 1 s, so please say the live read has its own 1 s budget or start it under the rounds' deadline; the PR body says 6 files and the diff touches 5.

The open inline threads on tier selection and hittability still stand (#4542 (comment) covers the hittability dependency). These threads are fixed at 31c4999 and can be resolved: #4542 (comment), #4542 (comment), #4542 (comment), #4542 (comment), #4542 (comment), #4542 (comment), #4542 (comment), #4542 (comment), #4542 (comment), #4542 (comment), #4542 (comment), #4542 (comment), #4542 (comment), #4542 (comment), #4542 (comment).

The live iPhone Duo and iPhone 17 results in the PR body are enough evidence for this change. I did not run a device or simulator, so the first finding is read from the code. It assumes isHittable is false for a bar button covered by a presented alert or sheet, which is XCTest's usual behavior but was not checked. No CI lane runs the iPhone Duo.

Checks are still running: Smoke Tests (ios), Smoke Tests (macos) and one review check are in progress, not failing. The iOS smoke job exercises the runner this PR changes, so its result matters once it lands. There are no conflicts. Before merge, the confirmation state needs to stop depending on hittability and the "when none is" wording in both docs needs to match the tier rule.

@thymikee

Copy link
Copy Markdown
Member Author

Addressed the review at 31c4999 in 33e1215:

  • Covered button counted as a pop: the tier is now geometric (buttons inside a bar, else the floating ones below it), so the state compared across the still rounds, the live read and every confirmation read no longer depends on hittability; hittability only picks the tap target in the live read. Fixture test testInAppBackReportsABackTapThatPresentsAnAlertAsUnverified (--alert-back): it failed on 31c4999 (read as a pop) and passes now, answering back_swipe_unverified. A non-hittable in-bar button beside a hittable floating one now swipes, as on main.
  • Wording: commands.md and RUNNER_PROTOCOL.md already say the floating button counts "when none is" inside a bar, which is the geometric rule. The protocol now also says the live read before the tap counts as a read of its own. PR body file count fixed.
  • Reading the bars every round instead of the known-bars cache: kept the cache. On the Duo each bar read is a snapshot per bar (two bars open), about 0.1 s per round, which brings the warm lookup close to the 1 s round budget; with a geometric tier the cache only saves that cost and no longer affects what is compared.
  • 33 back tests pass on an iPhone 17 simulator; iOS and macOS unit targets build; native-dupes and check:doc-prose pass; Duo poses re-ran (warm lookup 704–773 ms).

@thymikee

Copy link
Copy Markdown
Member Author

Both earlier findings are fixed at 33e1215, but one docs problem remains: the command help still describes the old back contract. CI is green (22 checks, none failing) and there are no conflicts. No CI lane runs the iPhone Duo, and I did not run a device or simulator. The alert regression and the live Duo results rest on the PR body and on reading the code.

For an unlabeled back button whose label and bar count stay the same across a pop, bar titles now count as a change (Navigation.swift:655-659 and the pop check at :325-327). But backCommandDescription at system/index.ts:289 still says a bar title alone never counts, and that an unchanged back-button title and bar count give back_swipe_unverified. That string feeds the back facet, so it is the canonical CLI help, explain and MCP text. Readers of it get a wrong success contract for the exact Duo route this PR adds, and the website and runner protocol now disagree with it. Please update the description to state the unlabeled-button bar-title exception, its stillness requirement and its confirmation limit, in line with the website and runner protocol.

On the other threads: the in-bar tier precedence thread does not apply, because a non-hittable in-bar button hides the floating tier at Navigation.swift:633, so back falls back to the swipe as on main. The fixture constraint naming thread is fixed, and the latest change did not touch it. This tier-order thread is fixed, since the in-bar tier still takes precedence at Navigation.swift:633. Please resolve all three.

Once the description matches, nothing else stands between this PR and merge.

@thymikee

Copy link
Copy Markdown
Member Author

Updated backCommandDescription (CLI help, explain and MCP text) at 8e0a343: a bar title or a moved button alone never counts only for a back button that has a title; a back button with no title, such as the iPhone Duo's floating one, is confirmed by its navigation bar's title instead, which must also hold still before the tap, a retitling bar can still be misread as a pop, and when no bar has a title or a title keeps changing that button is not pressed. This matches commands.md and RUNNER_PROTOCOL.md. The three threads you list (r4573911429, r4573962443, r4573962452) are resolved. vitest on command-surface and repo-guards, and check:doc-prose, pass locally.

@thymikee

Copy link
Copy Markdown
Member Author

I found no problems in 8e0a343, and the findings from the earlier review (#4542 (comment)) are now fixed. The change since then is one string literal in the command-surface metadata. It does not change any runner route.

The checks are green: 22 ran and none failed. I did not run the runner or its unit tests, because the diff is text only and runner behavior is unchanged. I also found no total description-length budget for MCP or CLI help in packages/, src/ or scripts/. Only the 100-character server.json limit exists.

Three inline threads from other reviewers no longer need action. The first one (#4542 (comment)) is covered by the two tiers in backButtonCandidates. Your reply accepted the remaining content-button case as a documented proximity limit. The second one (#4542 (comment)) is covered because the tier is geometry-only. A non-hittable in-bar button still hides a floating one, but then no hittable candidate is found and the command swipes, so nothing is pressed wrongly. The third one (#4542 (comment)) is fixed in the fixture offsets. Please resolve these three threads.

There are no conflicts, and nothing else needs to happen before merge.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 14, 2026
@thymikee

Copy link
Copy Markdown
Member Author

This branch now conflicts with main at 8e0a343. Please rebase onto main and push; the earlier clean review still applies to the code, and I will re-check the rebased head.

@thymikee thymikee removed the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 15, 2026
On the iPhone Duo the system back button floats below the navigation bar, in another
subtree, so the bar-scoped lookup found nothing and back swiped.

The lookup reads BackButton in the app's windows and presses it only when it is by a
navigation bar: inside one, or, when none is, below one within a third of the window
height. Rounds snapshot the candidates until still; the bar count and, for an unlabeled
button, the bar titles must agree with a live read before the tap, and a button with no
label under bars with no title is not pressed. A covered button is never read as a pop.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@thymikee
thymikee force-pushed the fix/4527-duo-back-button branch from 8e0a343 to 47ff6db Compare November 15, 2026 08:58
@thymikee

Copy link
Copy Markdown
Member Author

Rebased onto main at 47ff6db (force-with-lease). I squashed the branch's 12 commits into one first, so the conflict resolved once instead of per commit. Only website/docs/docs/commands.md conflicted: main edited the first back bullet (the macOS control wording) and this PR edits the iOS bullet below it. I kept main's first bullet and this PR's iOS bullet; main's iOS bullet was unchanged from the base. The Swift, protocol and command-surface files merged without conflicts. After the rebase: iOS and macOS runner unit targets build, check:xctest-selection, native-dupes and check:doc-prose pass, vitest on command-surface and repo-guards passes (425 tests), all 34 back tests pass on an iPhone 17 simulator, and the three Duo poses re-ran (found=yes pressed=yes confirmed=yes; lookup 729/732/656 ms open/half-open/closed).

@thymikee

Copy link
Copy Markdown
Member Author

Thanks for the rebase. The new head 47ff6db has the same code as the reviewed 8e0a343, so the earlier clean review still applies. The checks pass and there are no conflicts.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 15, 2026
@thymikee
thymikee merged commit 4882a3c into main Nov 15, 2026
22 checks passed
@thymikee
thymikee deleted the fix/4527-duo-back-button branch November 15, 2026 19:41
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.

iOS back: navigation bar button not found on iPhone Duo layouts (split view swipe changes nothing)

1 participant