From 03187a4be3d9864419221d14bb44b8bc6645e6f1 Mon Sep 17 00:00:00 2001 From: toki Date: Sun, 31 May 2026 19:57:16 +0900 Subject: [PATCH] update workbench shell and widget test --- apps/client/lib/src/app/nomadcode_workbench_shell.dart | 7 +++++-- apps/client/test/widget_test.dart | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/client/lib/src/app/nomadcode_workbench_shell.dart b/apps/client/lib/src/app/nomadcode_workbench_shell.dart index 55dc442..6c2c29e 100644 --- a/apps/client/lib/src/app/nomadcode_workbench_shell.dart +++ b/apps/client/lib/src/app/nomadcode_workbench_shell.dart @@ -33,6 +33,7 @@ class _NomadCodeWorkbenchShellState extends State { void _select(NomadWorkbenchSection section) { setState(() { _section = section; + _agentOpen = false; }); } @@ -44,6 +45,8 @@ class _NomadCodeWorkbenchShellState extends State { @override Widget build(BuildContext context) { + final compactAgentDock = + _agentOpen && MediaQuery.sizeOf(context).width < 960; return Scaffold( backgroundColor: const Color(0xFF0F0F1A), body: SafeArea( @@ -54,7 +57,7 @@ class _NomadCodeWorkbenchShellState extends State { child: Row( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - Expanded(child: _buildCenterContent()), + if (!compactAgentDock) Expanded(child: _buildCenterContent()), if (_agentOpen) SizedBox( width: _agentPanelWidth(context), @@ -118,7 +121,7 @@ class _NomadCodeWorkbenchShellState extends State { double _agentPanelWidth(BuildContext context) { final width = MediaQuery.sizeOf(context).width; - if (width < 760) return width - 64; + if (width < 960) return (width - 60).clamp(0.0, 520.0); if (width < 1120) return 360; return 420; } diff --git a/apps/client/test/widget_test.dart b/apps/client/test/widget_test.dart index 6288e66..63bddc7 100644 --- a/apps/client/test/widget_test.dart +++ b/apps/client/test/widget_test.dart @@ -121,13 +121,13 @@ void main() { await tester.pumpWidget(const NomadCodeClientApp()); await tester.tap(find.byIcon(Icons.smart_toy_outlined)); - await tester.pumpAndSettle(); + await tester.pump(); expect(find.text('Ask the workspace agent'), findsOneWidget); expect(find.textContaining('NomadCode agent is docked'), findsOneWidget); await tester.tap(find.byIcon(Icons.hub_outlined)); - await tester.pumpAndSettle(); + await tester.pump(); expect(find.text('IOP'), findsOneWidget); expect(find.textContaining('Optional IOP console package'), findsOneWidget);