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.
This commit is contained in:
Levi committed 2026-09-19 20:02:28 +08:00
1 parent 51b7abed48
commit 948f6d5487
4 files changed
+21 -9

No files matched your search

@@ -994,10 +994,12 @@ class _ExtensionCard extends ConsumerWidget {
), ),
), ),
if (canUpdate && installed != null) if (canUpdate && installed != null)
ExtensionUpdateStatus( Flexible(
key: ValueKey('extension-card-update-status-${item.id}'), child: ExtensionUpdateStatus(
label: context.l10n.extensionCanUpdate, key: ValueKey('extension-card-update-status-${item.id}'),
onTap: busy ? null : () => showExtensionUpdateDialog(context, installed), label: context.l10n.extensionCanUpdate,
onTap: busy ? null : () => showExtensionUpdateDialog(context, installed),
),
), ),
], ],
), ),
@@ -23,9 +23,13 @@ class ExtensionUpdateStatus extends StatelessWidget {
), ),
if (label != null) ...[ if (label != null) ...[
const SizedBox(width: 5), const SizedBox(width: 5),
Text( Flexible(
label!, child: Text(
style: TextStyle(color: palette.textPrimary, fontSize: 11.5, fontWeight: FontWeight.w600), label!,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(color: palette.textPrimary, fontSize: 11.5, fontWeight: FontWeight.w600),
),
), ),
], ],
], ],
@@ -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!),
],
], ],
), ),
), ),
@@ -66,7 +66,10 @@ class AppDetailPage extends StatelessWidget {
style: TextStyle(color: palette.textPrimary, fontSize: 17, fontWeight: FontWeight.w700), 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!),
],
], ],
), ),
), ),