fix(ui): unify extension update check and improve update affordance

- Update availability is now decided solely by the backend live GitHub
  check (updateFlags); the store index may lag and previously masked
  new versions in the market view.
- Replace the ambiguous refresh icon on extension cards with a labeled
  update button, and add a red dot badge on extension icons (card and
  detail view) when an update is available.
- Surface a toast when the update check fails instead of failing silently.
This commit is contained in:
Levi committed 2026-09-19 17:32:44 +08:00
1 parent 694b43e3f9
commit 172f4a3650
5 files changed
+81 -58

No files matched your search

@@ -65,12 +65,32 @@ class ExtensionDetailView extends ConsumerWidget {
key: const ValueKey('extension-details-hero'),
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ExtensionIcon(
item: current,
size: mobile ? 60 : 68,
borderRadius: BorderRadius.circular(14),
fallbackPadding: EdgeInsets.all((mobile ? 60 : 68) * 0.16),
fallbackBackgroundColor: palette.surfaceSoft,
Stack(
clipBehavior: Clip.none,
children: [
ExtensionIcon(
item: current,
size: mobile ? 60 : 68,
borderRadius: BorderRadius.circular(14),
fallbackPadding: EdgeInsets.all((mobile ? 60 : 68) * 0.16),
fallbackBackgroundColor: palette.surfaceSoft,
),
if (canUpdate)
Positioned(
top: -2,
right: -2,
child: Container(
key: const ValueKey('extension-details-update-dot'),
width: 13,
height: 13,
decoration: BoxDecoration(
color: palette.error,
shape: BoxShape.circle,
border: Border.all(color: palette.bg, width: 2.5),
),
),
),
],
),
SizedBox(width: mobile ? 16 : 20),
Expanded(
@@ -135,7 +155,7 @@ class ExtensionDetailView extends ConsumerWidget {
key: const ValueKey('extension-details-update'),
loading: false,
variant: AppLoadingButtonVariant.primary,
icon: const Icon(Icons.refresh, size: 16),
icon: const Icon(Icons.upgrade, size: 16),
onPressed: busy ? null : () => showExtensionUpdateDialog(context, installed),
child: Text(context.l10n.newVersionUpdate),
),