From b8afd15417fdd355e340eb7888f9c12192cda5c9 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Thu, 23 Oct 2025 21:56:43 +0200 Subject: [PATCH] Fix service selection highlighting: preserve status icon colors and focus-aware display MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Status Icon Color Preservation: - Preserve original status icon colors (green ● for active, red ● for failed) - Apply selection highlighting only to service text, not status icons - Maintain visual health indicators while showing selection state Focus-Aware Selection Display: - Only show selection highlighting when Services panel is focused - Hide selection bar when user switches to System or Backup panels - Provides clean UI when not actively managing services Selection Visual Behavior: - Status icon: Original color (green/red/yellow) with blue background - Service text: Blue background with black text for clear selection indication - Unfocused state: All services display normally without selection artifacts This creates optimal UX where status health information is always visible and selection highlighting only appears when relevant for user interaction. --- dashboard/src/ui/widgets/services.rs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/dashboard/src/ui/widgets/services.rs b/dashboard/src/ui/widgets/services.rs index be9eb06..13f3d5f 100644 --- a/dashboard/src/ui/widgets/services.rs +++ b/dashboard/src/ui/widgets/services.rs @@ -519,11 +519,19 @@ impl ServicesWidget { StatusIcons::create_status_spans(*line_status, line_text) }; - // Apply selection highlighting to parent services only, preserving status colors - if is_selected && !*is_sub { - for span in spans.iter_mut() { - // Keep the original foreground color (status color) but add background highlight - span.style = span.style.bg(Theme::highlight()); + // Apply selection highlighting to parent services only, preserving status icon color + // Only show selection when Services panel is focused + if is_selected && !*is_sub && is_focused { + for (i, span) in spans.iter_mut().enumerate() { + if i == 0 { + // First span is the status icon - preserve its color + span.style = span.style.bg(Theme::highlight()); + } else { + // Other spans (text) get full selection highlighting + span.style = span.style + .bg(Theme::highlight()) + .fg(Theme::background()); + } } }