From 564719165e9131ab2aa55e9c805b860a415690da Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Sun, 13 Sep 2026 19:45:37 -0700 Subject: [PATCH] fix(mobile): keep usage widget rows consistently sized (#11669) --- apps/mobile/src/widgets/SubscriptionUsage.tsx | 59 +++++++++---------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/apps/mobile/src/widgets/SubscriptionUsage.tsx b/apps/mobile/src/widgets/SubscriptionUsage.tsx index 600383765d592280582236fa2238119c3f3db3fa..c8cde5d444fecd10307249f74bda33a8ed640bce 100644 --- a/apps/mobile/src/widgets/SubscriptionUsage.tsx +++ b/apps/mobile/src/widgets/SubscriptionUsage.tsx @@ -2,12 +2,12 @@ import { HStack, ProgressView, Spacer, Text, VStack } from "@expo/ui/swift-ui"; import { accessibilityElement, accessibilityLabel, + fixedSize, font, foregroundStyle, frame, layoutPriority, lineLimit, - minimumScaleFactor, progressViewStyle, tint, widgetURL, @@ -33,6 +33,8 @@ function SubscriptionUsage( const accessory = family === "accessoryRectangular"; const compact = family === "systemSmall" || accessory || environment.levelOfDetail === "simplified"; + // Budget short cards for two quotas per provider, including their secondary text. + const dense = family === "systemSmall" || family === "systemMedium"; const limit = family === "systemExtraLarge" ? 6 : family === "systemLarge" ? 4 : 2; const monochrome = environment.widgetRenderingMode !== "fullColor" || environment.isLuminanceReduced; @@ -77,6 +79,7 @@ function SubscriptionUsage( : provider.detail; const barModifiers = [ progressViewStyle("linear"), + frame({ height: 4 }), ...(monochrome ? [] : [tint(provider.name === "Claude" ? "#d97757" : "#8e8e93")]), ]; if (accessory) { @@ -99,7 +102,6 @@ function SubscriptionUsage( modifiers={[ font({ textStyle: "caption", weight: "semibold" }), lineLimit(1), - minimumScaleFactor(0.75), foregroundStyle("primary"), ]} > @@ -132,35 +134,37 @@ function SubscriptionUsage( {provider.name} - {(!compact || shown.length === 0) && detail !== "Subscription remaining" ? ( + {!compact || shown.length === 0 ? ( - {detail} + {detail === "Subscription remaining" ? " " : detail} ) : null} {shown.map((window) => ( {window.label} @@ -182,9 +185,11 @@ function SubscriptionUsage( {!compact ? ( - + {window.reset} ) : null} @@ -216,7 +214,13 @@ function SubscriptionUsage( {!compact && !stale && (period === "auto" ? (provider.totalWindows ?? windows.length) : windows.length) > limit ? ( - + {(period === "auto" ? (provider.totalWindows ?? windows.length) : windows.length) - limit}{" "} more in T3 @@ -228,11 +232,11 @@ function SubscriptionUsage( return ( {compact ? ( - + {columns} ) : ( @@ -243,12 +247,7 @@ function SubscriptionUsage( {!accessory ? : null} {!accessory ? ( {props.checkedAt ? `As of ${new Date(props.checkedAt).toLocaleString(undefined, { hour: "numeric", minute: "2-digit", month: "short", day: "numeric" })}` -- 2.54.0