Skip to content

feat(opencode): add configurable long window (weekly/monthly) - #200

Open
QI83 wants to merge 1 commit into
CodeZeno:mainfrom
QI83:feat/opencode-long-window
Open

QI83 wants to merge 1 commit into
CodeZeno:mainfrom
QI83:feat/opencode-long-window

Conversation

@QI83

@QI83 QI83 commented Oct 29, 2026

Copy link
Copy Markdown

Summary

Adds a configurable long window for the OpenCode provider. The OpenCode widget row currently shows the 5-hour session plus a single long window chosen automatically (whichever of the 7-day and 30-day windows is more constrained). This change lets the user pick which long window appears, through a new Long period dropdown in Settings → Providers → OpenCode with two options: Weekly (7d) and Monthly (30d), defaulting to Monthly.

Motivation

The auto-selection effectively hid the weekly window whenever the monthly window was larger, so users could not see their weekly usage at a glance.

Changes

  • UsageData gains a weekly_7d field carrying the raw 7-day window (the existing weekly field keeps its auto-selected value for other consumers).
  • New OpenCodeLongWindow { Weekly, Monthly } setting (default Monthly), exposed as a dropdown in the OpenCode settings.
  • Theme bindings: {opencode}.weekly_7d.* and {opencode}.long_window ("weekly" / "monthly").
  • The three bundled themes render the chosen long window (7d or 30d) as the second OpenCode row.
  • i18n: new Long period label plus Collect usage from OpenCode Go / Collect usage from Cursor descriptions across all 14 locales.

Testing

  • cargo build clean.
  • cargo test --bin claude-code-usage-monitor: 605 passed, 0 failed.
  • Manually verified the widget renders the selected window (weekly/monthly) in all three bundled themes.

Checklist

  • Tests pass
  • No changes to unrelated providers
  • All 14 locale files stay in key parity

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.

1 participant