diff --git a/apps/desktop-tauri/src-tauri/src/taskbar_widget.rs b/apps/desktop-tauri/src-tauri/src/taskbar_widget.rs index 02dad2b1..c34aab55 100644 --- a/apps/desktop-tauri/src-tauri/src/taskbar_widget.rs +++ b/apps/desktop-tauri/src-tauri/src/taskbar_widget.rs @@ -223,7 +223,7 @@ fn constraining_readout( out.push((Some("Model"), window)); } if let Some(window) = snapshot.tertiary.as_ref() { - out.push((Some("Extra"), window)); + out.push((snapshot.tertiary_label.as_deref().or(Some("Extra")), window)); } for extra in &snapshot.extra_rate_windows { if extra.id == "reset-credits" { @@ -2189,6 +2189,32 @@ mod tests { assert_eq!(readout.window.used_percent, 92.0); } + #[test] + fn constraining_readout_uses_tertiary_label_when_it_binds() { + // OpenCode Go monthly bar: the tertiary window's own label must show on + // the taskbar, not the generic "Extra". + let mut snapshot = snap("opencodego", None, 10.0); + snapshot.primary_label = Some("Rolling".into()); + snapshot.tertiary = Some(rate_window(100.0, Some(43_200))); + snapshot.tertiary_label = Some("Monthly".into()); + + let readout = constraining_readout(&snapshot); + assert_eq!(readout.label, Some("Monthly")); + assert_eq!(readout.window.used_percent, 100.0); + } + + #[test] + fn constraining_readout_falls_back_to_extra_for_unnamed_tertiary() { + let mut snapshot = snap("opencodego", None, 10.0); + snapshot.primary_label = Some("Rolling".into()); + snapshot.tertiary = Some(rate_window(100.0, Some(43_200))); + snapshot.tertiary_label = None; + + let readout = constraining_readout(&snapshot); + assert_eq!(readout.label, Some("Extra")); + assert_eq!(readout.window.used_percent, 100.0); + } + #[test] fn cursor_strip_prefers_auto_when_api_is_maxed() { // Parallel pools: maxed API must not hide Auto that still has room.