Skip to content

Reduce unnecessary redraws and improve tray interactions - #2

Merged
Finesssee merged 3 commits into
nesszer:mainfrom
janpio:reduce-tray-icon-redraws
Feb 25, 2026
Merged

Reduce unnecessary redraws and improve tray interactions#2
Finesssee merged 3 commits into
nesszer:mainfrom
janpio:reduce-tray-icon-redraws

Conversation

@janpio

@janpio janpio commented Feb 20, 2026

Copy link
Copy Markdown

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.

@janpio
janpio marked this pull request as ready for review February 22, 2026 20:41
@Finesssee
Finesssee merged commit ced733b into nesszer:main Feb 25, 2026
@Finesssee

Copy link
Copy Markdown
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants