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

75 lines
1.8 KiB
TypeScript

import { useThemeStore } from '../stores/theme';
export const theme = {
bg: 'bg-white',
surface: 'bg-neutral-50',
surfaceElevated: 'bg-neutral-100',
border: 'border-neutral-200',
text: 'text-neutral-900',
textMuted: 'text-neutral-500',
brandOrange: 'text-rebreak-500',
brandOrangeBg: 'bg-rebreak-500',
brandBlue: 'bg-midnight-800',
} as const;
export type ColorScheme = {
bg: string;
surface: string;
surfaceElevated: string;
/** iOS systemGroupedBackground — page background for list/settings screens */
groupedBg: string;
/** iOS secondarySystemGroupedBackground — card/row surface within grouped pages */
card: string;
border: string;
text: string;
textMuted: string;
brandOrange: string;
brandBlue: string;
success: string;
error: string;
warning: string;
};
const light: ColorScheme = {
bg: '#ffffff',
surface: '#fafafa',
surfaceElevated: '#f5f5f5',
groupedBg: '#F2F2F7',
card: '#ffffff',
border: '#e5e5e5',
text: '#0a0a0a',
textMuted: '#737373',
brandOrange: '#007AFF',
brandBlue: '#0e1f3a',
success: '#16a34a',
error: '#dc2626',
warning: '#f59e0b',
};
const dark: ColorScheme = {
bg: '#000000',
surface: '#1c1c1e',
surfaceElevated: '#2c2c2e',
groupedBg: '#000000',
card: '#1c1c1e',
border: '#38383a',
text: '#ffffff',
textMuted: '#8e8e93',
brandOrange: '#007AFF',
brandBlue: '#0e1f3a',
success: '#30d158',
error: '#ff453a',
warning: '#ffd60a',
};
export const colorSchemes = { light, dark };
export function useColors(): ColorScheme {
const scheme = useThemeStore((s) => s.colorScheme);
return scheme === 'dark' ? dark : light;
}
// Legacy flat export — used by files that haven't migrated to useColors() yet.
// Wave 2 should remove this.
export const colors = light;