-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Add Dedicated Error Display Panel to TUI
Problem
Currently, DevHub TUI has limited error visibility:
- Service errors are only shown inline with service status (
ErrorMsgfield) - Core DevHub errors (MCP server, state manager, etc.) are silently ignored or logged to stderr
- No centralized error view for debugging issues
- Users have no way to see system-level errors within the TUI
Proposed Solution
Add a dedicated error panel to the TUI that displays:
- Service-level errors - Current
ErrorMsgfrom services - Core system errors - MCP server, StateManager, ServiceManager errors
- Application errors - Configuration, dependency resolution, etc.
- Historical error log - Recent errors with timestamps
Relevant Files
devhub.go- Main application entry point where core errors are silently ignoredview.go- TUI rendering logic that needs error paneltypes.go- Data structures for UI stateupdate.go- Key handling for error panel navigationmcp_server.go- MCP server errors that need capturingstate_manager.go- State management errorsservice_manager.go- Service management errors
Proposed ASCII Layout
╭──────────────────────────────────────────────────────────────────────────────╮
│ 🚀 DevHub - Error Panel │
│ Development Tools Manager │
├──────────────────────────────────────────────────────────────────────────────┤
│ 📦 5 services • ✅ 3 running • ❌ 2 errors │
├──────────────────────────────────────────────────────────────────────────────┤
│ Services: ⚡ 45.2% 💾 512.3 MB │
│ System: ⚡ 23.1% 💾 8.2 GB (68%) │
╰──────────────────────────────────────────────────────────────────────────────╯
┌─ Errors (E to toggle) ─────────────────────────────────────────────────────┐
│ 🔴 [18:01:45] MCP Server: Failed to bind to port 8765 (address in use) │
│ ⚠️ [18:01:23] postgres: Health check timeout after 30s │
│ 🔴 [18:00:12] redis: Process terminated unexpectedly (exit code 1) │
│ ⚠️ [17:59:45] StateManager: Resource monitoring failed for service 'api' │
└────────────────────────────────────────────────────────────────────────────┘
▶ postgres (Failed) 🔴 Error
PostgreSQL Database Server
PID: 1234 | Uptime: 5m23s | CPU: 2.1% | Mem: 45.2MB
Dependencies: none
redis (Running) ◉ Running
Redis Cache Server
PID: 5678 | Uptime: 10m12s | CPU: 1.5% | Mem: 23.1MB
↑/↓: Navigate • Space: Toggle • r: Restart • Enter: View Logs • E: Errors • q: Quit
Implementation Details
1. Error Collection System
type ErrorEntry struct {
Timestamp time.Time
Source string // "service:postgres", "mcp", "state", etc.
Level ErrorLevel // Error, Warning, Info
Message string
}
type ErrorManager struct {
errors []ErrorEntry
mu sync.RWMutex
maxEntries int
}2. UI State Updates
// In types.go
type UIState struct {
Width int
Height int
SelectedIndex int
ViewMode ViewMode
ShowErrors bool // New: toggle error panel
ErrorScroll int // New: scroll position in error panel
// ... existing fields
}
// New view mode
const (
ServiceView ViewMode = iota
LogView
ErrorView // New: dedicated error view
)3. Key Bindings
E: Toggle error panel visibilityShift+E: Switch to full error view- In error view:
↑/↓scroll,Enterfor details,Cto clear
4. Error Sources to Capture
- MCP Server errors: Port binding, request handling
- Service Manager errors: Start/stop failures, dependency issues
- State Manager errors: Resource monitoring, update failures
- Configuration errors: Invalid YAML, missing dependencies
- Health Check errors: Timeout, connection failures
Acceptance Criteria
- Error panel toggles with
Ekey - Shows recent errors with timestamps and sources
- Color-coded by severity (red=error, yellow=warning, blue=info)
- Scrollable when more errors than display space
- Integrates with existing service error display
- Error panel auto-shows when new errors occur
- Errors are categorized by source (service, core, system)
- Historical error persistence during session
- Clear errors functionality
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request