update workbench shell and widget test

This commit is contained in:
toki 2026-05-31 19:57:16 +09:00
parent d4ff947dcd
commit 03187a4be3
2 changed files with 7 additions and 4 deletions

View file

@ -33,6 +33,7 @@ class _NomadCodeWorkbenchShellState extends State<NomadCodeWorkbenchShell> {
void _select(NomadWorkbenchSection section) { void _select(NomadWorkbenchSection section) {
setState(() { setState(() {
_section = section; _section = section;
_agentOpen = false;
}); });
} }
@ -44,6 +45,8 @@ class _NomadCodeWorkbenchShellState extends State<NomadCodeWorkbenchShell> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final compactAgentDock =
_agentOpen && MediaQuery.sizeOf(context).width < 960;
return Scaffold( return Scaffold(
backgroundColor: const Color(0xFF0F0F1A), backgroundColor: const Color(0xFF0F0F1A),
body: SafeArea( body: SafeArea(
@ -54,7 +57,7 @@ class _NomadCodeWorkbenchShellState extends State<NomadCodeWorkbenchShell> {
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
Expanded(child: _buildCenterContent()), if (!compactAgentDock) Expanded(child: _buildCenterContent()),
if (_agentOpen) if (_agentOpen)
SizedBox( SizedBox(
width: _agentPanelWidth(context), width: _agentPanelWidth(context),
@ -118,7 +121,7 @@ class _NomadCodeWorkbenchShellState extends State<NomadCodeWorkbenchShell> {
double _agentPanelWidth(BuildContext context) { double _agentPanelWidth(BuildContext context) {
final width = MediaQuery.sizeOf(context).width; 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; if (width < 1120) return 360;
return 420; return 420;
} }

View file

@ -121,13 +121,13 @@ void main() {
await tester.pumpWidget(const NomadCodeClientApp()); await tester.pumpWidget(const NomadCodeClientApp());
await tester.tap(find.byIcon(Icons.smart_toy_outlined)); 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.text('Ask the workspace agent'), findsOneWidget);
expect(find.textContaining('NomadCode agent is docked'), findsOneWidget); expect(find.textContaining('NomadCode agent is docked'), findsOneWidget);
await tester.tap(find.byIcon(Icons.hub_outlined)); await tester.tap(find.byIcon(Icons.hub_outlined));
await tester.pumpAndSettle(); await tester.pump();
expect(find.text('IOP'), findsOneWidget); expect(find.text('IOP'), findsOneWidget);
expect(find.textContaining('Optional IOP console package'), findsOneWidget); expect(find.textContaining('Optional IOP console package'), findsOneWidget);