Skip to content

dogfood port: cmux next focus: no reclaim inside the grant of a page that still has focus (port of #25689) - #32654

Draft
lawrencecchen wants to merge 2 commits into
cp/dogfood-v2-2-12-optfrom
cp/port-25689-page-focus-grant
Draft

lawrencecchen wants to merge 2 commits into
cp/dogfood-v2-2-12-optfrom
cp/port-25689-page-focus-grant

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Port to the dogfood line of feat #25689 (no reclaim inside the grant of a page that still has focus). On cp/dogfood-v2-2-12-opt, ChildPageFocus.reclaim had no grant guard: the page window's own didBecomeKey inside a focus grant could re-apply the model, and its reclaim gave the keys straight back to the cmux window (two key changes; the page kept focus with no keys). This holds the browser P0 on dogfood (STATUS 7582 and 7809; REOPEN VIDEO journey cycle A fails 1 of 3 on dogfood for this reason).

What this PR takes, exactly:

  1. 5f16828addc: from feat cmux next: cmd-n's new tab chat takes the keyboard, and the arrow keys come back to the text #25222 (b36320b), only the granting state of ChildPageFocus (a private Bool set in focus(_:) around setFocus). Not taken: keysReturned(to:during:), its app callers (FocusEffectApplier, KeyWindowRole), NSWindow+ChromiumPage.swift, its tests and all its webviews changes. The guard reads only granting.
  2. 514a623397b: feat cmux next focus: no reclaim inside the grant of a page that still has focus #25689 (002c20e), cherry-pick -x with no conflict: reclaim returns while granting && page != nil, and the test reclaimInsideTheGrantAfterThePageBlurredTakesTheKeysBack (a blur inside the grant still reclaims).

The regression test ChildPageFocusKeyChangeTests.aReapplyInsideTheGrantDoesNotGrantAgain is already on the dogfood line, so the red run is the dogfood base itself.

CEFTabHostFocusTests.aPageWindowTargetNeverTakesFirstResponder (fails on the dogfood base, same STATUS 7582) is NOT fixed by these feat commits, and no feat commit fixes it: the test and the .pageWindow input target exist only on the dogfood line (37d2d85). Merge 259ac77 ("Merge perf/chrome-parity into the p13-webui-030 integration") brought back the unconditional becomeFirstResponder of a814b7a in ChromiumHostPageView, so makeFirstResponder on a .pageWindow view succeeds. That needs its own dogfood fix; it is not in this PR.

Testing

Fleet, dogfood suite filter (scripts/ci/package-test-lane.sh suite Packages/macOS/CmuxNext ChildPageFocusKeyChangeTests), display worker gui-session-v1:

  • Red on the dogfood base 5b50f8bb57ac6d0964fb9c75146a3423a0ceeeb2: step 6a1db195f55ae829a1b6ff4a: FAILED as expected ("Test run with 6 tests", 1 issue): aReapplyInsideTheGrantDoesNotGrantAgain saw key-window changes ["pageB", "cmux"], expected ["pageB"]
  • Green at the exact head 514a623397b07da136afd56af0bceda7cb63bd76, 5 runs one after another: 1/5 fd7dd53b6cb7db07aa242f32 PASSED, 2/5 4cffa8a7692b750f97d03bf8 PASSED (each "Test run with 7 tests in 1 suite passed"); 3/5 174d9d7211e0211e4aca5ded PASSED; 4/5 68b90c9e48f4cea49a648fc8 PASSED (each "Test run with 7 tests in 1 suite passed"); 5/5 1357853d98e9c46a69829b93 CANCELLED when the dogfood ports stopped (4 of 5 greens)
  • Compile cmux-ci compile-check --app --package CmuxNext --recipe-version 2 at the head: job b9cea9ab5180b3526b4c8f02: PASSED
  • prepush-gate.py --base origin/cp/dogfood-v2-2-12-opt: no new violations.

Observed / Not run

  • Observed: the steps above.
  • Not run: the REOPEN VIDEO journey cycle A on a dogfood build of this head (the REOPEN VIDEO owner films it); CEFTabHostFocusTests (not changed here, see above).

No capture: focus logic with no visible UI change.

Changelog

none

lawrencecchen and others added 2 commits November 2, 2026 23:29
…ting state of #25222)

The granting state the reclaim guard of #25689 reads. Only this part of #25222: its keysReturned API, its
app callers (FocusEffectApplier, KeyWindowRole), NSWindow+ChromiumPage and its webviews changes are not on
the dogfood line and the guard does not need them. No behavior change by itself.

(cherry picked from commit b36320b, ChildPageFocus granting state only)
… focus (#25689)

* cmux next focus: test that a reclaim inside a grant still takes the keys back once the page blurred

aReapplyInsideTheGrantDoesNotGrantAgain (red on feat-cmux-next since #24913)
covers the other half: a reclaim inside the grant while the page still has focus.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* cmux next focus: no reclaim inside the grant of a page that still has focus

The grant's own key change (the page window's didBecomeKey) could re-apply the
model, and its reclaim gave the keys straight back to the cmux window: two key
changes, and the page stayed focused with no keys. keysReturned already treats
key changes inside a grant as the grant's own; reclaim now does too, while the
granted page still has focus. After a blur inside the grant it still reclaims.

Fixes aReapplyInsideTheGrantDoesNotGrantAgain, red on feat-cmux-next since
#24913 and surfaced by
#25222 swift test run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Leo <cheerleaderleo@outlook.com>
(cherry picked from commit 002c20e)
@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Not needed: the dogfood line is retired as a dogfood source; dogfood builds come from the feat tip (lead, STATUS 7979). Feat already has this guard (#25689).

@lawrencecchen
lawrencecchen marked this pull request as draft November 3, 2026 01:28
@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Not needed: the dogfood line is retired as a dogfood source (Lawrence, 2026-11-03); dogfood builds come from the feat tip, which has this fix.

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

risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants