Skip to content

feat(bar): show several quota windows of one provider in the pill - #87

Merged
bernardopg merged 3 commits into
mainfrom
feat/bar-multi-window
Oct 29, 2026
Merged

bernardopg merged 3 commits into
mainfrom
feat/bar-multi-window

Conversation

@bernardopg

Copy link
Copy Markdown
Owner

Summary

The DankBar pill showed one quota window per provider, so a Claude user had to choose between the 5 hour and the 7 day number, and could not tell which one the bar showed without hovering.

DankBar usage window (barWindowOverrides) now accepts a set of windows:

  • Primary + secondary (claude:primary+secondary) and All windows (claude:all) join the existing Primary / Secondary / Tertiary / Highest choices.
  • Each shown window is tagged with its length and coloured on its own: Claude 5h 45% / 7d 80%. The vertical bar stacks the tag above each percentage. The tooltip names every window, with its reset when one provider is shown.
  • top and auto pill modes rank such a provider by its highest window; with the default notifyWindowScope=displayed, every shown window raises its own alert.
  • Absent windows are skipped (Claude's tertiary only exists with a model-scoped limit); when none of the chosen windows exists, the primary window is shown, so an override never blanks the bar.
  • Single-window choices render exactly as before.

Slot parsing moves to BarWindows.js, shared by the widget and the settings body, which previously each carried a copy. Settings stores sets in canonical order (secondary+primary → primary+secondary, all three → all).

"Windows that raise alerts" now describes the displayed windows in the plural, and the bar-window description keeps its 5h 45% / 7d 80% example on one line in German and Spanish.

Related issues

Closes #86

Type of change

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

Migration

Existing barWindowOverrides values keep their meaning. BarWindows.js is a new QML module: a hot reload leaves the plugin disabled with File name case mismatch, so the upgrade needs one dms restart (noted in CHANGELOG.md).

Testing

  • tests/test-qml-smoke.sh: 14 checks on BarWindows.js (canonical slots, invalid/duplicate parts, alias-aware parsing, absent-window fallback, highest, maxPercent).
  • tests/test-widget-runtime.sh: renders the real horizontal and vertical pills with claude-work:primary+secondary and checks the tags, per-window percentages, tooltip, notifyWindowsFor(), and the canonical value Settings stores.
  • Both new assertions were mutated once to confirm they fail.
  • Every tests/test-*.sh, check-metadata, check-changelog, check-dco, qmllint, shellcheck, actionlint, git diff --check and gitleaks pass locally.
  • Manually on a live DMS 2.0 session (Hyprland): Primary + secondary and All windows in the bar and tooltip, back to Primary removing the pair; settings, dropdown, pill and popout in pt_BR, de_DE, zh_CN and es_ES.

Limitations

  • Local kcov 43 reports 93.41% statement coverage because of its known multi-line SQL tracking bug; this PR changes no covered bash, and CI measures with the pinned kcov build.
  • zizmor was not run locally; no workflow changed.

Checklist

  • plugin.json .version and CHANGELOG.md are consistent (only if this is a release-bearing change; both version pills read the manifest at runtime)
  • New/changed provider scripts are executable and emit valid JSON
  • i18n/en.json keys have translations in every locale (or the strings are user-neutral)
  • Every commit is signed off (git commit -s) under the DCO
  • CI is green

The pill showed one window per provider, so a Claude user had to pick the
5 hour or the 7 day number and could not tell which one it was without
hovering (#86). barWindowOverrides now accepts a set of windows
("primary+secondary", or "all"), and Settings offers both next to the
single-window choices. Each shown window gets its length tag and its own
usage colour ("5h 45% / 7d 80%"); the tooltip names every window.

Slot parsing moves to BarWindows.js so the widget and the settings body
read the same vocabulary. top/auto ranking uses the highest shown window,
and notifyWindowScope=displayed alerts on every shown window. Absent
windows are skipped, and the primary window still backs a choice the
payload cannot satisfy.

Closes #86

Signed-off-by: Bernardo Pinto Gomes <bernardopgomes@hotmail.com>
… whole

"Windows that raise alerts" still said the default alerts on the single
window the DankBar shows; with a multi-window override it alerts on each
of them. The bar-window description's "5h 45% / 7d 80%" example wrapped
mid-value in German and Spanish, so it now uses non-breaking spaces.

Signed-off-by: Bernardo Pinto Gomes <bernardopgomes@hotmail.com>
Signed-off-by: Bernardo Pinto Gomes <bernardopgomes@hotmail.com>
@github-actions github-actions Bot added documentation Improvements or additions to documentation area:i18n Translations (i18n/) area:qml QML UI code area:ci CI, workflows, tooling labels Oct 29, 2026
@bernardopg
bernardopg merged commit 3602b7e into main Oct 29, 2026
20 checks passed
@bernardopg
bernardopg deleted the feat/bar-multi-window branch October 29, 2026 18:32
@bernardopg bernardopg mentioned this pull request Oct 29, 2026
4 of 10 tasks
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.

[Feature]: Allow displaying both Session and Weekly limit percentages for Claude (or choosing via toggles)

1 participant