Skip to content

Mark expected usage on the bars, and unhide Cursor on-demand (1.5.24) - #205

Merged
tsouth89 merged 2 commits into
mainfrom
feat/pace-marker-on-bars
Aug 5, 2026
Merged

Mark expected usage on the bars, and unhide Cursor on-demand (1.5.24)#205
tsouth89 merged 2 commits into
mainfrom
feat/pace-marker-on-bars

Conversation

@tsouth89

@tsouth89 tsouth89 commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Follow-up to #203 and #202, prepared as 1.5.24.

Why this exists

#203 put a pace verdict in MenuCard. <MenuCard renders in exactly one place — TrayPanel.tsx:466. The main app window is PopOutPanel, which renders ProviderDetailView, a component that change never touched. So the pace answer, and the Cursor on-demand dollars from #202, never appeared in the window most people use.

The marker

Every weekly and monthly bar in the Overview and in a provider's detail view now shows where usage should be. One rule everywhere: the marker is where the bar's edge should be right now.

Overspending fills the span between edge and marker with a striped band, so it reads as a distance rather than as a line you have to decode. Bars showing remaining capacity mirror the marker, and ahead is computed from usage rather than bar geometry so it means the same thing in both modes — pinned by a test asserting both modes agree on the same window.

Derived from elapsed / duration, not from PaceSnapshot. That means no provider support is needed and it applies to every long window, rather than the single window pace is computed for. Windows under 12h are skipped: a 5-hour session is not spent evenly, so a marker there would sweep across the bar and mean nothing.

Cursor on-demand

ProviderDetailView filtered it out by name:

.filter((metric) => !/promotional|on-demand/i.test(metric.label))

So #202's plumbing was landing correctly and being discarded at the last step. Filter removed; the On-demand row now shows with its spend beside it. (promotional no longer exists at all after #204.)

Two bugs only running the app could find

  1. .usage-bar collided with an existing component at styles.css:1831, which sets display: flex. My bar became a flex item, collapsed to zero width, and vanished — while the absolutely-positioned marker kept rendering, leaving markers floating with no bars. Renamed to .pace-overlay*.
  2. Red on red was invisible. On an exhausted bar the fill is already red, so a red marker and band disappeared into it. Both now use the text colour.

Neither was reachable from unit tests or a static mock.

Verification

Run against live provider accounts and screenshotted, plus 801 rust / 375 vitest, clippy clean, tsc clean, and local-check.ps1 -All -Version 1.5.24 green.

One stale test updated: ProviderDetailView.test.tsx asserted the filtered lane was absent. Its fixture now carries an on-demand window with money and asserts it renders.

The pace prediction existed but never reached the app window: the verdict
added in #203 lives in MenuCard, which only the tray renders. The window
uses ProviderDetailView, which nothing in that change touched.

- Mark where usage should be on every weekly/monthly bar, in the overview
  and in a provider's detail view. The marker is where the bar's edge
  should be right now, and it mirrors for bars that show remaining, so it
  reads the same either way. Overspending fills the span between edge and
  marker with a striped band, so the question is "how far ahead" rather
  than "which side of a line".
- Derive it from elapsed time against the window's own duration, not from
  PaceSnapshot. It therefore needs no provider support and applies to
  every long window, instead of the one window pace is computed for.
- Skip windows under 12h. A 5-hour session is not spent evenly, so a
  marker there would sweep across the bar and mean nothing.
- Stop filtering Cursor's on-demand lane out of the detail view. It is the
  only Cursor lane that bills real money and now carries that money beside
  its bar, so 1.5.23's overdraft work can finally reach the main window.

Verified by running the app against live accounts, which caught two things
tests could not: `.usage-bar` collided with an existing flex component and
collapsed every bar to zero width, and a red marker on an exhausted red
bar was invisible. The marker and band are now drawn in the text colour.
Copilot AI lite review requested due to automatic review settings August 5, 2026 04:46
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
ceiling 168d6eb Commit Preview URL

Branch Preview URL
Aug 05 2026, 04:53 AM

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 30 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5237abcc-6ff4-44b6-980a-2cdb904e2ea0

📥 Commits

Reviewing files that changed from the base of the PR and between 3a7dfe9 and 168d6eb.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (18)
  • .github/release-notes-1.5.24.md
  • CHANGELOG.md
  • apps/desktop-tauri/package.json
  • apps/desktop-tauri/src-tauri/Cargo.toml
  • apps/desktop-tauri/src-tauri/tauri.conf.json
  • apps/desktop-tauri/src/components/PlanStatusCard.tsx
  • apps/desktop-tauri/src/i18n/keys.ts
  • apps/desktop-tauri/src/lib/capacityPresentation.ts
  • apps/desktop-tauri/src/lib/expectedPace.test.ts
  • apps/desktop-tauri/src/lib/expectedPace.ts
  • apps/desktop-tauri/src/styles.css
  • apps/desktop-tauri/src/surfaces/ProviderDetailView.test.tsx
  • apps/desktop-tauri/src/surfaces/ProviderDetailView.tsx
  • rust/Cargo.toml
  • rust/src/locale.rs
  • rust/src/locale/en-US.ftl
  • rust/src/locale/zh-CN.ftl
  • version.env

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR prepares the 1.5.24 release and makes “expected by now” pacing visible in the main (Tauri) window by overlaying a time-based marker directly on weekly/monthly usage bars. It also ensures Cursor’s On-demand lane (the only real-money Cursor lane) is no longer filtered out in the provider detail view, and surfaces its dollar amount alongside the bar.

Changes:

  • Add a shared expected-usage overlay (tick marker + optional overspend band) derived from elapsed / duration, skipping windows under 12 hours.
  • Unhide Cursor On-demand in ProviderDetailView and display its monetary amount beside the bar; update tests accordingly.
  • Bump versions + add release notes/changelog entries for 1.5.24.

Reviewed changes

Copilot reviewed 18 out of 19 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
version.env Bump marketing/build numbers to 1.5.24/126.
rust/src/locale/zh-CN.ftl Add UsageExpectedByNow localization key (zh-CN).
rust/src/locale/en-US.ftl Add UsageExpectedByNow localization key (en-US).
rust/src/locale.rs Register UsageExpectedByNow in the locale key enum/macro list.
rust/Cargo.toml Bump Rust crate version to 1.5.24.
CHANGELOG.md Add 1.5.24 changelog entry describing the marker + Cursor on-demand visibility fix.
Cargo.lock Update locked package versions for 1.5.24 crates.
apps/desktop-tauri/src/surfaces/ProviderDetailView.tsx Add pace overlay to bars and remove on-demand filtering; render per-window amount.
apps/desktop-tauri/src/surfaces/ProviderDetailView.test.tsx Update fixture to include on-demand window amount and assert it renders.
apps/desktop-tauri/src/styles.css Add .pace-overlay* styles and required positioning for overlays.
apps/desktop-tauri/src/lib/expectedPace.ts New helper for computing expected usage marker/gap based on window timing.
apps/desktop-tauri/src/lib/expectedPace.test.ts New unit tests asserting overlay logic consistency across “used” vs “remaining” modes.
apps/desktop-tauri/src/lib/capacityPresentation.ts Plumb optional per-window amount through non-primary window construction.
apps/desktop-tauri/src/i18n/keys.ts Add UsageExpectedByNow to the frontend locale key list.
apps/desktop-tauri/src/components/PlanStatusCard.tsx Render pace overlay in overview meters using localized tooltip text.
apps/desktop-tauri/src-tauri/tauri.conf.json Bump Tauri app version to 1.5.24.
apps/desktop-tauri/src-tauri/Cargo.toml Bump Tauri Rust crate version to 1.5.24.
apps/desktop-tauri/package.json Bump frontend package version to 1.5.24.
.github/release-notes-1.5.24.md Add release notes describing the marker + on-demand detail view fix.
Suppressed comments (1)

apps/desktop-tauri/src/surfaces/ProviderDetailView.tsx:162

  • This newly added amount string uses a hardcoded "of", but the app already has a localized "PanelAmountOf" key used for the same pattern in other surfaces. Using the locale key keeps the amount display translatable and consistent.
          {metric.amount.formattedLimit
            ? `${metric.amount.formattedUsed} of ${metric.amount.formattedLimit}`
            : metric.amount.formattedUsed}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/desktop-tauri/src/surfaces/ProviderDetailView.tsx
Both the marker tooltip and the amount row hardcoded English in
ProviderDetailView, while the same strings already had locale keys used
elsewhere. Reuse UsageExpectedByNow and PanelAmountOf so the window
matches the overview and does not drift from the translations.
@tsouth89

tsouth89 commented Aug 5, 2026

Copy link
Copy Markdown
Owner Author

Right on both counts, fixed in the latest commit.

The tooltip in DetailProgress now uses UsageExpectedByNow, the key I added for exactly this and then failed to use here. The amount row on line 160 had the same problem with its "of" connector, which already had PanelAmountOf — now reused rather than hardcoded.

One knock-on: ProviderDetailView.test.tsx renders without a LocaleProvider, so t() returns key names and the joined string no longer matched. The assertion now matches the two amounts rather than the connector word, which is the part that actually matters.

801 rust / 375 vitest, clippy and tsc clean.

@tsouth89
tsouth89 merged commit d74f430 into main Aug 5, 2026
11 checks passed
@tsouth89
tsouth89 deleted the feat/pace-marker-on-bars branch August 5, 2026 04:57
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