Reduce unnecessary redraws and improve tray interactions - #2
Merged
Conversation
janpio
marked this pull request as ready for review
February 22, 2026 20:41
Collaborator
|
Thanks for the PR @janpio! The tray redraw optimization and the background polling fix for minimized windows are solid improvements. I've merged your PR! |
darknight105
added a commit
to darknight105/Win-CodexBar
that referenced
this pull request
Jul 3, 2026
…che by source Addresses review items #1 and nesszer#2 (structure/ownership, not behavior). #1 — `providers/claude/oauth.rs` had grown to ~1138 lines mixing usage fetching, refresh HTTP, refreshed-token caching, credential persistence, JSON patching and tests. Split into a directory module: - oauth/mod.rs — ClaudeOAuthFetcher: usage fetching + orchestration (fetch/fetch_usage/rate-limit/snapshot) + types. - oauth/refresh.rs — the OAuth token refresh HTTP call + its response type. - oauth/credentials_store.rs — credential loading (env/file/keyring), persistence, and the refreshed-credentials cache. The public surface is unchanged: `pub use oauth::ClaudeOAuthFetcher` still resolves (directory module), and ClaudeOAuthFetcher's external API (new/fetch/ fetch_with_access_token) is untouched. nesszer#2 — the refreshed-credential cache was a single process-global `Option<ClaudeOAuthCredentials>` shared across every credential source. Because `load_credentials` tries env→file→keyring and env tokens have no `expires_at`, a file-refreshed token could shadow a freshly-read environment token (the `(Some(_), None) => true` freshness arm). The cache is now `HashMap<CredentialSource, _>` keyed by an explicit `CredentialSource { Environment, File(path), Keyring(account) }`; `load_credentials` returns the source and `ensure_fresh_credentials` threads it through the cache lookup/store. Regression test `env_source_not_shadowed_by_file_cache` covers it. Behavior-preserving. cargo check clean; core `codexbar` 490 tests, tauri 280 tests, frontend 127 tests all green.
18 tasks
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.
Enhance the tray icon's performance by minimizing redraws, ensuring the main window restores correctly during refresh actions, and maintaining tooltip updates even when the icon remains unchanged.