Repository navigation
Fix Home dock Channels: the Chromium page gets the keyboard at its first open - #29386
Conversation
… page its tab shows PageWebViewShownInContainerTests: PageWebView.shown(in:) must name the page a container shows now (the docked Home's Channels page inside HomeDockView). It fails here: shown(in:) keeps the old rule (only a content that IS a page), the rule TabContent.childWindowTab has on feat. Because of it, Channels in Chromium never gets the keyboard at its first open (STATUS 1582): journey scripts/journeys/journeys/fuzz/found-desync-channels-type.json, red on feat f2f3083b (cmux19), on #29272 at 976b215 and at ad21c67 (whole host, mini scheduler, 2026-10-31 12:09-12:20Z): key window ShellWindow, first responder the hidden PageWKWebView.
…ard at its first open Channels in Chromium never got the keyboard at its first open (STATUS 1582; red on feat f2f3083b, #29272 at 976b215 and ad21c67, whole host, 2026-10-31). The dock focused the page before its Chromium page existed, so the hidden WebKit stand-in became first responder. At attach the page granted Chromium focus itself and its page window became key, but TabContent.childWindowTab saw only a page tab whose content IS a page. For the docked Home (an internal page whose content is HomeDockView) the focus applier found no Chromium page: it took the key change as unchosen, applied the model again, blurred Chromium pages and reclaimed the keys for the cmux window. Now a container view names the page it shows (PageWebViewContainer; HomeDockView: Channels while it shows), and childWindowTab finds it through PageWebView.shown(in:). The applier then gives the Channels page the keyboard like any page tab in Chromium (one key change, the page recorded), the page window's key change is the pane's own, and G1 counts that page window as its pane's.
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
Shipped in:
|
|
Found 1 test failure on Blacksmith runners: Failure
|
|
Review (claude-opus-5.5 independent reviewer): SHIP at acfd611 Scope: diff 967b0e9..acfd611 (HomeDockView.swift, CEFPageChromiumPage.swift, new PageWebViewContainer.swift, PageWebViewShownInContainerTests.swift, the journey JSON). I read the code with Verified (file:line at the head)
Notes (do not block)
|
|
Checks at acfd611 before ready-to-land: 2 red, both base findings. |
…he Channels page (#33869) * test(home): red: the page readers must find the Home dock's Channels page through its container HomeDockChannelsPageReadersTests: TabContent.inputReadiness and InternalPageView.focusTarget read only 'content as? PageWebView', so for the docked Home in Channels mode (the page inside HomeDockView, a PageWebViewContainer) the type-ahead has no input readiness and the focus target is the dock view. #29386 review note 3. Fails here. * fix(home): the type-ahead, the key router's focused page and the tab's focus target find the Home dock's Channels page #29386 review note 3. TabContent.inputReadiness, KeyRouter.focusedPage and InternalPageView.focusTarget now find a tab's page through PageWebView.shown(in:), the rule TabContent.childWindowTab already uses: the content itself when it is a page, else the page a PageWebViewContainer shows (the docked Home's Channels page while Channels shows). Before, for Channels: no type-ahead (keys typed at its first open were not held for the page), no page commands or page context from the key router, and on a WebKit fallback the dock view (which takes no keys) became first responder. Messages mode is unchanged: the dock shows no page there, and its primary input still comes first in focusTarget. * fix(home): the type-ahead stays off for the Home dock's Channels page Review of #33869 (FIX at 181170d): TabContent.inputReadiness through PageWebView.shown(in:) gave the docked Channels page a type-ahead hold. That page focuses no input when it opens, so its readiness stays not ready and the hold ate its own bare keys (j, k, r, t, c, e) until the 2 s limit. inputReadiness reads a page tab's own page again; the test now guards that a page a container shows gets no readiness. KeyRouter.focusedPage and InternalPageView.focusTarget keep the shown(in:) rule. The standalone Channels tab (its content is the page) has the same hold on bare keys today; that is not changed here.
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Summary
The docked Home's Channels page in Chromium never got the keyboard at its first open. The key window stayed the cmux window and its first responder stayed the hidden WebKit stand-in (
PageWKWebView), so typing into Channels went nowhere until a click. Found by the journeyfound-desync-channels-typewhile covering a review case of #29272 (STATUS 1582).Cause:
TabContent.childWindowTabfound a cmux page in Chromium only when a page tab's content IS the page. The docked Home is an internal page whose content isHomeDockView, and Channels is a page inside it. So for the dock the focus applier found no Chromium page. It took the page window's key change as unchosen, applied the model again, blurred Chromium pages and took the keys back for the cmux window.Fix: a container view names the page it shows now (
PageWebViewContainer;HomeDockViewnames Channels while Channels shows).childWindowTabfinds it throughPageWebView.shown(in:). The applier then gives the Channels page the keyboard as it does for any page tab in Chromium, and the page window's key change is the pane's own. Messages mode is unchanged (no page shows there).Testing
PageWebViewShownInContainerTests(CmuxNextPagesTests), commit bf49e3f. Fleet step 03d1e6b8ebf66877cde96fa7 failed on its own assertion (PageWebView.shown(in: dock) → nil).scripts/journeys/journeys/fuzz/found-desync-channels-type.json(this PR adds the file; the harness lands with journeys: the action fuzzer (correctness and speed) as a mode of the smoke-gate driver #29071). Run from a checkout of the harness branch, whole host, app active, through the mini scheduler (spec channels-keys-journeys), cmux20.Observed / Not run
Observed:
fuzz_daemon_agrees):G1: page window (618, 268, 892, 692) covers no pane. That is the false G1 that Fix desync after Cmd-N: a late Chromium page gets the keys through the focus model; G1 counts cmux pages #29272 fixes; this branch is cut from feat without it. Once Fix desync after Cmd-N: a late Chromium page gets the keys through the focus model; G1 counts cmux pages #29272 lands, that step is expected to pass.Not run:
debug.key's sequence mode has no event timestamp on the capture minis, so the journey reads the focus state, not a typed character.home.channels): there the content is the page itself, which the old rule already covered.Changelog
Fixed: Typing in Home's Channels view works the first time Channels opens, without a click first
Proof
No capture: there is no visual change; the change is which window holds the keyboard. The journey's frames are in its run folder.
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
Fixes the docked Home's Channels view in Chromium never getting the keyboard at its first open, so typing into Channels works without clicking first.
The focus applier only found a Chromium page when the page tab's content is the page itself. For the docked Home, an internal page whose content is
HomeDockView, Channels sits inside that view, so no Chromium page was found; the cmux window kept the keys and the hidden WebKit stand-in stayed first responder. A container view now names the page it shows (PageWebViewContainer;HomeDockViewnames Channels while Channels shows), andTabContent.childWindowTabfinds it throughPageWebView.shown(in:). The applier then gives the Channels page the keyboard like any other Chromium page tab. Messages mode shows no page, so it is unaffected.Written for commit daa0827. Summary will update on new commits.