Fix transitional icons and selection highlighting visibility
All checks were successful
Build and Release / build-and-release (push) Successful in 1m15s

Resolved issues with transitional service icons not being properly visible:

- Removed 3-second timeout that was clearing pending transitions prematurely
- Fixed selection highlighting disappearing when transitional icons appeared
- Implemented conditional coloring for transitional icons:
  - Blue when service is not selected
  - Dark background color when service is selected (for visibility against blue selection)
- Transitions now persist until actual service status changes occur

Both selection highlighting and transitional icons are now visible simultaneously.
This commit is contained in:
2025-10-28 15:14:49 +01:00
parent c3fc5a181d
commit 2618f6b62f
7 changed files with 22 additions and 20 deletions

View File

@@ -559,17 +559,25 @@ impl ServicesWidget {
// Parent services - check if this parent service has a pending transition using RAW service name
if pending_transitions.contains_key(raw_service_name) {
// Create spans with transitional status
let (icon, status_text, status_color) = self.get_service_icon_and_status(raw_service_name, &ServiceInfo {
let (icon, status_text, _) = self.get_service_icon_and_status(raw_service_name, &ServiceInfo {
status: "".to_string(),
memory_mb: None,
disk_gb: None,
latency_ms: None,
widget_status: *line_status
}, pending_transitions);
// Use blue for transitional icons when not selected, background color when selected
let icon_color = if is_selected && !*is_sub && is_focused {
Theme::background() // Dark background color for visibility against blue selection
} else {
Theme::highlight() // Blue for normal case
};
vec![
ratatui::text::Span::styled(format!("{} ", icon), Style::default().fg(status_color)),
ratatui::text::Span::styled(format!("{} ", icon), Style::default().fg(icon_color)),
ratatui::text::Span::styled(line_text.clone(), Style::default().fg(Theme::primary_text())),
ratatui::text::Span::styled(format!(" {}", status_text), Style::default().fg(status_color)),
ratatui::text::Span::styled(format!(" {}", status_text), Style::default().fg(icon_color)),
]
} else {
StatusIcons::create_status_spans(*line_status, line_text)
@@ -578,8 +586,8 @@ impl ServicesWidget {
// Apply selection highlighting to parent services only, preserving status icon color
// Only show selection when Services panel is focused
// IMPORTANT: Don't override transitional icons that show pending commands
if is_selected && !*is_sub && is_focused && !pending_transitions.contains_key(raw_service_name) {
// Show selection highlighting even when transitional icons are present
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