Feature: conditional widget visibility (e.g. show/hide widgets depending on the model)
Problem. The status line is one static widget list per line, but the meaningful widgets depend on the active model. Concrete case: running Claude Code against a non-Anthropic backend (e.g. a GLM model through a proxy) — the Anthropic limit widgets (Session Usage, Weekly Usage, Block/Weekly Reset Timers, Extra Usage) render S:0.0% 4h21m W:100.0% 0m with data that is meaningless or misleading for that model, and there is no way to hide them just for those models. Today the only choices are removing the widgets entirely or hiding them manually each time.
Proposal. A per-widget visibility condition matched against the model from the status line payload (model.id / model.display_name), via two metadata keys:
hideForModels: "glm-*" — hide the widget when the model matches any pattern;
showForModels: "claude-*" — show the widget only when the model matches (hide otherwise).
Patterns are comma-separated globs, case-insensitive, matched against both id and display_name. When the payload has no model info (e.g. TUI preview), the widget stays visible, so previews are unaffected.
Example — hide the Anthropic usage widgets for GLM models without touching anything else:
{ "type": "session-usage", "metadata": { "hideForModels": "glm-*" } }
Because visibility is decided before rendering (empty pre-render content), existing separator collapsing already handles the gap: neighboring separators disappear together with the hidden widget instead of leaving double gaps.
Fitting it next to the existing per-widget hide metadata (hideable states) seems natural — this is essentially the same mechanism with a dynamic condition instead of a static state.
Happy to send a PR if the approach looks welcome.
Feature: conditional widget visibility (e.g. show/hide widgets depending on the model)
Problem. The status line is one static widget list per line, but the meaningful widgets depend on the active model. Concrete case: running Claude Code against a non-Anthropic backend (e.g. a GLM model through a proxy) — the Anthropic limit widgets (Session Usage, Weekly Usage, Block/Weekly Reset Timers, Extra Usage) render
S:0.0% 4h21m W:100.0% 0mwith data that is meaningless or misleading for that model, and there is no way to hide them just for those models. Today the only choices are removing the widgets entirely or hiding them manually each time.Proposal. A per-widget visibility condition matched against the model from the status line payload (
model.id/model.display_name), via two metadata keys:hideForModels: "glm-*"— hide the widget when the model matches any pattern;showForModels: "claude-*"— show the widget only when the model matches (hide otherwise).Patterns are comma-separated globs, case-insensitive, matched against both
idanddisplay_name. When the payload has no model info (e.g. TUI preview), the widget stays visible, so previews are unaffected.Example — hide the Anthropic usage widgets for GLM models without touching anything else:
{ "type": "session-usage", "metadata": { "hideForModels": "glm-*" } }Because visibility is decided before rendering (empty pre-render content), existing separator collapsing already handles the gap: neighboring separators disappear together with the hidden widget instead of leaving double gaps.
Fitting it next to the existing per-widget
hidemetadata (hideable states) seems natural — this is essentially the same mechanism with a dynamic condition instead of a static state.Happy to send a PR if the approach looks welcome.