Repository navigation
perf(ui): defer menu navigation until first open - #181024
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
# Conflicts: # config/control-ui-startup-budget-baseline.json
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8004eaef32
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| { | ||
| "startupJsGzipBytes": 315696, | ||
| "reason": "Keep the stricter startup baseline after runtime English deferrals; measured head 315926 B", | ||
| "startupJsGzipBytes": 315967, |
There was a problem hiding this comment.
Keep the startup baseline from moving upward
This raises the enforced startup baseline from 315,696 B to 315,967 B even though the measured candidate is only 315,928 B and the change reports a 34 B reduction. Because the checker adds its 512 B growth tolerance and 64 B build variance to this value, the edit silently permits an additional 271 B of future startup growth; the candidate already fits under the previous enforcement limit, so retain the existing baseline rather than weakening the regression gate.
Useful? React with 👍 / 👎.
|
Codex review: needs changes before merge. What this changesThis PR loads menu navigation on first opening while retaining synchronous native opening, focus, and pointer activation. Example: Open Chat without opening a menu.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readiness⛔ Needs changes before merge - 2 items remain Keep open: this PR provides a useful boot reduction, but queued Home/End navigation can activate the wrong row, and existing consumer tests need to accommodate deferred completion. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe shared Control UI menu binding connects native overlay lifecycle and rendered controls to Zag keyboard navigation, highlighting, and submenu behavior. flowchart TD
A[Menu and picker callers] --> B[Synchronous menu binding]
B --> C[Native overlay lifecycle]
B --> D[Deferred runtime import]
D --> E[Zag navigation]
E --> F[Item focus and activation]
Technical reviewBest possible solution: Keep one deferred Zag runtime, settle its focus publication before replaying subsequent keys, and update affected consumer assertions without weakening their behavior checks. Do we have a high-confidence way to reproduce the issue? The eager boot import is visible on current main; the introduced replay defect follows from the pinned scheduler contract and is supported by the failing production-page Mermaid sequence, without a local reproduction run. Is this the best way to solve the issue? Deferring the existing navigation owner is appropriate, but replay must wait for its resulting focus before another key can derive a target. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3412694c1977. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +285, Tests +159, Other 0. Total +444 across 11 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 22, 2026, 6:39 PM ET / 22:39 UTC. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 52ec3d6b3f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (context.get("anchorPoint")) { | ||
| action(["reposition"]); | ||
| loading = true; | ||
| setError(undefined); |
There was a problem hiding this comment.
Restore focus after a successful menu-runtime retry
When a non-stale runtime import fails once and then succeeds on Retry, this immediately clears the error and removes the focused retry button while the overlay remains open. The subsequent initialization only adopts an already-focused menu item, so focus falls to body and keyboard input no longer reaches the open menu; preserve the retry control until loading settles or explicitly restore focus to the menu/input after success. .agents/skills/solid/references/overlays.mdL34-L39
Useful? React with 👍 / 👎.
# Conflicts: # scripts/check-control-ui-performance.mts
|
Merged via squash.
|
* perf(ui): defer menu navigation until first open * perf(ui): ratchet deferred menu boot budgets * perf(ui): preserve menu boot headroom after main merge * fix(ui): break lazy menu navigation import cycle * fix(ui): preserve focus during lazy menu navigation * fix(ui): preserve cold menu clicks through focus changes * test(ui): await lazy multi-select initial highlight * fix(ui): retain cold menu entry highlight * fix(ui): avoid echoing menu-owned focus into navigation * perf(ui): ratchet deferred menu boot caps on current main * test(ui): await account adoption before palette reopen * perf(ui): refresh boot graph after main integration * perf(ui): ratchet combined menu boot caps
What Problem This Solves
Closed menus loaded Zag navigation during Chat and New Session boot. Defer that runtime until a menu opens. The existing native overlay keeps admission, dismissal, initial focus, item DOM and pointer activation synchronous; one Zag implementation takes over keyboard navigation after loading. Queued input preserves order, retained-focus listboxes and embedded controls remain actionable, and a failed import has a visible retry.
The cold facade also preserves native item selectors, initial-row scrolling, and Zag pointerdown focus prevention. Without the last behavior, focusing a trigger settled its ancestor animation and moved it 24 px before pointerup, causing a real click to miss. The shared/personal rejected-publication recovery cases and a focused pointerdown regression verify the repair. Right-click and macOS Control-click retain their native behavior.
Performance
Matched same-machine production builds: base source
4f8cf06b18925ff494a305ac364cdbb8271227fe, candidate runtime source6cdc426ae6b, Node 26.12.1. Candidate includes current mainfb824384939; that revision has no UI/shared-source or budget difference from the measured base. Both builds have exactly identical fixed build metadata, includingdirty: false, and the same 29 verified packaged-plugin files. Both use build IDsolid2-boot-comparison; these controlled metadata inputs are distinct from actual source identity.Startup CSS is unchanged: 41,124 B gzip / one request. The strict matched comparison has zero violations and warnings. Caps fall from 1,439,860/871,648 B to 1,405,102/837,725 B, using
ceil(candidate × main cap / measured main)to preserve relative headroom. Route request caps remain 25/19, two above observed use. No startup baseline is raised. The original split reduced one route request; current main's additional chunk changes make final request counts equal while retaining the byte reduction.Production LOC across seven affected modules: 2,252 → 2,627 (+375). Growth is the synchronous facade, loading/error handling and ordered replay around the deferred runtime; there is no second navigation implementation. Refactor census: one effect, four
untrack, zero render effects/direct DOM listeners/queries/flush/Solid owner APIs.Evidence
fb824384939integratione27926chead: 2 failures; focus-echo guard: 2/2 passed7106175, green after entry-highlight repair; assertions unchangedalphainstead ofbeta); final guarded loading suites 10/10 Chromium and 10/10 WebKitci:full2d61b9691b4504deaabc166118246e079176480f: run 39879246857, including all UI E2E and real-Gateway shardsThe trigger-Space CI failure was reproduced locally: if native entry focused a row but the user returned to the trigger before the import resolved, the runtime lost that row highlight. The synchronous facade now forwards row-focus events through the existing ordered queue, and the duplicate runtime-only handler is removed. Exact-head UI CI then exposed a focus echo: the warm runtime refocused its current row after scheduling ArrowDown, queuing that old highlight after the navigation. The facade now compares against the live runtime highlight before queuing focus. Both original footer cases fail on the preceding head and pass with this guard; no state or second focus owner was added. The original E2E assertions pass unchanged.
Run
39877171146exposedcommand palette file drops > retains a dropped draft across reconnect and retires it for another account: the palette still showed Alice’s draft. The test had reopened after transport connection, before theusers.selfresult adopted Bob and retired the old launcher. It now controls that profile response and waits for Bob before reopening. The exact case passes against the existing production build (1 passed, 3 skipped); blank draft, zero attachments, and no session creation remain asserted. This test-only correction changes no production bytes or timing path. The following current-main merge resolved only conflicting budget values; the official boot manifest was regenerated and the fresh same-input byte comparison is above. The Node test runtime is required by Playwright.The browser test updates await observable lazy content/highlight readiness, while retaining directional, disabled-row, permission and focus assertions. The dedicated delayed-import suite separately protects queued keyboard input. No local full E2E suite was run.
Prior-runtime timing evidence, not a new timing claim after main integration: ten serial alternating cold-cache pairs on the same Blacksmith Testbox, 240 transcript messages, untraced. Predeclared acceptance allowed at most 5% median regression and no p95 worsening for transcript and enabled composer. Transcript median 433.35 → 373.75 ms; p95 587.7 → 531.9 ms. Composer median 432.35 → 373.0 ms; p95 586.7 → 530.9 ms. Both passed. Remote proof run. This timing used original base
e875ec9c918c523373f37d66a53468667faf58bd; subsequent interaction fixes and current-main integration preserve the deferred runtime/import boundary but have not been re-timed as a combined head. Current byte proof above is fresh. Both task Testbox leases are completed; no active lease remains.Synthetic screenshots
Inspected full-frame synthetic fixture captures; no private user data or credentials. Before opening the menu, its navigation runtime is absent from the boot graph. The middle image holds that import pending; the final image shows queued keyboard navigation replayed after it resolves: