Skip to content

Feature: colour usage bars by level (thresholds per widget) #581

Description

@NewAiCoder

Feature request: colour a usage bar by its level (thresholds)

Today every widget renders in one fixed color. For the quota widgets (session-usage, weekly-usage, weekly-opus-usage, fable-weekly-usage, context-bar) the number that matters is how full the bar is, and a fixed colour cannot say that: with a calm palette a 20 percent bar and a 92 percent bar look identical except for the fill; with a warm palette every bar looks like a warning all day.

Proposal: optional per-widget thresholds that pick the colour by the current percentage.

{
  "type": "weekly-usage",
  "color": "hex:88C0D0",
  "metadata": {
    "display": "slider",
    "levels": [
      { "from": 0,  "color": "hex:88C0D0" },
      { "from": 70, "color": "hex:EBCB8B" },
      { "from": 90, "color": "hex:BF616A" }
    ]
  }
}
  • levels is optional; when absent, behaviour is unchanged.
  • The last matching from wins; the colour applies to the bar, its percentage text and any merged label.
  • Same shape would work for context-percentage / context-bar (where "used" is the level) and for block-timer (time remaining inverted).

Editor support could be a "Levels" sub-menu on those widgets, but the JSON field alone would already cover scripted setups.

Happy to test a build. Thanks for the tool, the slider widgets and the merge flag are what make a two-line layout readable.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions