update workbench shell and widget test
This commit is contained in:
parent
d4ff947dcd
commit
03187a4be3
2 changed files with 7 additions and 4 deletions
|
|
@ -33,6 +33,7 @@ class _NomadCodeWorkbenchShellState extends State<NomadCodeWorkbenchShell> {
|
|||
void _select(NomadWorkbenchSection section) {
|
||||
setState(() {
|
||||
_section = section;
|
||||
_agentOpen = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -44,6 +45,8 @@ class _NomadCodeWorkbenchShellState extends State<NomadCodeWorkbenchShell> {
|
|||
|
||||
@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<NomadCodeWorkbenchShell> {
|
|||
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<NomadCodeWorkbenchShell> {
|
|||
|
||||
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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue