From 4c8c396e023cb69ddce40a6b0a9d0620da961d5f Mon Sep 17 00:00:00 2001 From: ZhuchkaTriplesix Date: Sat, 7 Mar 2026 10:36:44 +0300 Subject: [PATCH 1/2] fix: UI text overflow and document preview improvements - connection panel: ellipsis on long name/host text - folder name: ellipsis on overflow - document cards: show only keys when collapsed, full JSON when expanded - disable horizontal scroll on collapsed document preview --- .flutter-plugins-dependencies | 1 - .../connections/connections_panel.dart | 20 +++++++-- .../mongodb/mongo_documents_view.dart | 41 +++++++++++-------- 3 files changed, 42 insertions(+), 20 deletions(-) delete mode 100644 .flutter-plugins-dependencies diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies deleted file mode 100644 index a2697a14..00000000 --- a/.flutter-plugins-dependencies +++ /dev/null @@ -1 +0,0 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider_foundation","path":"C:\\\\Users\\\\junte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.6.0\\\\","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"sqflite_darwin","path":"C:\\\\Users\\\\junte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\sqflite_darwin-2.4.2\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"path_provider_android","path":"C:\\\\Users\\\\junte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_android-2.2.22\\\\","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"sqflite_android","path":"C:\\\\Users\\\\junte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\sqflite_android-2.4.2+2\\\\","native_build":true,"dependencies":[],"dev_dependency":false}],"macos":[{"name":"bitsdojo_window_macos","path":"C:\\\\Users\\\\junte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\bitsdojo_window_macos-0.1.4\\\\","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_foundation","path":"C:\\\\Users\\\\junte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.6.0\\\\","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"sqflite_darwin","path":"C:\\\\Users\\\\junte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\sqflite_darwin-2.4.2\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"linux":[{"name":"bitsdojo_window_linux","path":"C:\\\\Users\\\\junte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\bitsdojo_window_linux-0.1.4\\\\","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_linux","path":"C:\\\\Users\\\\junte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_linux-2.2.1\\\\","native_build":false,"dependencies":[],"dev_dependency":false}],"windows":[{"name":"bitsdojo_window_windows","path":"C:\\\\Users\\\\junte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\bitsdojo_window_windows-0.1.6\\\\","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_windows","path":"C:\\\\Users\\\\junte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_windows-2.3.0\\\\","native_build":false,"dependencies":[],"dev_dependency":false}],"web":[]},"dependencyGraph":[{"name":"bitsdojo_window","dependencies":["bitsdojo_window_windows","bitsdojo_window_macos","bitsdojo_window_linux"]},{"name":"bitsdojo_window_linux","dependencies":[]},{"name":"bitsdojo_window_macos","dependencies":[]},{"name":"bitsdojo_window_windows","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"sqflite","dependencies":["sqflite_android","sqflite_darwin"]},{"name":"sqflite_android","dependencies":[]},{"name":"sqflite_darwin","dependencies":[]}],"date_created":"2026-03-05 23:51:56.159118","version":"3.38.5","swift_package_manager_enabled":{"ios":false,"macos":false}} \ No newline at end of file diff --git a/lib/features/connections/connections_panel.dart b/lib/features/connections/connections_panel.dart index 46e504ea..4b5673ff 100644 --- a/lib/features/connections/connections_panel.dart +++ b/lib/features/connections/connections_panel.dart @@ -342,9 +342,17 @@ class _ConnectionTile extends StatelessWidget { crossAxisAlignment: material.CrossAxisAlignment.start, mainAxisSize: material.MainAxisSize.min, children: [ - Text(connection.name).small(), + Text( + connection.name, + overflow: TextOverflow.ellipsis, + maxLines: 1, + ).small(), if (connection.host != null) - Text('${connection.host}:${connection.port ?? ''}').muted().xSmall(), + Text( + '${connection.host}:${connection.port ?? ''}', + overflow: TextOverflow.ellipsis, + maxLines: 1, + ).muted().xSmall(), ], ), ), @@ -424,7 +432,13 @@ class _FolderTile extends StatelessWidget { const Gap(2), material.Icon(material.Icons.folder_rounded, size: 18, color: theme.colorScheme.primary), const Gap(8), - Expanded(child: Text(name).small()), + Expanded( + child: Text( + name, + overflow: TextOverflow.ellipsis, + maxLines: 1, + ).small(), + ), ], ), ), diff --git a/lib/features/mongodb/mongo_documents_view.dart b/lib/features/mongodb/mongo_documents_view.dart index c785a6fe..0ed8782e 100644 --- a/lib/features/mongodb/mongo_documents_view.dart +++ b/lib/features/mongodb/mongo_documents_view.dart @@ -398,7 +398,7 @@ class _DocumentCardState extends State<_DocumentCard> { final cs = widget.colorScheme; final scs = widget.shadcnCs; final idStr = widget.document['_id']?.toString() ?? '—'; - final preview = _compactJson(widget.document); + final keysPreview = _keysPreview(widget.document); return material.MouseRegion( onEnter: (_) => setState(() => _hovered = true), @@ -473,15 +473,25 @@ class _DocumentCardState extends State<_DocumentCard> { material.Padding( padding: const material.EdgeInsets.only( left: 16, right: 16, bottom: 10), - child: material.SelectableText( - _expanded ? _prettyJson(widget.document) : preview, - style: material.TextStyle( - fontSize: 12, - fontFamily: 'monospace', - color: scs.mutedForeground, - ), - maxLines: _expanded ? null : 2, - ), + child: _expanded + ? material.SelectableText( + _prettyJson(widget.document), + style: material.TextStyle( + fontSize: 12, + fontFamily: 'monospace', + color: scs.mutedForeground, + ), + ) + : Text( + keysPreview, + overflow: TextOverflow.ellipsis, + maxLines: 1, + style: material.TextStyle( + fontSize: 12, + fontFamily: 'monospace', + color: scs.mutedForeground, + ), + ), ), ], ), @@ -489,12 +499,11 @@ class _DocumentCardState extends State<_DocumentCard> { ); } - String _compactJson(Map doc) { - try { - return json.encode(doc); - } catch (_) { - return doc.toString(); - } + /// Returns a compact list of top-level keys (excluding _id). + String _keysPreview(Map doc) { + final keys = doc.keys.where((k) => k != '_id').toList(); + if (keys.isEmpty) return '{ }'; + return keys.join(', '); } String _prettyJson(Map doc) { From 390cf39959259dcdd8d5be0d30035db7bbc19cb7 Mon Sep 17 00:00:00 2001 From: ZhuchkaTriplesix Date: Sat, 7 Mar 2026 10:40:06 +0300 Subject: [PATCH 2/2] fix: text overflow in connections panel - use material.Text directly to ensure TextOverflow.ellipsis works - shadcn extensions (.small()/.muted()) were wrapping and losing overflow --- .flutter-plugins-dependencies | 1 + .../connections/connections_panel.dart | 38 ++++++++++++------- 2 files changed, 26 insertions(+), 13 deletions(-) create mode 100644 .flutter-plugins-dependencies diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies new file mode 100644 index 00000000..18d87a5c --- /dev/null +++ b/.flutter-plugins-dependencies @@ -0,0 +1 @@ +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider_foundation","path":"C:\\\\Users\\\\junte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.6.0\\\\","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"sqflite_darwin","path":"C:\\\\Users\\\\junte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\sqflite_darwin-2.4.2\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"path_provider_android","path":"C:\\\\Users\\\\junte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_android-2.2.22\\\\","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"sqflite_android","path":"C:\\\\Users\\\\junte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\sqflite_android-2.4.2+2\\\\","native_build":true,"dependencies":[],"dev_dependency":false}],"macos":[{"name":"bitsdojo_window_macos","path":"C:\\\\Users\\\\junte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\bitsdojo_window_macos-0.1.4\\\\","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_foundation","path":"C:\\\\Users\\\\junte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_foundation-2.6.0\\\\","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"sqflite_darwin","path":"C:\\\\Users\\\\junte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\sqflite_darwin-2.4.2\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"linux":[{"name":"bitsdojo_window_linux","path":"C:\\\\Users\\\\junte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\bitsdojo_window_linux-0.1.4\\\\","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_linux","path":"C:\\\\Users\\\\junte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_linux-2.2.1\\\\","native_build":false,"dependencies":[],"dev_dependency":false}],"windows":[{"name":"bitsdojo_window_windows","path":"C:\\\\Users\\\\junte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\bitsdojo_window_windows-0.1.6\\\\","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"path_provider_windows","path":"C:\\\\Users\\\\junte\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\path_provider_windows-2.3.0\\\\","native_build":false,"dependencies":[],"dev_dependency":false}],"web":[]},"dependencyGraph":[{"name":"bitsdojo_window","dependencies":["bitsdojo_window_windows","bitsdojo_window_macos","bitsdojo_window_linux"]},{"name":"bitsdojo_window_linux","dependencies":[]},{"name":"bitsdojo_window_macos","dependencies":[]},{"name":"bitsdojo_window_windows","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"sqflite","dependencies":["sqflite_android","sqflite_darwin"]},{"name":"sqflite_android","dependencies":[]},{"name":"sqflite_darwin","dependencies":[]}],"date_created":"2026-03-07 10:36:50.253535","version":"3.38.5","swift_package_manager_enabled":{"ios":false,"macos":false}} \ No newline at end of file diff --git a/lib/features/connections/connections_panel.dart b/lib/features/connections/connections_panel.dart index 4b5673ff..91e15748 100644 --- a/lib/features/connections/connections_panel.dart +++ b/lib/features/connections/connections_panel.dart @@ -1,4 +1,4 @@ -import 'package:flutter/material.dart' as material show Padding, Container, BoxDecoration, Border, BorderSide, InkWell, Icon, Icons, IconData, Image, EdgeInsets, BorderRadius, CrossAxisAlignment, MainAxisSize, MouseRegion, SystemMouseCursors, DefaultTextStyle, TextStyle, CustomScrollView, SliverToBoxAdapter, SliverFillRemaining, SliverPadding, GestureDetector, HitTestBehavior, SizedBox, Column, AnimatedRotation, Row, BoxFit; +import 'package:flutter/material.dart' as material show Padding, Container, BoxDecoration, Border, BorderSide, InkWell, Icon, Icons, IconData, Image, EdgeInsets, BorderRadius, CrossAxisAlignment, MainAxisSize, MouseRegion, SystemMouseCursors, DefaultTextStyle, TextStyle, CustomScrollView, SliverToBoxAdapter, SliverFillRemaining, SliverPadding, GestureDetector, HitTestBehavior, SizedBox, Column, AnimatedRotation, Row, BoxFit, Text, TextOverflow, Expanded; import 'package:querya_desktop/core/storage/folders_storage.dart'; import 'package:querya_desktop/core/storage/local_db.dart'; import 'package:querya_desktop/shared/widgets/widgets.dart'; @@ -337,22 +337,30 @@ class _ConnectionTile extends StatelessWidget { children: [ iconWidget, const Gap(8), - Expanded( - child: Column( + material.Expanded( + child: material.Column( crossAxisAlignment: material.CrossAxisAlignment.start, mainAxisSize: material.MainAxisSize.min, children: [ - Text( + material.Text( connection.name, - overflow: TextOverflow.ellipsis, + overflow: material.TextOverflow.ellipsis, maxLines: 1, - ).small(), + style: material.TextStyle( + fontSize: 13, + color: theme.colorScheme.foreground, + ), + ), if (connection.host != null) - Text( + material.Text( '${connection.host}:${connection.port ?? ''}', - overflow: TextOverflow.ellipsis, + overflow: material.TextOverflow.ellipsis, maxLines: 1, - ).muted().xSmall(), + style: material.TextStyle( + fontSize: 11, + color: theme.colorScheme.mutedForeground, + ), + ), ], ), ), @@ -432,12 +440,16 @@ class _FolderTile extends StatelessWidget { const Gap(2), material.Icon(material.Icons.folder_rounded, size: 18, color: theme.colorScheme.primary), const Gap(8), - Expanded( - child: Text( + material.Expanded( + child: material.Text( name, - overflow: TextOverflow.ellipsis, + overflow: material.TextOverflow.ellipsis, maxLines: 1, - ).small(), + style: material.TextStyle( + fontSize: 13, + color: theme.colorScheme.foreground, + ), + ), ), ], ),