Cap analytics timeframe label
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-01-12 11:30:00 +01:00
parent dce24bb86a
commit ce0ab269c9
3 changed files with 16 additions and 4 deletions

View File

@@ -2883,6 +2883,7 @@
"kpiLikes": "Likes",
"activityTitle": "Aktivitäts-Zeitachse",
"timeframe": "Letzte {{hours}} Stunden",
"timeframeHint": "Ältere Aktivität ausgeblendet",
"uploadsPerHour": "Uploads pro Stunde",
"noActivity": "Noch keine Uploads",
"emptyActionShareQr": "QR-Code teilen",

View File

@@ -2887,6 +2887,7 @@
"kpiLikes": "Likes",
"activityTitle": "Activity Timeline",
"timeframe": "Last {{hours}} hours",
"timeframeHint": "Older activity hidden",
"uploadsPerHour": "Uploads per hour",
"noActivity": "No uploads yet",
"emptyActionShareQr": "Share your QR code",

View File

@@ -98,7 +98,10 @@ export default function MobileEventAnalyticsPage() {
const hasTimeline = timeline.length > 0;
const hasContributors = contributors.length > 0;
const hasTasks = tasks.length > 0;
const timeframeHours = resolveTimelineHours(timeline.map((point) => point.timestamp), 12);
const fallbackHours = 12;
const rawTimelineHours = resolveTimelineHours(timeline.map((point) => point.timestamp), fallbackHours);
const timeframeHours = Math.min(rawTimelineHours, fallbackHours);
const isTimeframeCapped = rawTimelineHours > fallbackHours;
// Prepare chart data
const maxTimelineCount = resolveMaxCount(timeline.map((point) => point.count));
@@ -144,9 +147,16 @@ export default function MobileEventAnalyticsPage() {
{t('analytics.activityTitle', 'Activity Timeline')}
</Text>
</XStack>
<Text fontSize="$xs" color={muted}>
{t('analytics.timeframe', 'Last {{hours}} hours', { hours: timeframeHours })}
</Text>
<YStack space="$0.5">
<Text fontSize="$xs" color={muted}>
{t('analytics.timeframe', 'Last {{hours}} hours', { hours: timeframeHours })}
</Text>
{isTimeframeCapped ? (
<Text fontSize="$xs" color={muted}>
{t('analytics.timeframeHint', 'Older activity hidden')}
</Text>
) : null}
</YStack>
{hasTimeline ? (
<YStack height={180} justifyContent="flex-end" space="$2">