feat(status-bar): minimal style + CPU/MEM history graphs - #203
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
%(exact figures move to a tooltip)5h,7d) — label + bar, no%; the numbers are already one hover away in the popoverClaude Code OKAnything 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 wordtrigger three times, once per extension. Both now go throughokena-ui::metrics(metric_bar,sparkline,service_status_items).GlobalStatusBarStylefollows the existingGlobalUiFontSizeprovider pattern, so a widget in any crate can read the preference without depending onokena-app-core.Notes
StatusBarStylelives inokena-core:AppSettingshas to serialize it andokena-workspacemust stay gpui-free.cargo tree -i gpui -p okena-daemonstill comes back empty.StatusBarSettingscarries serde defaults, so existingsettings.jsonfiles load unchanged.Testing
cargo checkpasses at each of the four commits — the history bisects cleanly, it doesn't just end in a working statecargo testgreen for the touched crates;cargo clippycleanui-screenshotharness 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