Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/features/workspace/sql_workspace_toolbar.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:io';

import 'package:flutter/material.dart' as material;
import 'package:querya_desktop/core/ui/querya_control_tokens.dart';
import 'package:querya_desktop/features/settings/preferences_dialog.dart';
import 'package:querya_desktop/features/settings/sql_statement_timeout_dropdown.dart';
import 'package:querya_desktop/features/workspace/sql_execution_delegate.dart';
Expand Down Expand Up @@ -149,7 +150,11 @@ class SqlWorkspaceToolbar extends StatelessWidget {
return material.LayoutBuilder(
builder: (context, constraints) {
final compact = constraints.maxWidth < compactWidthBreakpoint;
return material.SingleChildScrollView(
// One size for the whole row: the run split button, the buttons, the
// icon buttons and the session menu are all `md` (#1439).
return QueryaControlScope(
size: QueryaControlSize.md,
child: material.SingleChildScrollView(
scrollDirection: material.Axis.horizontal,
child: material.Row(
children: [
Expand Down Expand Up @@ -275,6 +280,7 @@ class SqlWorkspaceToolbar extends StatelessWidget {
],
],
),
),
);
},
);
Expand Down
50 changes: 50 additions & 0 deletions test/features/workspace/sql_workspace_toolbar_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,55 @@ void main() {
await tester.tap(find.byKey(const material.ValueKey('run_script')));
expect(executeCalled, isTrue);
});

testWidgets('every control of the row has the md height (#1439)',
(tester) async {
final session = SqlQueryTabSession(
id: '1',
title: 'Query 1',
initialSql: 'SELECT 1;',
);

await tester.pumpWidget(
buildApp(
SqlWorkspaceToolbar(
session: session,
delegate: _FakeSqlExecutionDelegate(),
effectiveDatabase: 'test_db',
autocommit: false,
supportsAutocommit: true,
supportsStmtTimeout: true,
txOpen: true,
queryTimeoutSeconds: null,
historyEnabled: true,
onExecute: (_) {},
onExplain: () {},
onCancel: () {},
onOpenHistory: () {},
onOpenFile: () {},
onSaveFile: () {},
onRunTxCommand: (_) {},
onToggleAutocommit: () {},
onTimeoutChanged: (_) {},
),
),
);
await tester.pumpAndSettle();

for (final key in [
'run_script',
'run_menu',
'explain_query',
'history_button',
'format_button',
'open_sql_button',
'save_sql_button',
'session_menu',
]) {
final finder = find.byKey(material.ValueKey(key));
expect(finder, findsOneWidget, reason: key);
expect(tester.getSize(finder).height, 32, reason: key);
}
});
});
}
Loading