Skip to content

feat(status-bar): minimal style + CPU/MEM history graphs - #203

Merged
matej21 merged 5 commits into
mainfrom
feat/minimal-status-bar
Sep 9, 2026
Merged

feat(status-bar): minimal style + CPU/MEM history graphs#203
matej21 merged 5 commits into
mainfrom
feat/minimal-status-bar

Conversation

@jonasnobile

Copy link
Copy Markdown
Member

What

A Detailed / Minimal switch for the status bar, plus CPU/MEM drawn as history graphs. Both live under Settings → General → Appearance.

Minimal drops the text that only repeats what a bar already shows:

  • CPU / MEM — label + graph, no % (exact figures move to a tooltip)
  • usage (5h, 7d) — label + bar, no %; the numbers are already one hover away in the popover
  • Claude Code / Codex / GitHub — a colored dot + name instead of Claude Code OK

Anything abnormal (Degraded, Major Outage) keeps its word in both styles, so choosing minimal never hides a problem.

Graphs replace the single-value bar for CPU/MEM: the last 24 samples (~50s at the 2s refresh) as a sparkline, on by default. A one-value bar reports the instant only — a spike is over before you look at it.

Dedup that came with it

The status bar is assembled from widgets shipped by four different crates, which agreed on what a metric looks like by copy: the 2px capacity bar existed twice, and the name + status word trigger three times, once per extension. Both now go through okena-ui::metrics (metric_bar, sparkline, service_status_items).

GlobalStatusBarStyle follows the existing GlobalUiFontSize provider pattern, so a widget in any crate can read the preference without depending on okena-app-core.

Notes

  • StatusBarStyle lives in okena-core: AppSettings has to serialize it and okena-workspace must stay gpui-free. cargo tree -i gpui -p okena-daemon still comes back empty.
  • StatusBarSettings carries serde defaults, so existing settings.json files load unchanged.

Testing

  • cargo check passes at each of the four commits — the history bisects cleanly, it doesn't just end in a working state
  • cargo test green for the touched crates; cargo clippy clean
  • No screenshot: the ui-screenshot harness is Linux/GNOME only and this was authored on macOS. Worth a look on a real window before merge.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UhHu7ad5BeaettLreDgEs5

jonasnobile and others added 5 commits September 9, 2026 16:00
The status bar is assembled from widgets that ship in different crates —
system stats in okena-app, usage bars in okena-usage, service status in
the okena-ext-* crates — and they all have to agree on what a metric
looks like. Today they agree by copy: the 2px capacity bar exists twice
(status_bar.rs and okena-usage), and the `name + status word` trigger
exists three times, once per extension.

Collect them in okena-ui as metric_bar, sparkline and
service_status_items, alongside GlobalStatusBarStyle — a host-registered
reader following the GlobalUiFontSize pattern, so a widget in any crate
can consult the user's preference without depending on okena-app-core.
StatusBarStyle lives in okena-core because AppSettings has to serialize
it and okena-workspace must stay gpui-free.

Nothing consumes these yet; the callers move over in later commits.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UhHu7ad5BeaettLreDgEs5
Adds StatusBarSettings { style, metrics_graph } and surfaces both under
Appearance: a Detailed/Minimal segmented control and a graph toggle.

Grouped into one struct rather than two flat fields, matching how
`notifications` is already shaped — the two only ever make sense read
together. Both carry serde defaults, so existing settings.json files
load unchanged; metrics_graph defaults on because the graph is the
better default reading of a metric that moves.

main.rs registers the style provider the same way it registers the UI
font size. The preference is inert until the widgets read it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UhHu7ad5BeaettLreDgEs5
A single-value bar shows the instant only: a spike is over before you
look at it, so the bar spends most of its time reporting idle. Keep the
last 24 samples (~50s at the 2s refresh) and draw them as a sparkline
instead, behind the new metrics_graph preference.

The minimal style drops the percentage entirely — the graph carries the
value — and both styles now get a tooltip with the exact figures, which
previously only memory had.

Also routes the two colors through the existing cpu_metric_color /
memory_metric_color helpers. The render body carried a second copy of
the same thresholds the remote popover already computed through them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UhHu7ad5BeaettLreDgEs5
Usage triggers drop the percentage and put the label beside the bar; the
figures are already one hover away in the popover. The three service
widgets reduce `name + OK` to a dot + name — "OK" repeated after three
service names is the most redundant text in the bar.

Anything abnormal keeps its word (Degraded, Major Outage) in both
styles, so choosing minimal never hides a problem.

The three widgets went through one shared helper for this, which also
retires the copy of the trigger markup each of them carried.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UhHu7ad5BeaettLreDgEs5
@matej21
matej21 merged commit 091eaec into main Sep 9, 2026
10 checks passed
@matej21
matej21 deleted the feat/minimal-status-bar branch September 9, 2026 15:35
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.

2 participants