Skip to content

Show tertiary window label instead of 'Extra' for OpenCode Go monthly bar - #197

Merged
tsouth89 merged 2 commits into
mainfrom
fix/tertiary-label
Aug 3, 2026
Merged

Show tertiary window label instead of 'Extra' for OpenCode Go monthly bar#197
tsouth89 merged 2 commits into
mainfrom
fix/tertiary-label

Conversation

@tsouth89

@tsouth89 tsouth89 commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Summary

The tertiary (monthly) bar in the Activity timeline showed "Extra" as its label instead of the window's actual purpose. This was because the tertiary rate window had no label field in the data model to carry a display name, unlike the primary and secondary windows.

Changes

  • Added tertiary_label: Option<String> to UsageSnapshot with a with_tertiary_label() builder
  • Set tertiary_label = "Monthly" in the OpenCode Go provider when monthly usage is available
  • Wired tertiary_label through the Tauri bridge to the frontend as tertiaryLabel
  • Updated the frontend capacityPresentation.ts to use the provider-defined label, falling back to "Extra" when not set

Verification

  • cargo fmt and cargo clippy: clean (both crates)
  • cargo test (codexbar): 780 passed
  • cargo test (tauri app): 464 passed
  • TypeScript typecheck: clean

Summary by CodeRabbit

  • New Features

    • Added support for custom labels on tertiary usage-rate windows.
    • Tertiary windows now display provider-specific labels when available.
    • Monthly usage windows are explicitly labeled “Monthly.”
  • Bug Fixes

    • Corrected tertiary window labeling to avoid always displaying a generic fallback.

Copilot AI review requested due to automatic review settings August 2, 2026 07:18
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 2, 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 21e3e83 Commit Preview URL

Branch Preview URL
Aug 03 2026, 04:12 AM

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

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: 52 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: d8fedcf3-263e-468d-96a9-4b91e86eccab

📥 Commits

Reviewing files that changed from the base of the PR and between 0ff91b3 and 21e3e83.

📒 Files selected for processing (1)
  • rust/src/providers/opencodego/mod.rs
📝 Walkthrough

Walkthrough

The change adds optional tertiary usage-window labels to Rust snapshots, bridge payloads, and TypeScript presentation. OpenCodeGo labels its monthly window as “Monthly”. Desktop test fixtures initialize the new field.

Changes

Tertiary label propagation

Layer / File(s) Summary
Usage label contract
rust/src/core/usage_snapshot.rs, rust/src/providers/opencodego/mod.rs
UsageSnapshot supports an optional tertiary label through initialization and a builder method. OpenCodeGo assigns "Monthly" to its monthly window.
Bridge and presentation propagation
apps/desktop-tauri/src-tauri/src/commands/bridge.rs, apps/desktop-tauri/src/types/bridge.ts, apps/desktop-tauri/src/lib/capacityPresentation.ts
The bridge copies tertiary_label into ProviderUsageSnapshot. The presentation uses tertiaryLabel and falls back to "Extra".
Snapshot fixture alignment
apps/desktop-tauri/src-tauri/src/{auto_refresh,capacity_events,enforcement,powertoys,quota_run_history,taskbar_widget,tray_bridge}.rs
Test snapshot fixtures initialize tertiary_label to None.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant OpenCodeGo
  participant UsageSnapshot
  participant Bridge
  participant capacityPresentation
  OpenCodeGo->>UsageSnapshot: assign "Monthly" tertiary label
  UsageSnapshot->>Bridge: serialize tertiary_label
  Bridge->>capacityPresentation: provide tertiaryLabel
  capacityPresentation-->>capacityPresentation: display label or "Extra"
Loading

Possibly related PRs

  • tsouth89/ceiling#4: Both changes modify ProviderUsageSnapshot and usage-window label handling.
  • tsouth89/ceiling#137: Both changes add provider-specific usage-window labels and related snapshot/UI plumbing.

Suggested reviewers: copilot, finesssee

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 44.44% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: displaying the OpenCode Go tertiary window as “Monthly” instead of “Extra”.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/tertiary-label

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.

🟢 Ready to approve

The new tertiary label field is correctly added to the shared model, serialized through the camelCase bridge, and consumed by the UI with an appropriate fallback, with no issues found in the reviewed diffs.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

This PR fixes the Activity timeline’s tertiary (monthly) bar label for the OpenCode Go provider by introducing a dedicated tertiary label field in the shared Rust usage model and wiring it through the Tauri bridge to the React frontend, so the UI can display a provider-defined name instead of the generic “Extra” fallback.

Changes:

  • Added tertiary_label: Option<String> to UsageSnapshot plus a with_tertiary_label() builder.
  • Set the OpenCode Go monthly window’s label to "Monthly" when monthly usage is present.
  • Plumbed the new field through the Rust→TS bridge (tertiary_labeltertiaryLabel) and updated the frontend presentation logic to prefer it over the “Extra” fallback.
File summaries
File Description
rust/src/providers/opencodego/mod.rs Sets the tertiary window label to "Monthly" when monthly usage is available.
rust/src/core/usage_snapshot.rs Adds tertiary_label to the shared usage snapshot model and a builder to set it.
apps/desktop-tauri/src/types/bridge.ts Extends the TS bridge type to include tertiaryLabel?: string.
apps/desktop-tauri/src/lib/capacityPresentation.ts Uses provider.tertiaryLabel when computing the tertiary window label, falling back to "Extra".
apps/desktop-tauri/src-tauri/src/commands/bridge.rs Adds tertiary_label to the Rust bridge struct and maps it from UsageSnapshot.
apps/desktop-tauri/src-tauri/src/tray_bridge.rs Updates test snapshots/fixtures to include tertiary_label: None.
apps/desktop-tauri/src-tauri/src/taskbar_widget.rs Updates test snapshots/fixtures to include tertiary_label: None.
apps/desktop-tauri/src-tauri/src/quota_run_history.rs Updates test snapshots/fixtures to include tertiary_label: None.
apps/desktop-tauri/src-tauri/src/powertoys.rs Updates test snapshots/fixtures to include tertiary_label: None in two test fixtures.
apps/desktop-tauri/src-tauri/src/enforcement.rs Updates test snapshots/fixtures to include tertiary_label: None.
apps/desktop-tauri/src-tauri/src/capacity_events.rs Updates test snapshots/fixtures to include tertiary_label: None.
apps/desktop-tauri/src-tauri/src/auto_refresh.rs Updates test snapshots/fixtures to include tertiary_label: None (including a fixture with a tertiary window).
Review details
  • Files reviewed: 12/12 changed files
  • Comments generated: 0
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

@tsouth89
tsouth89 merged commit 3894962 into main Aug 3, 2026
11 checks passed
@tsouth89
tsouth89 deleted the fix/tertiary-label branch August 3, 2026 04:38
@tsouth89 tsouth89 mentioned this pull request Aug 3, 2026
tsouth89 added a commit that referenced this pull request Aug 3, 2026
## Summary

Prepares **Ceiling 1.5.22**, carrying three changes merged since
v1.5.21:

- **#198** - Fix 1% usage reading as 100% across providers (OpenCode Go,
OpenCode, Qoder, Chutes, Sakana)
- **#197** - OpenCode Go monthly bar labeled "Monthly" instead of
"Extra"
- **#196** - Fix Microsoft Store installer parameters (40-char Partner
Center limit)

Bumps all version sources to 1.5.22 (build 124), moves the Unreleased
CHANGELOG section into a versioned 1.5.22 entry (adding the missing
#196/#197 notes), and adds `.github/release-notes-1.5.22.md`.

## Changes

- `CHANGELOG.md` - retitle Unreleased to `[Ceiling] 1.5.22 -
2026-08-03`, add #196/#197 entries
- `version.env` - `MARKETING_VERSION=1.5.22`, `BUILD_NUMBER=124`
- `rust/Cargo.toml`, `apps/desktop-tauri/src-tauri/Cargo.toml`,
`apps/desktop-tauri/package.json`,
`apps/desktop-tauri/src-tauri/tauri.conf.json`, `Cargo.lock` - version
1.5.22
- `.github/release-notes-1.5.22.md` - new release notes

## Validation

`powershell.exe -ExecutionPolicy Bypass -NoProfile -File
scripts\local-check.ps1 -All -Version 1.5.22` passes, including the
release doctor for 1.5.22 (all version sources consistent, CHANGELOG
mentions 1.5.22) and the Store submission preparation test. Expected
pre-tag warnings only: local tag v1.5.22, local release assets, and
GitHub release not found yet.

After this merges and checks are green, push annotated tag `v1.5.22` to
trigger the `Signed Windows Release` workflow.

Co-authored-by: tsouth89 <tsouth89@users.noreply.github.com>
tsouth89 added a commit that referenced this pull request Aug 3, 2026
## Summary

The taskbar strip picks the constraining usage window and shows its
label, but for the tertiary window it hardcoded the label to `"Extra"`
and ignored the `tertiary_label` that #197 added to the data model.
OpenCode Go's monthly bar therefore still read "Extra" on the taskbar
even though the React surfaces (flyout, activity timeline) correctly
showed "Monthly".

The native `taskbar_widget.rs` is the mirror of
`capacityPresentation.ts`'s `constrainingWindow` (SOU-288); #197 updated
the frontend but not this mirror. This change aligns them: the strip now
uses `snapshot.tertiary_label` with `"Extra"` as the fallback when no
label is set.

## Changes

- `apps/desktop-tauri/src-tauri/src/taskbar_widget.rs` - use
`tertiary_label.as_deref().or(Some("Extra"))` in `constraining_readout`;
add regression tests for both the labeled ("Monthly") and unnamed (falls
back to "Extra") tertiary paths.

## Validation

- `cargo test --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml`:
466 passed (taskbar_widget: 28 passed, including the 2 new regression
tests, which fail against the old hardcode).
- `cargo fmt --all` clean; `cargo clippy --all-targets -- -D warnings`
clean.

Co-authored-by: tsouth89 <tsouth89@users.noreply.github.com>
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