From bae64cd8c243dad5834430f89dcce0cd69dc6c89 Mon Sep 17 00:00:00 2001
From: RarDog
Date: Fri, 4 Sep 2026 17:18:50 +0300
Subject: [PATCH] feat: widen tag suggestions dropdown and allow 2-line wrap
(v3.0.4)
---
README.md | 2 +-
lib/app/app_version.dart | 4 +--
lib/shared/widgets/app_search_bar.dart | 39 ++++++++++++++++++++------
pubspec.yaml | 2 +-
4 files changed, 35 insertions(+), 12 deletions(-)
diff --git a/README.md b/README.md
index c25b7f9..6f3b7f3 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@
-
+
diff --git a/lib/app/app_version.dart b/lib/app/app_version.dart
index f45d1a7..627de63 100644
--- a/lib/app/app_version.dart
+++ b/lib/app/app_version.dart
@@ -1,3 +1,3 @@
-const appDisplayVersion = '3.0.3';
-const appBuildNumber = 54;
+const appDisplayVersion = '3.0.4';
+const appBuildNumber = 55;
const appReleaseChannel = 'Stable';
diff --git a/lib/shared/widgets/app_search_bar.dart b/lib/shared/widgets/app_search_bar.dart
index 44702e4..2f373aa 100644
--- a/lib/shared/widgets/app_search_bar.dart
+++ b/lib/shared/widgets/app_search_bar.dart
@@ -192,23 +192,46 @@ class _TagInputSearchBarState extends State {
return const SizedBox.shrink();
}
+ final screenSize = MediaQuery.sizeOf(context);
final renderBox =
_fieldKey.currentContext?.findRenderObject() as RenderBox?;
- final width =
+ final fieldWidth =
renderBox?.hasSize == true ? renderBox!.size.width : 360.0;
- final height =
+ final fieldHeight =
renderBox?.hasSize == true ? renderBox!.size.height : 48.0;
+ final screenW = screenSize.width;
+ // Substantially wider dropdown:
+ // Mobile (< 600px): use full screen width minus comfortable 24px margins.
+ // Desktop/Tablet (>= 600px): expand to 1.35x field width, up to 780px.
+ final dropdownWidth = screenW < 600
+ ? (screenW - 24.0).clamp(fieldWidth, 580.0)
+ : (fieldWidth * 1.35).clamp(fieldWidth, (screenW - 32.0).clamp(fieldWidth, 780.0));
+
+ // Ensure dropdown stays fully on screen and doesn't get clipped
+ double dxOffset = 0.0;
+ if (renderBox?.hasSize == true && renderBox?.attached == true) {
+ final globalPos = renderBox!.localToGlobal(Offset.zero);
+ final globalRight = globalPos.dx + dropdownWidth;
+ final maxRight = screenW - 12.0;
+ if (globalRight > maxRight) {
+ dxOffset = maxRight - globalRight;
+ }
+ if (globalPos.dx + dxOffset < 12.0) {
+ dxOffset = 12.0 - globalPos.dx;
+ }
+ }
+
return CompositedTransformFollower(
link: _layerLink,
showWhenUnlinked: false,
- offset: Offset(0, height + 6),
+ offset: Offset(dxOffset, fieldHeight + 6),
child: Align(
alignment: Alignment.topLeft,
child: TapRegion(
groupId: _fieldKey,
child: SizedBox(
- width: width.clamp(280.0, 620.0),
+ width: dropdownWidth,
child: _TagSuggestionDropdown(
suggestions: suggestions,
query: token,
@@ -565,7 +588,7 @@ class _TagSuggestionDropdown extends StatelessWidget {
Widget build(BuildContext context) {
final scheme = Theme.of(context).colorScheme;
return ConstrainedBox(
- constraints: const BoxConstraints(maxWidth: 620),
+ constraints: const BoxConstraints(maxWidth: 820),
child: Material(
elevation: 8,
shadowColor: Colors.black.withValues(alpha: 0.18),
@@ -641,7 +664,7 @@ class _TagSuggestionDropdown extends StatelessWidget {
if (cleanToken.isEmpty) {
return Text(
text,
- maxLines: 1,
+ maxLines: 2,
overflow: TextOverflow.ellipsis,
style: defaultStyle,
);
@@ -653,7 +676,7 @@ class _TagSuggestionDropdown extends StatelessWidget {
if (matchIndex < 0) {
return Text(
text,
- maxLines: 1,
+ maxLines: 2,
overflow: TextOverflow.ellipsis,
style: defaultStyle,
);
@@ -678,7 +701,7 @@ class _TagSuggestionDropdown extends StatelessWidget {
if (after.isNotEmpty) TextSpan(text: after),
],
),
- maxLines: 1,
+ maxLines: 2,
overflow: TextOverflow.ellipsis,
);
}
diff --git a/pubspec.yaml b/pubspec.yaml
index 52f5042..3e67b74 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,7 +1,7 @@
name: gel_rule_app
description: Local backend/core layer for a Flutter booru browser app.
publish_to: "none"
-version: 3.0.3+54
+version: 3.0.4+55
environment:
sdk: ">=3.3.0 <4.0.0"