← Back to Pull requests

fix(usage): redesign Usage popover as color-coded cockpit and fix provider links/auth states #2980

Open
unknown opened this pull request with 650 lines diff across 8 files
View on GitHub
unknown unknown commented on Dec 04, 2026 07:25 UTC
Author

Why


The top-right Usage menu had grown into a long monotone stack of boxed cards with a heavy header, redundant Antigravity links pointing at static docs instead of Google's AI credits page, a broken Cursor reconnect flow that re-polled into immediate failure beside an empty fallback row, and a confusing "Not signed in" badge on live remote readings.

What changed


  • Color-coded Usage cockpit: Replaced the heavy header and stacked grey provider boxes with a bare floating cockpit: a slim Usage top rail, a dusk-tinted DAEX Cloud strip at top, a 2-column color-coded provider bento deck with radial headroom rings (turning amber at 20% left and red at 5%), and the Month recap card at the bottom.

  • Inline provider details: Clicking any provider tile opens a full-width brand-accented tray directly beneath its row with all accounts, provider-colored headroom bars, hover breakdowns, and banked resets.

  • Per-provider settings cog & real links: Added a settings cog on every provider tile (and DAEX Cloud) that opens that provider's Settings page, pointed Antigravity's limits link to https://one.google.com/ai/credits, and removed the redundant "More on Google's page" footer link.

  • Cleaner auth & remote states: Stale unauthed extra providers with zero readings no longer linger, clicking Reconnect on an unauthed notice opens that provider's settings instead of re-polling, empty fallback rows are suppressed under status notices, and remote readings show On <machine> instead of a warning "Not signed in" badge.
  • !Usage cockpit: DAEX Cloud, color-coded bento deck, and Month card at bottom (left) + expanded Claude tray (right)<!-- ade-proof:903f7e71-2c55-4243-9a4a-bbff24f77a04 -->

    Evidence


  • npm --prefix apps/desktop test -- src/renderer/components/usage/usage.test.tsx src/renderer/components/usage/usageLimitModel.test.ts src/main/services/usage/providerAccountIdentity.test.ts: 123/123 passed.

  • npm --prefix apps/desktop run typecheck: passed.

  • npm --prefix apps/desktop run lint:ci: 0 errors, 0 new ade-ui violations.

  • Visual preview captured in DAEX Browser (?mockCloud=plus) showing DAEX Cloud dusk strip, 2-column color-coded bento deck, inline expanded Claude tray, and Month card at bottom.

  • Pending: /quality and /test passes in progress on this PR.
  • Not checked


  • Live Electron desktop run with real Antigravity / OpenCode remote readings (verified via unit tests and Vite preview mock data).
  • <!-- ade:link v=1 type=pr repo=arul28/ADE branch=fix%2Fprovider-usage-menu-cleanup num=2980 -->
    <p>
    <img src="https://ade-app.dev/icon-flat.png" height="18" align="left" alt="DAEX">
    &nbsp;&nbsp;<strong>Open in DAEX</strong>
    &nbsp;·&nbsp; <a href="https://ade-app.dev/open?type=branch&amp;repo=arul28%2FADE&amp;branch=fix%2Fprovider-usage-menu-cleanup&amp;pr=2980">fix/provider-usage-menu-cleanup branch</a>
    &nbsp;·&nbsp; <a href="https://ade-app.dev/open?type=pr&amp;repo=arul28%2FADE&amp;number=2980">PR #2980</a>
    </p>
    <!-- /ade:link -->

    <!-- greptile_comment -->

    <!-- greptile_summary -->

    <h2>Confidence Score: 4/5<a href="https://app.greptile.com/api/retrigger?id=129746111&amp;sig=4eae43beefdd4fc16bf208d4e34abc0dd90787804b16f925178fcd414dd5fc67"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/RetriggerDark.svg?v=2"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2"><img alt="Retrigger" src="https://greptile-static-assets.s3.amazonaws.com/badges/Retrigger.svg?v=2" align="right"></picture></a><a href="https://app.greptile.com/-/switch-tenant?tenant=versic&amp;next=%2Farul28%2Fdaex%2Fpull%2F2980&amp;utm_source=greptile_review&amp;utm_medium=github&amp;utm_campaign=view_in_greptile"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptileDark.svg?v=2"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptile.svg?v=2"><img alt="View in Greptile" src="https://greptile-static-assets.s3.amazonaws.com/badges/ViewInGreptile.svg?v=2" align="right"></picture></a></h2>

    <!-- greptile-risk -->

    The PR appears safe to merge, with non-blocking fixes recommended for tray collapse and spending-cap visibility.

    <h2>Findings<a href="https://app.greptile.com/ide/claude-code?prompt=%23%23%23%20Issue%201%0Aapps%2Fdesktop%2Fsrc%2Frenderer%2Fcomponents%2Fusage%2FUsageLimitsBand.tsx%3A439-442%0AWhile%20an%20undismissed%20status%20is%20not%20%60ok%60%2C%20%60autoAlertProviders%60%20keeps%20the%20tray%20open%20regardless%20of%20%60expandedProvider%60.%20Clicking%20Collapse%20changes%20only%20%60expandedProvider%60%2C%20so%20the%20tray%20stays%20visible%20while%20the%20caret%20and%20%60aria-expanded%60%20say%20it%20is%20closed.%20Track%20the%20user's%20choice%20separately%20from%20automatic%20expansion%2C%20and%20use%20the%20tray's%20actual%20visibility%20for%20the%20tile%20state.%0A%0A%23%23%23%20Issue%202%0Aapps%2Fdesktop%2Fsrc%2Frenderer%2Fcomponents%2Fusage%2FUsageLimitsBand.tsx%3A435-438%0AA%20successful%20Codex%20quota%20read%20can%20report%20both%20an%20%60ok%60%20status%20and%20%60spendControlReached%3A%20true%60.%20The%20cap%20notice%20now%20sits%20inside%20the%20tray%2C%20but%20that%20flag%20neither%20opens%20the%20tray%20nor%20marks%20the%20tile.%20Users%20can%20see%20available%20quota%20without%20the%20spending-cap%20explanation%20unless%20they%20expand%20Codex%20or%20find%20the%20age%20tooltip.%20Keep%20the%20notice%20outside%20the%20tray%2C%20or%20include%20the%20cap%20in%20the%20tile's%20alert%20and%20expansion%20rules.%0A%0A---%0A%0AFor%20each%20issue%20above%2C%20determine%20whether%20it%20is%20valid%20and%20should%20be%20fixed.%20If%20so%2C%20fix%20it%20directly.&repo=arul28%2Fdaex&pr=2980&platform=github"><picture><source media="(prefers-color-scheme: dark)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/FixAllInClaudeDark.svg?v=7"><source media="(prefers-color-scheme: light)" srcset="https://greptile-static-assets.s3.amazonaws.com/badges/FixAllInClaude.svg?v=7"><img alt="Fix All in Claude Code" src="https://greptile-static-assets.s3.amazonaws.com/badges/FixAllInClaude.svg?v=7" align="right"></picture></a></h2>

    1. <img alt="P2" src="https://greptile-static-assets.s3.amazonaws.com/badges/p2.svg?v=9" align="top">&nbsp;Provider details cannot collapse <a href="https://github.com/arul28/DAEX/pull/2980#discussion_r4796781366">▶</a>
    2. <img alt="P2" src="https://greptile-static-assets.s3.amazonaws.com/badges/p2.svg?v=9" align="top">&nbsp;Spending cap notice is hidden <a href="https://github.com/arul28/DAEX/pull/2980#discussion_r4796781373">▶</a>

    <details><summary>Fix with agent prompt</summary>

    `

    ### Issue 1
    apps/desktop/src/renderer/components/usage/UsageLimitsBand.tsx:439-442
    While an undismissed status is not `ok`, `autoAlertProviders` keeps the tray open regardless of `expandedProvider`. Clicking Collapse changes only `expandedProvider`, so the tray stays visible while the caret and `aria-expanded` say it is closed. Track the user's choice separately from automatic expansion, and use the tray's actual visibility for the tile state.
    
    ### Issue 2
    apps/desktop/src/renderer/components/usage/UsageLimitsBand.tsx:435-438
    A successful Codex quota read can report both an `ok` status and `spendControlReached: true`. The cap notice now sits inside the tray, but that flag neither opens the tray nor marks the tile. Users can see available quota without the spending-cap explanation unless they expand Codex or find the age tooltip. Keep the notice outside the tray, or include the cap in the tile's alert and expansion rules.
    
    ---
    
    For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
    
    `

    </details>

    <h3>Summary</h3>

    The PR replaces the stacked Usage cards with colored provider tiles and expandable account details.

  • The Usage popover puts provider headroom and account details into a compact cockpit.

  • Provider notices and remote readings show clearer sign-in states.

  • Provider actions open the matching settings and limits pages.
  • <!-- greptile_confidence_score:4 -->

    <sub>Reviews (1) · Last reviewed commit: "wip: checkpoint before quality" · Reviewed by Greptile</sub>

    <!-- /greptile_comment -->

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

  • New Features

  • - Redesigned the usage panel with a clearer cloud credits summary, freshness indicator, refresh control, and expandable provider cards.
    - Provider cards now show usage status and account details, with shortcuts to settings and provider limits.
    - Usage meters use provider-specific colors, with warning colors retained for low remaining usage.
    - Signed-out accounts with readings from another machine now identify that machine.

  • Bug Fixes

  • - Antigravity links now open the AI credits page.
    - Providers without an authenticated account or usage readings are no longer shown as available usage sources.

    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: greptile-apps[bot] Review duration: 10m
    All Vouch review confidence checks passed
    Residual risk 0.50 = Change Risk (0.80) × (1 − Review Confidence (0.38)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.80 · 650 lines diff across 8 files
    0.80
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 66% · Reviewer familiarity: 35%
    38%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.344
    Sensitive Paths sensitive_paths
    0.080
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #2980"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: medium confidence: 38.2% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 80.2% (HIGH) · Higher = larger blast radius
    80.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 38.2% · Lower = rushed or shallow review
    38.2%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 49.5% · Moderate risk
    49.5%
    Repository