Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
e76b632
feat(home): Implement Home screen and LogModal component
FLAiRistaken Apr 29, 2026
1011c80
Merge branch 'develop' into jules-12581405909111372036-0694be4b
FLAiRistaken Apr 29, 2026
3e08024
fix: address all review comments on HomeScreen and LogModal
Copilot Apr 29, 2026
db63646
Merge pull request #11 from FLAiRistaken/jules-12581405909111372036-0…
FLAiRistaken Apr 29, 2026
7fac4ca
feat: add .coderabbit.yaml configuration for automated code reviews a…
FLAiRistaken Apr 29, 2026
f58cfd2
feat: implement AI onboarding screen and fix Apple auth gate
FLAiRistaken Apr 29, 2026
b0fbe21
fix(auth): Fix TypeScript error with GoogleSignin.signIn() return type
FLAiRistaken Apr 29, 2026
31693e1
chore: update CodeRabbit configuration to include base branches for a…
FLAiRistaken Apr 29, 2026
555d195
Merge branch 'develop' into jules-16776806372225523666-0fb0d3b1
FLAiRistaken Apr 29, 2026
bdd3fb1
fix: apply CodeRabbit auto-fixes
coderabbitai[bot] Apr 29, 2026
cf25f25
fix: apply CodeRabbit auto-fixes
coderabbitai[bot] Apr 29, 2026
a35d89a
Merge pull request #13 from FLAiRistaken/jules-16776806372225523666-0…
FLAiRistaken Apr 29, 2026
033c8e3
Merge branch 'develop' into jules-12581405909111372036-0694be4b
FLAiRistaken Apr 30, 2026
ffa0591
fix: resolve type mismatch for GoogleSignInResult in AuthScreen authe…
FLAiRistaken Apr 30, 2026
fe5f0c8
Merge branch 'develop' into jules-12581405909111372036-0694be4b
FLAiRistaken Apr 30, 2026
ab50533
Merge pull request #15 from FLAiRistaken/jules-12581405909111372036-0…
FLAiRistaken Apr 30, 2026
598b16f
feat: add email/password authentication
FLAiRistaken Apr 30, 2026
a33d8a0
fix: apply CodeRabbit auto-fixes
coderabbitai[bot] Apr 30, 2026
7229569
refactor: update theme constants and enhance AuthScreen layout with k…
FLAiRistaken Apr 30, 2026
62fb848
style: update AuthScreen divider height and input padding to use them…
FLAiRistaken Apr 30, 2026
380b71c
Merge pull request #16 from FLAiRistaken/email-password-auth-12826351…
FLAiRistaken Apr 30, 2026
4730225
refactor: remove DEV_BYPASS_AUTH configuration and related bypass log…
FLAiRistaken Apr 30, 2026
03d2684
feat: Add 30-second undo window for log entries
FLAiRistaken Apr 30, 2026
c11f0c7
fix: apply CodeRabbit auto-fixes
coderabbitai[bot] Apr 30, 2026
9011f26
Fix AuthScreen layout and visual design
FLAiRistaken Apr 30, 2026
fb4cf07
refactor: implement ProfileContext to provide global profile state an…
FLAiRistaken Apr 30, 2026
b02dd61
fix: apply CodeRabbit auto-fixes
coderabbitai[bot] Apr 30, 2026
9c1eed9
fix: apply CodeRabbit auto-fixes
coderabbitai[bot] Apr 30, 2026
de1ca62
fix: apply CodeRabbit auto-fixes
coderabbitai[bot] Apr 30, 2026
c108843
Merge pull request #18 from FLAiRistaken/jules-auth-screen-fix-127732…
FLAiRistaken Apr 30, 2026
f09c739
feat: propagate and handle undo expiry errors in useLogs and HomeScreen
FLAiRistaken Apr 30, 2026
abe3b5e
Merge pull request #17 from FLAiRistaken/jules-8058343189451850315-cc…
FLAiRistaken Apr 30, 2026
b4c2c59
fix: force logout and redirect to auth when user session lacks a profile
FLAiRistaken Apr 30, 2026
f56c051
refactor: update onboarding flow to require account creation before p…
FLAiRistaken Apr 30, 2026
b3baf53
refactor: remove unused useEffect and supabase import from RootNavigator
FLAiRistaken Apr 30, 2026
4e32c50
feat: implement automatic sign-in when sign-up fails due to existing …
FLAiRistaken Apr 30, 2026
89af3dd
refactor: migrate profile update to direct upsert call and increase s…
FLAiRistaken Apr 30, 2026
3810d36
refactor: implement polling for session availability and manual profi…
FLAiRistaken Apr 30, 2026
bce1f4f
refactor: add setProfile to ProfileContext and update OnboardingScree…
FLAiRistaken Apr 30, 2026
3f2850e
feat: add onboarding tutorial plan and suppress account creation flic…
FLAiRistaken Apr 30, 2026
ee2343f
feat: add isCreatingAccount state to ProfileContext and use it to gat…
FLAiRistaken Apr 30, 2026
06c143f
refactor: update UI components and screens to use centralized theme c…
FLAiRistaken Apr 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
language: "en-GB"

reviews:
profile: "assertive"
auto_review:
enabled: true
drafts: false
base_branches:
- "main"
- "develop"
path_filters:
- "!prototype/**"
- "!docs/**"
- "!**/*.md"
path_instructions:
- path: "src/screens/**"
instructions: |
Check that all colours reference Colors.* from theme.ts — no hardcoded hex values.
Check that all fonts reference Fonts.* and FontSizes.* from theme.ts.
Check that safe area insets are handled.
Check that all styles are in StyleSheet.create() except dynamic values.
- path: "src/lib/db.ts"
instructions: |
There must be no deleteLog or any log deletion function — this is a product rule.
updateLog must never allow changing the type field (win/sin).
All queries must filter on both id and user_id, never id alone.
- path: "src/lib/anthropic.ts"
instructions: |
Every fetch call must have an AbortController timeout.
The API key must be checked at call time, not module init.
- path: "src/hooks/**"
instructions: |
Never reimplement logic that exists in useAuth, useLogs, useStats, or useProfile.
Supabase queries must use .maybeSingle() not .single().
All user values passed into Anthropic prompts must go through sanitizePromptValue().

chat:
auto_reply: true
37 changes: 26 additions & 11 deletions Build_plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
> Tracks build order, completed tasks, and what's coming next.
> Updated by Jules as part of each task. Do not edit manually outside that flow.

| 3.7 | Undo window (30s) | ✅ Done | Hard delete within 30s window only, undo toast in HomeScreen |

---

## Orchestration Setup
Expand Down Expand Up @@ -45,26 +47,28 @@ All Jules prompts are written by the Orchestrator. Copilot reviews every PR. Orc
| 1.6 | Business logic hooks | ✅ Done | useAuth, useLogs (offline queue + AppState listener), useStats (DST-safe), useProfile |
| 1.7 | Dev auth bypass | ✅ Done | `src/lib/devConfig.ts` — `DEV_BYPASS_AUTH = __DEV__ && true` |
| 1.8 | Google Sign In stub | ✅ Done | `src/lib/googleSignIn.ts` — for Expo Go compatibility |
| 1.9 | Email/password auth | ✅ Done | Added to AuthScreen for dev testing and as production fallback |

---

### 🔄 Phase 2 — Onboarding (in flight)
| # | Task | Status | Notes |
|---|---|---|---|
| 2.1 | Onboarding screen | 🔄 In Progress | Jules prompt 08 — AI-powered, 6 questions, Anthropic API |
| 2.2 | Profile creation on complete | 🔄 In Progress | Bundled with 2.1 — writes profile via `updateProfile()` on `ONBOARDING_COMPLETE_TOKEN` |
| 2.1 | Onboarding screen | ✅ Done | Includes sign-in link on Q1, account creation final step |
| 2.2 | Profile creation on complete | ✅ Done | Written after signUp at end of onboarding |

---

### 🔄 Phase 3 — Home Screen (in flight)
| # | Task | Status | Notes |
|---|---|---|---|
| 3.1 | Home screen layout | 🔄 In Progress | Jules prompt 09 — Greeting, two buttons, stats, ratio card, streak dots |
| 3.2 | Log modal | 🔄 In Progress | Bundled with 3.1 — `src/components/LogModal.tsx` bottom sheet |
| 3.3 | Streak dots component | 🔄 In Progress | Inline in Home screen |
| 3.4 | Ratio bar component | 🔄 In Progress | Inline in Home screen |
| 3.5 | Today's log list | 🔄 In Progress | Inline, collapsible |
| 3.6 | Offline queue | ✅ Done | Already implemented in useLogs |
| 3.1 | Home screen layout | ✅ Done | Greeting, two buttons, stats row |
| 3.2 | Log modal | ✅ Done | Bottom sheet — category, context, note |
| 3.3 | Streak dots component | ✅ Done | 7-day visual |
| 3.4 | Ratio bar component | ✅ Done | 7-day own work % with personal avg |
| 3.5 | Today's log list | ✅ Done | Collapsible, reverse chronological |
| 3.6 | Offline queue | ✅ Done | Implemented in useLogs — AsyncStorage queue, flushes on reconnect and app foreground |
| 3.7 | Undo window (30s) | ✅ Done | Hard delete within 30s window only, undo toast in HomeScreen |

---

Expand Down Expand Up @@ -106,6 +110,7 @@ All Jules prompts are written by the Orchestrator. Copilot reviews every PR. Orc
| 7.8 | Privacy policy + terms | 🔲 Pending | Auth screen references these — need real URLs |
| 7.9 | TestFlight build | 🔲 Pending | First real device test |
| 7.10 | App Store submission | 🔲 Pending | |
| 7.11 | First-launch tutorial | 🔲 Pending | 4-step overlay after onboarding transition — highlights Home buttons, History, Coach. Shown once, stored in AsyncStorage |

---

Expand All @@ -117,10 +122,11 @@ Listed in priority order. Each is small enough to bundle with the next relevant
|---|---|---|
| `src/screens/AuthScreen.tsx` | Apple Sign In gated on `Platform.OS === 'ios'` only | Change to `Platform.OS === 'ios' \|\| Platform.OS === 'macos'` |
| `src/screens/AuthScreen.tsx` | Google env var check throws at render time, crashing the screen if vars are missing | Defer the throw to `handleGoogleSignIn` so the screen renders even without real Google credentials |
| `src/lib/devConfig.ts` | `DEV_BYPASS_AUTH` active | Remove all "DEV ONLY" code paths before any production or TestFlight build |
| `src/lib/devConfig.ts` | `DEV_BYPASS_AUTH` active | ✅ Removed |
| `src/lib/googleSignIn.ts` | Stubbed for Expo Go | Replace with real import of `@react-native-google-signin/google-signin` once a development build is configured |
| `.env.local` | Google client IDs are placeholders | Replace with real OAuth credentials when Google Sign In is configured |
| `BUILD_PLAN.md` (Decisions Log) | Said model is Haiku, but code is Sonnet after Copilot's revert | Code is `claude-sonnet-4-5`. Decisions Log updated below. |
| `OnboardingScreen / ProfileContext` | Brief onboarding flicker during account creation — onAuthStateChange fires before setProfile completes | Add `isCreatingAccount` flag to ProfileContext to suppress routing during account creation |

---

Expand Down Expand Up @@ -179,12 +185,21 @@ Do not build any of the following until explicitly added to the build plan:
| 07 | Business logic hooks | ✅ Merged — Copilot fixed DST-safe dates, `isNetworkError`, AppState listener, UUID fallback |
| 07b | DEV_BYPASS_AUTH | ✅ Merged via Antigravity — `__DEV__ && true` pattern |
| 07c | Google Sign In stub | ✅ Merged via Antigravity — Expo Go compatibility |
| 08 | Onboarding screen | 🔄 In Progress |
| 09 | Home screen + LogModal | 🔄 In Progress |
| 07d | Email/password auth | ✅ Merged |
| 07e | Remove DEV_BYPASS_AUTH | ✅ Merged |
| 07f | AuthScreen design fix + missing theme tokens | ✅ Merged |
| 08 | Onboarding screen | ✅ Merged |
| 09 | Home screen + LogModal | ✅ Merged |
| 10 | History screen | 🔲 Pending — prompt ready in handoff document |
| 11 | Coach screen | 🔲 Pending — prompt ready in handoff document |
| 12 | Profile screen | 🔲 Pending — prompt ready in handoff document |
| 13 | ProfileContext — shared profile state | ✅ Merged |

| 09 | Home screen + LogModal component | ✅ Merged |
| 09b | Undo window + deleteLog | ✅ Merged |
| 09c | Undo expiry error propagation | ✅ Merged |
| 14 | Fix stale session routing bug | ✅ Merged |
| 15 | Onboarding-first flow + sign-in bug fix | ✅ Merged |
---

## Notes for Future Sessions
Expand Down
4 changes: 2 additions & 2 deletions src/components/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { View, ViewStyle, StyleSheet, StyleProp } from 'react-native';
import { Colors, Radius } from '../constants/theme';

interface CardProps {
children: React.ReactNode;
children?: React.ReactNode;
style?: StyleProp<ViewStyle>;
}

export const Card: React.FC<CardProps> = ({ children, style }) => {
export const Card = ({ children, style }: CardProps) => {
return (
<View style={[styles.card, style]}>
{children}
Expand Down
Loading