diff --git a/apps/rebreak-native/components/mail/MailDistributionChart.tsx b/apps/rebreak-native/components/mail/MailDistributionChart.tsx index b636e85..8b93a68 100644 --- a/apps/rebreak-native/components/mail/MailDistributionChart.tsx +++ b/apps/rebreak-native/components/mail/MailDistributionChart.tsx @@ -112,7 +112,7 @@ export function MailDistributionChart({ data, hero, totalBlocked, isLegend }: Pr centerLabel={centerLabel} width={DONUT_WIDTH} /> - + {slices.map((slice) => ( ))} diff --git a/apps/rebreak-native/hooks/useMailStats.ts b/apps/rebreak-native/hooks/useMailStats.ts index dbb5d7e..2780438 100644 --- a/apps/rebreak-native/hooks/useMailStats.ts +++ b/apps/rebreak-native/hooks/useMailStats.ts @@ -73,10 +73,11 @@ export function useMailConnectionStats( data = aggregateToWeeks(raw); } else if (granularity === 'month') { data = aggregateToMonths(raw); - } else if (nonEmpty.length > 0 && nonEmpty.length * 3 < raw.length) { - // Sparse data (z.B. nur 1-2 Tage von 30): zoom in auf die echte Range - // zwischen erstem und letztem Hit. Vermeidet 30 leere Bars + 1 Bar - // ganz rechts wie bei einer frischen Outlook-Connection. + } else if (nonEmpty.length > 0) { + // IMMER auf die echte Hit-Range zoomen — von erstem nonEmpty bis + // letztem nonEmpty. Gaps dazwischen bleiben sichtbar (für realistische + // Verteilung), aber 29 leere Slots am Anfang + 1 Bar am Ende wird + // auf z.B. 1-3 Bars geschrumpft. Trim eliminiert das visuelle Rauschen. const firstDate = nonEmpty[0].date; const lastDate = nonEmpty[nonEmpty.length - 1].date; data = raw.filter((e) => e.date >= firstDate && e.date <= lastDate);