Simplified keyboard controls by removing service restart functionality:
- Removed 'r' key restart functionality from Services panel
- Made 'R' key always trigger system rebuild regardless of focused panel
- Updated context shortcuts to show 'R: Rebuild Host' globally
- Removed all ServiceRestart enum variants and associated code:
- UiCommand::ServiceRestart
- CommandType::ServiceRestart
- ServiceAction::Restart
- Cleaned up pending transition logic to only handle Start/Stop commands
The 'R' key now consistently rebuilds the current host from any panel,
while 's' and 'S' continue to handle service start/stop in Services panel.
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.
The root cause of transitional service icons not showing was that service names
were stored as raw names (e.g., "sshd") in pending_transitions but looked up
against formatted display lines (e.g., "sshd active 1M ").
Changes:
- Modified display_lines structure to include both formatted text and raw service names
- Updated rendering loop to use raw service names for pending transition lookups
- Fixed get_selected_service() method to use the new tuple structure
- Transitional icons (↑ ↓ ↻) should now appear correctly when pressing s/S/r keys
- Force sshd service to always show "↑ starting" for debugging
- Test if basic directional arrow rendering works in services widget
- Temporary debug change to isolate rendering vs logic issues
- Will help determine if problem is in pending transitions or rendering
If arrow appears: pending transitions logic issue
If no arrow: basic rendering path issue
- Store pending transitions even for redundant commands (start active service)
- Add 3-second timeout for redundant command visual feedback
- Include timestamp in pending transitions to enable timeout clearing
- Show directional arrows immediately regardless of command validation result
- Fix core issue where state validation prevented visual feedback storage
Now pressing s/S/r always shows immediate directional arrows, even for
redundant operations, providing consistent visual feedback to users.
- Prevent selection highlighting when service has pending transition
- Allow directional arrows (↑ ↓ ↻) to show through on selected services
- Fix core issue where selection styling was overwriting transitional icons
- Transitional icons now properly visible during service command execution
The selection highlighting logic now skips services with pending transitions,
ensuring that directional arrows are visible when executing service commands.
- Replace timeout-based command status with pending service transitions
- Show immediate directional arrows when pressing service commands (↑ ↓ ↻)
- Track original service status and command type for each pending operation
- Automatically clear transitional icons when real status updates arrive
- Remove unused TerminalPopup and CommandStatus infrastructure
- Simplify visual feedback system using state-based approach
Service commands now provide instant visual feedback that persists until
the actual service state changes, eliminating timing issues and improving UX.
- Add service state detection before executing start/stop/restart commands
- Prevent redundant operations (start active services, stop inactive services)
- Show immediate directional arrows for command feedback (↑ starting, ↓ stopping, ↻ restarting)
- Add get_service_status() method to ServicesWidget for state access
- Remove unused TerminalPopup code and dangling methods
- Clean up warnings and unused code throughout codebase
Service commands now validate current state and provide instant UX feedback while
preserving existing status icons and colors during transitions.
- Fix /tmp usage status to use proper thresholds instead of hardcoded Ok status
- Fix wear level status to use configurable thresholds instead of hardcoded values
- Add dedicated tmp_status field to SystemWidget for proper /tmp status display
- Remove host-level hourglass icon during service operations
- Implement immediate service status updates after start/stop/restart commands
- Remove active users display and collection from NixOS section
- Fix immediate host status aggregation transmission to dashboard
- Separate dashboard updates from email notifications for immediate status aggregation
- Add metric caching to MetricCollectionManager for instant dashboard updates
- Dashboard now receives cached data every 1 second instead of waiting for collection intervals
- Fix transmission to use cached metrics rather than triggering fresh collection
- Email notifications maintain separate 60-second batching interval
- Update configurable email notification aggregation interval
- Fix email notification aggregation to send batched notifications instead of individual emails
- Fix startup data collection to properly process initial status without triggering change notifications
- Maintain event-driven transmission while preserving aggregated notification batching
- Update version from 0.1.19 to 0.1.20 across all components
Major architectural improvements:
CORE CHANGES:
- Remove notification_interval_seconds - status aggregation now immediate
- Status calculation moved to collection phase instead of transmission
- Event-driven transmission triggers immediately on status changes
- Dual transmission strategy: immediate on change + periodic backup
- Real-time notifications without batching delays
TECHNICAL IMPROVEMENTS:
- process_metric() now returns bool indicating status change
- Immediate ZMQ broadcast when status changes detected
- Status aggregation happens during metric collection, not later
- Legacy get_nixos_build_info() method removed (unused)
- All compilation warnings fixed
BEHAVIOR CHANGES:
- Critical alerts sent instantly instead of waiting for intervals
- Dashboard receives real-time status updates
- Notifications triggered immediately on status transitions
- Backup periodic transmission every 1s ensures heartbeat
This provides much more responsive monitoring with instant alerting
while maintaining the reliability of periodic transmission as backup.
- Implement per-collector interval timing respecting NixOS config
- Remove all hardcoded timeout/interval values and make configurable
- Add tmux session requirement check for TUI mode (bypassed for headless)
- Update agent to send config hash in Build field instead of nixos version
- Add nginx check interval, HTTP timeouts, and ZMQ transmission interval configs
- Update NixOS configuration with new configurable values
Breaking changes:
- Build field now shows nix store config hash (8 chars) instead of nixos version
- All intervals now follow individual collector configuration instead of global
New configuration fields:
- systemd.nginx_check_interval_seconds
- systemd.http_timeout_seconds
- systemd.http_connect_timeout_seconds
- zmq.transmission_interval_seconds
- Use tmux display-popup instead of popup with incorrect arguments
- Add -tt flag for proper pseudo-terminal allocation
- Use bash -ic to load shell aliases in SSH session
- Enable rebuild_git alias to work through SSH popup
- Remove all SystemRebuild command infrastructure from agent and dashboard
- Replace with direct tmux popup execution: ssh {user}@{host} {alias}
- Add configurable SSH user and rebuild alias in dashboard config
- Eliminate agent process crashes during rebuilds
- Simplify architecture by removing ZMQ command streaming complexity
- Clean up all related dead code and fix compilation warnings
Benefits:
- Process isolation: rebuild runs independently via SSH
- Crash resilience: agent/dashboard can restart without affecting rebuilds
- Configuration flexibility: SSH user and alias configurable per deployment
- Operational simplicity: standard tmux popup interface
- Remove auto-close behavior from terminal popup for manual review
- Fix system panel to show correct NixOS section layout
- Add missing Active users line after Agent version
- Switch agent version from nix store hash to actual version number (v0.1.11)
- Display full version string without truncation for clear version tracking
- Add terminal popup UI component with 80% screen coverage and terminal styling
- Extend ZMQ protocol with CommandOutputMessage for streaming output
- Implement real-time output streaming in agent system rebuild handler
- Add keyboard controls (ESC/Q to close, ↑↓ to scroll) for popup interaction
- Fix system panel Build display to show actual NixOS build instead of config hash
- Update service filters in README with wildcard patterns for better matching
- Add periodic progress updates during nixos-rebuild execution
- Integrate command output handling in dashboard main loop
- MetricStore tracks agent versions from all hosts
- Detects version mismatches using most common version as reference
- Dashboard logs warnings for hosts with outdated agents
- Foundation for visual version mismatch indicators in UI
- Helps identify deployment inconsistencies across infrastructure
- Agent reports version via agent_version metric using nix store hash
- Dashboard displays agent version in system widget
- Foundation for cross-host version comparison
- Both agent -V and dashboard show versions
- Remove Config field completely from NixOS section
- Build: now shows NixOS system hash (from /run/current-system)
- Agent: shows cm-dashboard package hash (first 8 chars)
Build and Agent now display different hashes as intended.
Make dashboard -V show the same hash as the agent by extracting
the hash from the dashboard binary's nix store path instead of
the system configuration path. Now both will show identical
hashes since they're from the same cm-dashboard package.
Replace hardcoded version with first 8 characters of current system's
nix store hash. This makes it easy to verify when rebuilds complete
as the hash changes with each deployment.
No fallback - fails hard if config hash cannot be determined.
- Add automatic timeout mechanism (5 minutes for rebuilds, 30 seconds for services)
- Implement agent hash change detection for rebuild completion
- Add visual feedback states: blue ↻ (in progress), green ✓ (success), red ✗ (failed)
- Clear status automatically after timeout or completion
- Fix command status lifecycle management
- Add blue circular arrow (↻) status icon during SystemRebuild commands
- Keep rebuilding hosts visible in dashboard even when temporarily offline
- Extend connection timeout to 5 minutes for hosts undergoing rebuild
- Prevent host switching during rebuild operations
- Update status bar to show rebuild progress immediately when R key pressed
- Add nixos_config_api_key_file option to NixOS configuration
- Support reading API token from file for private repositories
- Automatically inject token into HTTPS URLs (https://token@host/repo.git)
- Graceful fallback to original URL if key file missing/empty
- Default key file location: /var/lib/cm-dashboard/git-api-key
Usage: echo 'your-api-token' | sudo tee /var/lib/cm-dashboard/git-api-key
Replace generic hourglass with specific arrows:
- ↑ (up) for starting services
- ↓ (down) for stopping services
- ↻ (circular) for restarting services
Provides immediate visual feedback for service operations.
Replace direct directory access with git clone/pull approach:
- Add git configuration options (url, branch, working_dir) to NixOS module
- Update SystemConfig and AgentCommand to use git parameters
- Implement ensure_git_repository() method for clone/pull operations
- Agent clones nixosbox to /var/lib/cm-dashboard/nixos-config
- Maintains security while solving permission denied issues
The agent now manages its own copy of the configuration without
needing access to /home/cm directory.
- Change Space key toggle to 's' for start and 'S' for stop
- Remove problematic service status detection logic
- Update statusbar shortcuts to show S/Shift+S instead of Space
- Split UiCommand::ServiceStartStop into ServiceStart and ServiceStop
- Simplify command handling with explicit actions
This resolves the toggle bug where Space always sent start commands
regardless of current service status.
- Implement proper service status checking for start/stop toggle
- Space key now checks current service status and toggles appropriately
- Active services get stopped, inactive services get started
- Fix nixos-rebuild sudo permissions (remove invalid package reference)
- Use only /run/current-system/sw/bin/nixos-rebuild path
This implements the core functionality for executing remote commands through
the dashboard and providing real-time visual feedback to users.
Key Features:
- Remote service control (start/stop/restart) via existing keyboard shortcuts
- System rebuild command with maintenance mode integration
- Real-time visual feedback with service status transitions
- ZMQ command protocol extension for service and system operations
Implementation Details:
- Extended AgentCommand enum with ServiceControl and SystemRebuild variants
- Added agent-side handlers for systemctl and nixos-rebuild execution
- Implemented command status tracking system for visual feedback
- Enhanced services widget to show progress states (⏳ restarting)
- Integrated command execution with existing keyboard navigation
Keyboard Controls:
- Services Panel: Space (start/stop), R (restart)
- System Panel: R (nixos-rebuild switch)
- Backup Panel: B (trigger backup)
Technical Architecture:
- Command flow: UI → Dashboard → ZMQ → Agent → systemctl/nixos-rebuild
- Status tracking: InProgress/Success/Failed states with visual indicators
- Maintenance mode: Automatic /tmp/cm-maintenance file management
- Service feedback: Icon transitions (● → ⏳ → ● with status text)
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.
Selection Behavior Improvements:
- Limit selection to parent services only (docker, nginx, postgresql, etc.)
- Skip sub-services in navigation (no longer select nginx sub-sites)
- Up/Down arrows now move between actionable services only
Visual Enhancement:
- Preserve original status colors in selection highlighting
- Selected services show blue background with status foreground colors
- Green text for active services, red for failed, even when selected
- Maintains visual health status information during selection
Selection Logic:
- Add parent service index mapping for accurate selection tracking
- Only count parent services in total service count
- Calculate proper parent service index from display line position
- Ensure selection highlights only apply to parent services
This creates a cleaner UX where users only select services they can
actually control (start/stop/restart) while maintaining visual health
status indicators through preserved status colors.
Visual Highlighting Fixes:
- Apply selection highlighting to individual text spans instead of entire paragraph
- Eliminates highlighting of empty space below services on single-service hosts
- Selection now only highlights actual service text content
Selection Logic Improvements:
- Add proper bounds checking in select_next() to prevent invalid selections
- Automatically clamp selection index when services are updated
- Add debug logging to track selection state and movement
Bounds Safety:
- Ensure selection index stays valid when service lists change
- Prevent out-of-bounds access during service updates
- Reset selection to last valid index when services are removed
This fixes the issues where:
1. Single service hosts showed empty space highlighting
2. Multi-service hosts had no visible selection cursor
3. Selection could become invalid when services changed
Service Selection Features:
- Add selection cursor for Services panel with visual highlighting
- Up/Down arrows move service selection instead of scrolling
- Track selected service for future action implementation
- Selection state maintained per host
Panel Navigation Improvements:
- Fix panel switching to only cycle through visible panels
- Dynamic panel list based on backup data availability
- Smart recovery when focused panel becomes invisible
- No more navigation to hidden backup panel
Backup Panel Scrolling Fix:
- Fix backup panel scroll to show actual repository content
- Replace static overflow indicator with proper scroll behavior
- Add scroll position indicators (above/below)
- Show all repositories when scrolling instead of truncated list
Navigation now works correctly with actual UI layout and
provides proper service selection for future action implementation.
- Remove Network panel from navigation cycle
- Fix system panel scrolling to work in both directions
- Add complete scroll support to Services and Backup panels
- Update panel cycling to System → Services → Backup only
- Enhance scroll indicators with proper bounds checking
- Clean up unused Network panel code and references
Resolves issues with non-functional up/down scrolling and
mystery network panel appearing during navigation.
The new keybindings (Shift+Tab, Up, Down, BackTab) weren't working because
the main app.rs event loop was only passing specific keys to the TUI app.
Added handling for:
- KeyCode::BackTab (Shift+Tab panel switching)
- KeyCode::Up (scroll up in focused panel)
- KeyCode::Down (scroll down in focused panel)
Now all keyboard navigation features work correctly.
- 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
Restore "... and X more" indicators when panel content doesn't fit:
- System widget: Shows overflow for storage pools when area is too small
- Backup widget: Shows overflow for repository list when area is too small
- Maintains consistent formatting with existing services widget overflow
Update all tree symbols (└─, ├─) in system and backup widgets to use
Typography::secondary() style instead of raw text for consistent
text coloring throughout the interface.
Backup widget:
- Restructure to match new layout specification
- Add section headers: Latest backup, Disk, Repos
- Show timestamp with status icon and duration as sub-item
- Display disk info with product name, S/N, and usage in tree structure
- List repositories with archive count and size
- Remove old render methods and unused imports
System widget:
- Hide (Single) storage type label for cleaner display
- Add section headers: CPU, RAM, Storage as plain titles
- Remove status icons from section headers
- Keep status icons only on data lines (Load, Usage, /tmp, filesystems)
- Restore (Single) label for all storage types
- Improve visual hierarchy with clear section separation
- Replace findmnt with lsblk for efficient device name detection
- Fix tree indentation to align consistently with status icon text
- Hide '(Single)' label for single disk storage pools
- Device detection returns actual names (nvme0n1, sda) not UUID paths
- Remove Active users line from NixOS section
- Add status icons to CPU and RAM sections
- Restructure layout with proper tree symbols and spacing
- Add empty lines between sections for better readability
- Remove Storage header, show each filesystem as top-level item
- Fix tree indentation to match specification
- CPU shows load averages with frequency as sub-item
- RAM shows usage with /tmp as sub-item with status icon
- Add mount_point field to StoragePool struct
- Create mapping from pool names to mount points
- Update display to show user-friendly mount points (/, /mnt/steampool)
- Keep device detection for SMART data (temperature, wear)
- Resolves disk name confusion on different hosts
Implement agent version tracking to diagnose deployment issues:
- Add get_agent_hash() method to extract Nix store hash from executable path
- Collect system_agent_hash metric in NixOS collector
- Display "Agent Hash" in system panel under NixOS section
- Update metric filtering to include agent hash
This helps identify which version of the agent is actually running
when troubleshooting deployment or metric collection issues.