Skip to content

Commit 871e168

Browse files
BCzyzewskiclaude
andcommitted
fix(mobile): usage chart legend wraps instead of pushing the end date off
The start date, provider legend, and end date shared one non-wrapping row under the usage chart. With four or more providers the labels collided, and with five the last legend entry was clipped and the end date disappeared. Give the edge dates their own row and let the legend wrap on a separate one. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent f4da080 commit 871e168

1 file changed

Lines changed: 14 additions & 12 deletions

File tree

‎apps/mobile/src/features/usage/UsageRouteScreen.tsx‎

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -570,13 +570,20 @@ function ChartCard(props: {
570570
</View>
571571
)}
572572

573-
<View className="flex-row items-center justify-between">
574-
<Text className="text-xs text-foreground-tertiary">
575-
{props.isPast24Hours
576-
? formatHourShort(props.days[0] ?? "", props.timeZone)
577-
: formatDayShort(props.sinceDay)}
578-
</Text>
579-
<View className="flex-row items-center gap-4">
573+
<View className="gap-2">
574+
<View className="flex-row items-center justify-between">
575+
<Text className="text-xs text-foreground-tertiary">
576+
{props.isPast24Hours
577+
? formatHourShort(props.days[0] ?? "", props.timeZone)
578+
: formatDayShort(props.sinceDay)}
579+
</Text>
580+
<Text className="text-xs text-foreground-tertiary">
581+
{props.isPast24Hours
582+
? formatHourShort(props.days[props.days.length - 1] ?? "", props.timeZone)
583+
: formatDayShort(props.untilDay)}
584+
</Text>
585+
</View>
586+
<View className="flex-row flex-wrap items-center gap-x-4 gap-y-1">
580587
{merged.providers.map((provider) => (
581588
<View key={provider.provider} className="flex-row items-center gap-1.5">
582589
<View
@@ -589,11 +596,6 @@ function ChartCard(props: {
589596
</View>
590597
))}
591598
</View>
592-
<Text className="text-xs text-foreground-tertiary">
593-
{props.isPast24Hours
594-
? formatHourShort(props.days[props.days.length - 1] ?? "", props.timeZone)
595-
: formatDayShort(props.untilDay)}
596-
</Text>
597599
</View>
598600
</View>
599601
);

0 commit comments

Comments
 (0)