Repository navigation
Tray-anchored flyout: resize, drag-reorder, zoom + Claude OAuth auto-refresh - #1
Closed
darknight105 wants to merge 2 commits into
Closed
darknight105 wants to merge 2 commits into
darknight105 wants to merge 2 commits into
Conversation
Rework "Pop Out Dashboard" into a tray-anchored flyout (SurfaceMode::TrayPanel)
above the taskbar icon, so it no longer collides with the PopOut window
("Show Window").
- Anchored popover: always-on-top, blur-dismiss, skip-taskbar; left-click on the
tray toggles it. The frontend owns sizing: auto-fit to content until the user
drags an edge, then remember the manual size (persisted via set_flyout_size).
- DPI-safe sizing: use Tauri physical units end-to-end (innerSize + PhysicalSize)
behind an in-flight guard, fixing a scale-factor growth bug on 150% displays.
- Resize grips: a borderless WebView2 can't drive native edge-resize, so expose
top/left/corner grips that call startResizeDragging. This needs the
core:window:allow-start-resize-dragging capability, now granted.
- Keep the flyout open during resize/drag: the Win32 modal size loop and OLE
DoDragDrop each fire a transient Focused(false); a gesture guard suppresses
blur-dismiss, re-armed on refocus or after a 15s timeout.
- Provider drag-reorder: set dragDropEnabled=false so wry stops hijacking
Chromium's native drop target, then persist order via reorder_providers and
emit settings-changed so the detail cards follow.
- Zoom: a Windows-volume-style slider in the footer applies CSS zoom to the
surface (trayScalePercent 100-200%) and re-measures live; the footer pins to
the bottom when user-sized, and provider cards go side-by-side past 640px.
- Positioning: with no remembered geometry and no tray anchor, prefer the
primary monitor so the flyout/popout can't open off-screen on a secondary
display.
Co-Authored-By: Claude Fable 5 <[email protected]>
The Claude Code OAuth access token lives only ~8h. CodexBar read it but never used the refresh token, so usage requests failed with "sign-in expired" until the CLI happened to refresh it. Refresh proactively against the token endpoint when the token is near expiry, atomically writing back the claudeAiOauth block (preserving mcpOAuth) with an in-memory fallback and a re-read guard against a concurrent CLI refresh. Co-Authored-By: Claude Fable 5 <[email protected]>
Owner
Author
|
Superseded by upstream PR nesszer#120, rebased cleanly onto main (0.38.0). |
darknight105
added a commit
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.
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.
Summary
Reworks the tray experience and fixes several Windows-specific bugs found along the way. Built on the local combined-build base (window-mode title controls + canonical Claude pricing), so the diff here is just the two commits below.
Tray flyout (commit 1)
SurfaceMode::TrayPanel): always-on-top, blur-to-dismiss, skip-taskbar; left-clicking the tray toggles it. Previously "Pop Out Dashboard" and "Show Window" both mapped to the same PopOut window and collided.set_flyout_size).innerSize/PhysicalSize) behind an in-flight guard. Fixes a grow-on-every-open bug on 150% displays where logical / physical / Win32 scale factors disagreed.startResizeDragging. Root cause of "grips appear but never work": thecore:window:allow-start-resize-draggingcapability was never granted, so every call was denied by the ACL and swallowed by a.catch. Now granted (pluscore:window:defaultforinnerSize/scaleFactor, which the sizing bookkeeping depends on). ACL-gated calls no longer swallow errors silently.DoDragDropeach fire a transientFocused(false); without a guard the flyout hid the instant you pressed a grip or started a drag. A gesture-scoped guard suppresses blur-dismiss during the gesture, re-armed on refocus or after a 15s timeout.dragDropEnabled: falseon the main window so wry stops replacing Chromium's native OLE drop target (that hijack silently killed all in-page HTML5 drag-and-drop;dragover/dropnever fired). Order persists viareorder_providers, which now emitssettings-changedso the detail cards follow the new order.zoomto the surface (trayScalePercent, 100–200%, live preview + debounced persist), re-measured live so auto-fit tracks it; the footer pins to the bottom when user-sized; provider cards lay out side-by-side past 640px.Claude OAuth auto-refresh (commit 2)
The Claude Code OAuth access token lives only ~8h. CodexBar read it but never used the refresh token, so usage requests failed with "sign-in expired" until the CLI happened to refresh it. Now it refreshes proactively when the token is near expiry, atomically writing back the
claudeAiOauthblock (preservingmcpOAuth), with an in-memory fallback if the write fails and a re-read guard against a concurrent CLI refresh.Verification
tsc --noEmit: cleancargo test -p codexbar-desktop-tauri): 266 passedtauri build --no-bundle: success🤖 Generated with Claude Code