From 51375e80203241d68bc671c55316f2952dd1f13a Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Thu, 23 Oct 2025 20:16:10 +0200 Subject: [PATCH] Change tree symbols to blue color across all panels - Add Typography::tree() style using blue Theme::highlight() color - Update system, backup, and services widgets to use consistent blue tree styling - Centralizes tree color management in theme module for easy maintenance --- TODO.md | 1 - dashboard/src/ui/theme.rs | 7 +++++++ dashboard/src/ui/widgets/backup.rs | 6 +++--- dashboard/src/ui/widgets/services.rs | 4 +--- dashboard/src/ui/widgets/system.rs | 8 ++++---- 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/TODO.md b/TODO.md index 4cc45b0..131f610 100644 --- a/TODO.md +++ b/TODO.md @@ -55,7 +55,6 @@ Repos: - Add keyboard navigation between panels "Shift-Tab" - Add lower statusbar with dynamic updated shortcuts when switchng between panels -- Add scrolling support when text do not fit ## Remote execution (agent/dashboard) diff --git a/dashboard/src/ui/theme.rs b/dashboard/src/ui/theme.rs index 671c28f..f65568d 100644 --- a/dashboard/src/ui/theme.rs +++ b/dashboard/src/ui/theme.rs @@ -324,4 +324,11 @@ impl Typography { .bg(Theme::background()) .add_modifier(Modifier::BOLD) } + + /// Tree symbols style (blue color) + pub fn tree() -> Style { + Style::default() + .fg(Theme::highlight()) + .bg(Theme::background()) + } } diff --git a/dashboard/src/ui/widgets/backup.rs b/dashboard/src/ui/widgets/backup.rs index 3d2890b..86d1505 100644 --- a/dashboard/src/ui/widgets/backup.rs +++ b/dashboard/src/ui/widgets/backup.rs @@ -348,7 +348,7 @@ impl Widget for BackupWidget { if let Some(duration) = self.duration_seconds { let duration_text = self.format_duration(duration); lines.push(ratatui::text::Line::from(vec![ - ratatui::text::Span::styled(" └─ ", Typography::secondary()), + ratatui::text::Span::styled(" └─ ", Typography::tree()), ratatui::text::Span::styled(format!("Duration: {}", duration_text), Typography::secondary()) ])); } @@ -369,7 +369,7 @@ impl Widget for BackupWidget { // Serial number as sub-item if let Some(serial) = &self.backup_disk_serial_number { lines.push(ratatui::text::Line::from(vec![ - ratatui::text::Span::styled(" ├─ ", Typography::secondary()), + ratatui::text::Span::styled(" ├─ ", Typography::tree()), ratatui::text::Span::styled(format!("S/N: {}", serial), Typography::secondary()) ])); } @@ -379,7 +379,7 @@ impl Widget for BackupWidget { let used_str = Self::format_size_with_proper_units(used); let total_str = Self::format_size_with_proper_units(total); lines.push(ratatui::text::Line::from(vec![ - ratatui::text::Span::styled(" └─ ", Typography::secondary()), + ratatui::text::Span::styled(" └─ ", Typography::tree()), ratatui::text::Span::styled(format!("Usage: {}/{}", used_str, total_str), Typography::secondary()) ])); } diff --git a/dashboard/src/ui/widgets/services.rs b/dashboard/src/ui/widgets/services.rs index f2f56f7..b10c0ad 100644 --- a/dashboard/src/ui/widgets/services.rs +++ b/dashboard/src/ui/widgets/services.rs @@ -170,9 +170,7 @@ impl ServicesWidget { // Indentation and tree prefix ratatui::text::Span::styled( format!(" {} ", tree_symbol), - Style::default() - .fg(Theme::secondary_text()) - .bg(Theme::background()), + Typography::tree(), ), // Status icon ratatui::text::Span::styled( diff --git a/dashboard/src/ui/widgets/system.rs b/dashboard/src/ui/widgets/system.rs index dee28e4..d00e2c9 100644 --- a/dashboard/src/ui/widgets/system.rs +++ b/dashboard/src/ui/widgets/system.rs @@ -286,7 +286,7 @@ impl SystemWidget { let mut drive_spans = vec![ Span::raw(" "), - Span::styled(tree_symbol, Typography::secondary()), + Span::styled(tree_symbol, Typography::tree()), Span::raw(" "), ]; drive_spans.extend(StatusIcons::create_status_spans(drive.status.clone(), &drive_text)); @@ -298,7 +298,7 @@ impl SystemWidget { let tree_symbol = "└─"; let mut usage_spans = vec![ Span::raw(" "), - Span::styled(tree_symbol, Typography::secondary()), + Span::styled(tree_symbol, Typography::tree()), Span::raw(" "), ]; usage_spans.extend(StatusIcons::create_status_spans(pool.status.clone(), &usage_text)); @@ -435,7 +435,7 @@ impl Widget for SystemWidget { let freq_text = self.format_cpu_frequency(); lines.push(Line::from(vec![ - Span::styled(" └─ ", Typography::secondary()), + Span::styled(" └─ ", Typography::tree()), Span::styled(format!("Freq: {}", freq_text), Typography::secondary()) ])); @@ -453,7 +453,7 @@ impl Widget for SystemWidget { let tmp_text = self.format_tmp_usage(); let mut tmp_spans = vec![ - Span::styled(" └─ ", Typography::secondary()), + Span::styled(" └─ ", Typography::tree()), ]; tmp_spans.extend(StatusIcons::create_status_spans( self.memory_status.clone(),