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
5 changes: 4 additions & 1 deletion lib/features/connections/sdui_tree_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,10 @@ class SduiTreeBuilderState extends material.State<SduiTreeBuilder> {

return QueryaTreeIndentGuide(
depth: depth,
leading: 8.0 + (canExpand ? 0 : 4.0),
// The connection already indents the tree by underConnection, like the
// built-in drivers' trees; an extra 8 here put the first level further
// right than a Postgres or MySQL database list.
leading: canExpand ? 0 : 4.0,
child: QueryaConnectionTreeRow(
label: node.label,
isSelected: isSelected,
Expand Down
25 changes: 25 additions & 0 deletions test/core/sdui/sdui_builders_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,31 @@ void main() {
expect(find.text('analytics'), findsOneWidget);
});

testWidgets('a root row starts at the tree edge, no extra inset (#1822 run)',
(tester) async {
final schema = SduiTreeSchema.fromJson(const {
'roots': [
{'id': 'databases', 'label': 'Databases', 'expandable': true},
],
});
await tester.pumpWidget(
queryaThemeTestShell(
child: material.Scaffold(
body: SduiTreeBuilder(
schema: schema,
fetchChildren: (_) async => const [],
),
),
),
);

final tree = tester.getTopLeft(find.byType(SduiTreeBuilder)).dx;
final chevron = tester.getTopLeft(find.byIcon(QueryaIcons.expandClosed)).dx;
// The row's own padding (4) and nothing else: the connection supplies
// the indent under it.
expect(chevron - tree, lessThan(8));
});

testWidgets('expand chevron uses QueryaMotion tokens (Off = instant)',
(tester) async {
final schema = SduiTreeSchema.fromJson(const {
Expand Down
Loading