Skip to content

fix(widget): headline a used-up window in the bar and card header - #106

Merged
bernardopg merged 3 commits into
mainfrom
fix/bar-exhausted-window
Nov 8, 2026
Merged

bernardopg merged 3 commits into
mainfrom
fix/bar-exhausted-window

Conversation

@bernardopg

Copy link
Copy Markdown
Owner

Stacked on #105. Merge the stack bottom-up with a merge commit; until #105 merges, this diff also shows its commits.

Summary

Split out of #101 (the "exhausted multi-window promotion" part by @DotRedstone, credited as co-author) and narrowed to display.

A Codex or Claude account blocked by its weekly limit kept showing its idle 5 hour window in the bar: 0% used, or 100% left in green, while every request failed. #101 fixed this by changing primaryUsageWindow(). That function also drives sorting, the hero, the fleet rollup, history and notifyWindowScope=primary, so the history series would have switched windows silently.

This PR keeps primaryUsageWindow() unchanged and adds BarWindows.headlineWindow(). It returns the primary window, unless the primary still has room while a later window is used up (≥ 100%). Only exhaustion promotes a window; a busy but usable weekly window never does.

  • Bar pill: shows the headline window when the provider has no barWindowOverrides pair.
  • Card header (percentage and ring): shows the headline window.
  • Unchanged: sorting, hero, fleet rollup and history keep the primary window. With the default notifyWindowScope=displayed, alerts follow the window the bar shows, as documented.
  • Settings: the bar window dropdown gains Automatic (the default, stored as no pair) in all five locales. Primary becomes an explicit choice that is stored and keeps the primary window even when another one is exhausted.

Tests:

  • tests/test-qml-smoke.sh: unit checks for headlineWindow, isExhausted and windowsFor.
  • tests/test-widget-runtime.sh: renders the exhausted case. It checks the pill text, the card header text, that providerPercent() and primaryUsageWindow() still return the primary window, the notification window, and the explicit codex:primary override. It also checks that Automatic/Primary persist in settings.

I ran it natively on Wayland and confirmed it fails when the default falls back to the primary window.

Docs: configuration.md, architecture.md, troubleshooting.md and a CHANGELOG bullet.

Related issues

Part of #101.

Type of change

  • New provider
  • Bug fix
  • Enhancement
  • Documentation / i18n
  • CI / tooling

Checklist

  • plugin.json .version and CHANGELOG.md are consistent (not release-bearing; ## Unreleased bullet)
  • New/changed provider scripts are executable and emit valid JSON
  • i18n/en.json keys have translations in every locale
  • Every commit is signed off (git commit -s) under the DCO
  • CI is green

Local gates: check-metadata, check-changelog, check-dco, bash -n, shellcheck -S warning, qmllint, actionlint, gitleaks, every tests/test-*.sh (including the native widget runtime on Wayland), and AIOC_COVERAGE_MIN=95 scripts/coverage.

bernardopg and others added 2 commits November 8, 2026 15:51
A Codex or Claude account blocked by its weekly limit kept showing the
idle 5 hour window in the bar, reading 0% used or 100% left in green
while every request failed. Without a barWindowOverrides pair the bar
and the card header now show BarWindows.headlineWindow(): the primary
window, unless a later window is used up while the primary still has
room.

The promotion is display only. primaryUsageWindow() still drives
sorting, the hero, the fleet rollup and history, so their series keep
their meaning. The settings dropdown gains Automatic for the default,
and Primary becomes an explicit choice that is stored and keeps the
primary window.

Co-authored-by: dotredstone <[email protected]>
Signed-off-by: Bernardo Pinto Gomes <[email protected]>
@github-actions github-actions Bot added documentation Improvements or additions to documentation area:providers Provider adapters (providers/) area:i18n Translations (i18n/) area:qml QML UI code area:ci CI, workflows, tooling labels Nov 8, 2026
@github-actions github-actions Bot removed the area:providers Provider adapters (providers/) label Nov 8, 2026
@bernardopg
bernardopg merged commit de8ea11 into main Nov 8, 2026
20 checks passed
@bernardopg
bernardopg deleted the fix/bar-exhausted-window branch November 8, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci CI, workflows, tooling area:i18n Translations (i18n/) area:qml QML UI code documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant