From 948f6d54875010cfde73584e7cbadacc43dfc867 Mon Sep 17 00:00:00 2001 From: Levi Date: Sat, 19 Sep 2026 20:02:28 +0800 Subject: [PATCH] fix(ui): let the update status chip shrink instead of overflow Long translations (e.g. Italian, Tamil) could exceed the card title row on minimum-width cards. The chip is now flex-sized and its label ellipsizes, so the title and chip degrade gracefully at any width and locale. --- .../extensions/presentation/pages/extensions_page.dart | 10 ++++++---- .../presentation/widgets/extension_update_status.dart | 10 +++++++--- .../widgets/detail/app_detail_surface_desktop.dart | 5 ++++- .../widgets/detail/app_detail_surface_mobile.dart | 5 ++++- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/ui/flutter/lib/features/extensions/presentation/pages/extensions_page.dart b/ui/flutter/lib/features/extensions/presentation/pages/extensions_page.dart index 437b4971..e1635150 100644 --- a/ui/flutter/lib/features/extensions/presentation/pages/extensions_page.dart +++ b/ui/flutter/lib/features/extensions/presentation/pages/extensions_page.dart @@ -994,10 +994,12 @@ class _ExtensionCard extends ConsumerWidget { ), ), if (canUpdate && installed != null) - ExtensionUpdateStatus( - key: ValueKey('extension-card-update-status-${item.id}'), - label: context.l10n.extensionCanUpdate, - onTap: busy ? null : () => showExtensionUpdateDialog(context, installed), + Flexible( + child: ExtensionUpdateStatus( + key: ValueKey('extension-card-update-status-${item.id}'), + label: context.l10n.extensionCanUpdate, + onTap: busy ? null : () => showExtensionUpdateDialog(context, installed), + ), ), ], ), diff --git a/ui/flutter/lib/features/extensions/presentation/widgets/extension_update_status.dart b/ui/flutter/lib/features/extensions/presentation/widgets/extension_update_status.dart index 046b5a21..755e363a 100644 --- a/ui/flutter/lib/features/extensions/presentation/widgets/extension_update_status.dart +++ b/ui/flutter/lib/features/extensions/presentation/widgets/extension_update_status.dart @@ -23,9 +23,13 @@ class ExtensionUpdateStatus extends StatelessWidget { ), if (label != null) ...[ const SizedBox(width: 5), - Text( - label!, - style: TextStyle(color: palette.textPrimary, fontSize: 11.5, fontWeight: FontWeight.w600), + Flexible( + child: Text( + label!, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle(color: palette.textPrimary, fontSize: 11.5, fontWeight: FontWeight.w600), + ), ), ], ], diff --git a/ui/flutter/lib/shared/widgets/detail/app_detail_surface_desktop.dart b/ui/flutter/lib/shared/widgets/detail/app_detail_surface_desktop.dart index 3c9294ad..509248d8 100644 --- a/ui/flutter/lib/shared/widgets/detail/app_detail_surface_desktop.dart +++ b/ui/flutter/lib/shared/widgets/detail/app_detail_surface_desktop.dart @@ -98,7 +98,10 @@ class AppDetailDrawer extends StatelessWidget { ), ), ), - if (titleTrailing != null) ...[const SizedBox(width: 8), titleTrailing!], + if (titleTrailing != null) ...[ + const SizedBox(width: 8), + Flexible(child: titleTrailing!), + ], ], ), ), diff --git a/ui/flutter/lib/shared/widgets/detail/app_detail_surface_mobile.dart b/ui/flutter/lib/shared/widgets/detail/app_detail_surface_mobile.dart index 1b191e85..cc807e68 100644 --- a/ui/flutter/lib/shared/widgets/detail/app_detail_surface_mobile.dart +++ b/ui/flutter/lib/shared/widgets/detail/app_detail_surface_mobile.dart @@ -66,7 +66,10 @@ class AppDetailPage extends StatelessWidget { style: TextStyle(color: palette.textPrimary, fontSize: 17, fontWeight: FontWeight.w700), ), ), - if (titleTrailing != null) ...[const SizedBox(width: 8), titleTrailing!], + if (titleTrailing != null) ...[ + const SizedBox(width: 8), + Flexible(child: titleTrailing!), + ], ], ), ),