diff --git a/pi/ui/lib/screens/dashboard_screen.dart b/pi/ui/lib/screens/dashboard_screen.dart index eb3d63f..561f8be 100644 --- a/pi/ui/lib/screens/dashboard_screen.dart +++ b/pi/ui/lib/screens/dashboard_screen.dart @@ -167,7 +167,7 @@ class _DashboardScreenState extends State { wsState: _wsState, ), - const SizedBox(height: 10), + const SizedBox(height: 5), // Main content area - big stat boxes Expanded( @@ -203,28 +203,28 @@ class _DashboardScreenState extends State { const SizedBox(width: 32), - // Right side: Navigator with debug console overlay + // Right side: Navigator on top, debug console below Expanded( flex: 1, - child: Stack( + child: Column( children: [ - // Bottom layer: Navigator - Center( - child: NavigatorWidget(key: _navigatorKey), + // Navigator + Expanded( + flex: 3, + child: Center( + child: NavigatorWidget(key: _navigatorKey), + ), ), - // Top layer: Debug console on lower half only - Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - const Spacer(), // Top half - empty - Expanded( - child: DebugConsole( - messageStream: WebSocketService.instance.debugStream, - initialMessages: WebSocketService.instance.debugMessages, - maxLines: 8, - ), - ), - ], + // Debug console + Expanded( + flex: 1, + child: + DebugConsole( + messageStream: WebSocketService.instance.debugStream, + initialMessages: WebSocketService.instance.debugMessages, + maxLines: 6, + title: 'WebSocket messages', + ), ), ], ), diff --git a/pi/ui/lib/widgets/debug_console.dart b/pi/ui/lib/widgets/debug_console.dart index 800739e..26fa902 100644 --- a/pi/ui/lib/widgets/debug_console.dart +++ b/pi/ui/lib/widgets/debug_console.dart @@ -17,11 +17,15 @@ class DebugConsole extends StatefulWidget { /// Maximum lines to display final int maxLines; + /// Optional title for the console (shown in title bar) + final String? title; + const DebugConsole({ super.key, required this.messageStream, this.initialMessages = const [], this.maxLines = 8, + this.title, }); @override @@ -66,15 +70,49 @@ class _DebugConsoleState extends State { final theme = AppTheme.of(context); return Container( - padding: const EdgeInsets.all(4), - child: Text( - _messages.isEmpty ? '(no messages)' : _messages.join('\n'), - style: TextStyle( - fontFamily: 'monospace', - fontSize: 34, - color: theme.foreground, - height: 1.2, - ), + decoration: BoxDecoration( + color: theme.background.withAlpha(64), + border: Border.all(color: theme.subdued, width: 2), + borderRadius: BorderRadius.circular(8), + ), + child: Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + // Title bar (optional) + if (widget.title != null) + Container( + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide(color: theme.subdued, width: 1), + ), + ), + child: Text( + widget.title!, + style: TextStyle( + fontFamily: 'monospace', + fontSize: 24, + color: theme.subdued, + ), + ), + ), + // Console content + Expanded( + child: Padding( + padding: const EdgeInsets.all(8), + child: Text( + _messages.isEmpty ? '(no messages)' : _messages.join('\n'), + style: TextStyle( + fontFamily: 'monospace', + fontSize: 30, + color: theme.foreground, + height: 1.0, + ), + ), + ), + ), + ], ), ); }