Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why this helps
On Windows, Codex Switcher currently starts an invisible WebView2 just for the tray popup, even if you never open that menu. Hiding the popup leaves that browser process around. It's extra memory for something most people only check occasionally.
This PR creates the tray popup when it's first opened and releases it after 90 seconds hidden. The native tray menu, account switching and background quota updates remain available. Opening the popup after it has been released may take a little longer.
What changed
Testing
I've already tested the Windows optimization work in my own fork, including RAM measurements with the Switcher open and in the tray. Before those changes, I measured around 436 MB with the window open and 365 MB in the tray (Switcher plus WebView2). In the newer build I saw around 275 MB open and 167–233 MB in the tray after a fresh PC startup.
Those are real observations from my fork, which includes other memory optimizations as well. They aren't an isolated before/after benchmark for this three-file PR, and the results can vary with runtime conditions.
This branch is based directly on upstream
main. All six CI checks passed: Rust tests/format, Windows and macOS compilation, frontend, Linux startup and updater. A Windows GUI smoke test of this exact upstream patch would still be useful before merging.Related but separate from #222, which addresses tray context-menu refresh behavior.