Defer tracked menu data-refresh rebuilds - #1376
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 10, 2026, 3:10 AM ET / 07:10 UTC. Summary Reproducibility: no. high-confidence live reproduction was established in this read-only review. Current main source shows the direct open-menu rebuild path and the PR adds regression tests for deferral, but the reported WindowServer stall still needs packaged-app proof. Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the focused defer-rebuild implementation after inspectable packaged-app proof shows slow-provider refresh completions no longer stall the tracked menu. Do we have a high-confidence way to reproduce the issue? No high-confidence live reproduction was established in this read-only review. Current main source shows the direct open-menu rebuild path and the PR adds regression tests for deferral, but the reported WindowServer stall still needs packaged-app proof. Is this the best way to solve the issue? Yes, with proof pending. The patch uses existing invalidation and provider-switcher rebuild seams, keeps hosted-submenu/provider switching immediate, and no narrower source-level fix was apparent. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 20004f3d2e81. Label changesLabel justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
Defer parent-menu recomposition caused by provider data refreshes until menu tracking ends. Keep explicit provider switching and hosted submenu updates immediate. Co-authored-by: isaacJang <dltkr717@gmail.com>
279518b to
11117f4
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 11117f4fa0
ℹ️ 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".
| self.invalidateMenus( | ||
| refreshOpenMenus: true, | ||
| deferOpenParentMenuRebuild: true, | ||
| allowStaleContentDuringDataRefresh: true) |
There was a problem hiding this comment.
Refresh the menu after account-switch fetches finish
When a user switches a token/Codex account while the menu is open, the callers in StatusItemController+Menu.swift await the provider/account refresh and then call refreshOpenMenuIfStillVisible to update the visible menu with the newly fetched account-scoped data. This path now only invalidates with deferOpenParentMenuRebuild: true, which refreshOpenMenuIfNeeded handles by recording a deferral and returning, so the open parent menu can stay on the stale/intermediate account state until the user closes and reopens it instead of showing the completed refresh result.
Useful? React with 👍 / 👎.
Summary
This addresses the multi-second WindowServer stalls reported when slower providers finish while the status menu is open. The branch intentionally excludes the original Grok probe cleanup and investigation document.
Validation
make checkxcrun swift test --filter 'StatusMenuOpenRefreshTests|StatusMenuSwitcherClickTests|StatusMenuSwitcherTrackingTests'— 53 tests passedxcrun swift test— 3,403 tests passedmain— no actionable findings, 0.90 confidence