chahinebrini 01d515d137 feat(rebreak-native): persistent FaceID-sign-in + iOS-grouped UI + Outlook guard + sparkline cooldowns
Auth / FaceID — eingeloggt bleiben funktioniert jetzt:
- AppLock-Init idempotent: late re-init durch router.replace-Re-Mount behält
  locked-State (fixt Endlosschleife: unlock → re-mount → init reset → lock)
- LockScreen-Auto-Prompt nur wenn AppState=active (verhindert silent FaceID-
  Fail wenn LockScreen während background-Event mountet — User sah dann nur
  Fallback-Button)
- index.tsx: wenn Session schon in AsyncStorage liegt → router.replace zu /(app),
  Landing wird übersprungen; early-return nach allen Hooks (Rules of Hooks)
- WebBrowser.dismissAuthSession vor openAuthSessionAsync (verhindert
  "Another web browser is already open" nach abgebrochenen OAuth-Flows)

UI — iOS-Grouped-Look auf Settings + Profile:
- Neue Theme-Tokens groupedBg (#F2F2F7 / #000) + card (#fff / #1c1c1e),
  identisch zu Apples systemGroupedBackground / secondarySystemGroupedBackground
- settings.tsx + profile/index.tsx + profile/[userId].tsx: Page-BG → groupedBg
- StreakSection / UrgeStatsCard / DemographicsAccordion / StatsBar /
  ApprovedDomainsList: Card-BG colors.surface → colors.card

Mail-Connect — Outlook-Tile entschärft:
- Microsoft hat App-Passwords für consumer-Outlook (.com/hotmail/live/msn) im
  September 2024 abgeschaltet, der bisherige Guide-Flow ist seit ~8 Monaten
  wirkungslos → AUTHENTICATIONFAILED
- Tile bleibt sichtbar mit opacity 0.45, "Kommt bald"-Sub-Label, disabled=true
- Provider-Typ um disabled? + disabledLabelKey? erweitert (wiederverwendbar)
- Backend-OAuth-Plan unter backend/docs/mail-outlook-oauth-plan.md (mo)
  → Generisches AuthMethod-Framework (app_password | oauth) geplant

Profile — Cooldown-Verlauf als Sparkline statt Endlos-Liste:
- 8 Wochen-Buckets, Bar-Höhe nach Frequenz (cap 5/Woche), leere Wochen als
  2px-Flatlines
- Sub-Label: "{n} Cooldowns in 8 Wochen · Ø 1 pro {avg} Wochen · zuletzt {date}"
- Neutral formuliert (Sucht-/Stigma-Sensibilität: Cooldown = Schutz-Pause,
  kein Rückfall)
- useProfileData.ts liefert rawStartedAt (ISO) zusätzlich zum formatierten Wert
- i18n-Keys unter profile.cooldown.* in DE + EN

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 16:15:54 +02:00

100 lines
2.3 KiB
TypeScript

import { View, Text, TouchableOpacity } from 'react-native';
import { useColors } from '../../lib/theme';
type Props = {
postsCount: number;
followersCount: number;
approvedDomainsCount: number;
onPostsPress?: () => void;
onFollowersPress?: () => void;
onApprovedDomainsPress?: () => void;
};
type CardProps = {
value: string;
label: string;
onPress?: () => void;
};
function StatPill({ value, label, onPress }: CardProps) {
const colors = useColors();
return (
<TouchableOpacity
onPress={onPress}
activeOpacity={0.6}
>
<View
style={{
backgroundColor: colors.card,
borderWidth: 1,
borderColor: colors.border,
borderRadius: 999,
paddingVertical: 10,
paddingHorizontal: 18,
alignItems: 'center',
minWidth: 88,
shadowColor: '#000',
shadowOffset: { width: 0, height: 1 },
shadowOpacity: 0.05,
shadowRadius: 2,
elevation: 1,
}}
>
<Text
style={{
fontSize: 18,
color: colors.text,
fontFamily: 'Nunito_700Bold',
letterSpacing: -0.2,
}}
>
{value}
</Text>
<Text
style={{
marginTop: 1,
fontSize: 10,
color: colors.textMuted,
fontFamily: 'Nunito_600SemiBold',
textAlign: 'center',
}}
numberOfLines={1}
>
{label}
</Text>
</View>
</TouchableOpacity>
);
}
export function StatsBar({
postsCount,
followersCount,
approvedDomainsCount,
onPostsPress,
onFollowersPress,
onApprovedDomainsPress,
}: Props) {
return (
<View style={{ paddingHorizontal: 16 }}>
<View
style={{
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center',
gap: 10,
flexWrap: 'wrap',
}}
>
<StatPill value={String(postsCount)} label="Posts" onPress={onPostsPress} />
<StatPill value={String(followersCount)} label="Follower" onPress={onFollowersPress} />
<StatPill
value={String(approvedDomainsCount)}
label="Domains"
onPress={onApprovedDomainsPress}
/>
</View>
</View>
);
}