-
Notifications
You must be signed in to change notification settings - Fork 2
Feature/web only lp #85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Blixor <fiverrthogir@gmail.com>
…point into feature/web-only-lp
…ound, lucide-react-native icons, and react-native-svg, update test-utils to include ThemeProvider
…anding page components with theme tokens, and improve platform-specific styles
…improve accessibility for unauthenticated users on web
📝 WalkthroughSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings. WalkthroughAdds a web marketing landing page with multiple responsive sections and an SVG logo, introduces platform-aware routing (web shows landing; native redirects to /login), updates theme tokens and a color utility, expands Jest test utilities/mocks and tests, and adjusts CI/workflows and test setups. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Index as app/index.tsx
participant Layout as app/_layout.tsx
participant Router
participant Auth
participant Landing as LandingPage
Client->>Index: request root "/"
Index->>Index: check Platform.OS
alt native (ios/android)
Index->>Router: Redirect to /login
Router->>Auth: show login flow
else web
Index->>Layout: render root stack (includes "index")
Layout->>Auth: evaluate auth & profile completeness
alt unauthenticated AND on landing
Layout->>Landing: render LandingPage
else authenticated AND profile complete
Layout->>Router: navigate to /(tabs)
else protected route
Layout->>Router: redirect to /login
end
end
Pre-merge checks and finishing touches❌ Failed checks (2 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (3)**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{ts,tsx,js,jsx,json,css}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
!(lib/logger.ts|lib/sentry.ts|jest.setup.js)📄 CodeRabbit inference engine (CLAUDE.md)
Files:
🧠 Learnings (26)📓 Common learnings📚 Learning: 2025-12-02T00:07:55.331ZApplied to files:
📚 Learning: 2025-12-02T03:55:42.719ZApplied to files:
📚 Learning: 2025-12-02T00:08:12.173ZApplied to files:
📚 Learning: 2025-12-02T00:07:55.331ZApplied to files:
📚 Learning: 2025-12-04T03:11:15.106ZApplied to files:
📚 Learning: 2025-12-02T00:07:55.331ZApplied to files:
📚 Learning: 2025-12-04T03:11:15.106ZApplied to files:
📚 Learning: 2025-12-04T03:11:15.106ZApplied to files:
📚 Learning: 2025-12-04T03:11:15.106ZApplied to files:
📚 Learning: 2025-12-02T00:07:55.331ZApplied to files:
📚 Learning: 2025-12-02T00:08:12.173ZApplied to files:
📚 Learning: 2025-12-04T03:11:15.106ZApplied to files:
📚 Learning: 2025-12-02T03:55:42.719ZApplied to files:
📚 Learning: 2025-12-02T00:07:55.331ZApplied to files:
📚 Learning: 2025-12-04T03:11:15.106ZApplied to files:
📚 Learning: 2025-12-04T03:11:15.106ZApplied to files:
📚 Learning: 2025-12-02T00:07:55.331ZApplied to files:
📚 Learning: 2025-12-02T03:55:42.719ZApplied to files:
📚 Learning: 2025-12-02T00:08:12.173ZApplied to files:
📚 Learning: 2025-12-04T03:11:15.106ZApplied to files:
📚 Learning: 2025-12-04T03:11:15.106ZApplied to files:
📚 Learning: 2025-12-04T03:11:15.106ZApplied to files:
📚 Learning: 2025-12-02T00:07:55.331ZApplied to files:
📚 Learning: 2025-12-04T03:11:15.106ZApplied to files:
📚 Learning: 2025-12-02T00:08:12.173ZApplied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 14
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
contexts/ThemeContext.tsx (1)
97-103: Add JSDoc documentation for the exporteduseThemehook.Per coding guidelines, JSDoc/TSDoc documentation is mandatory for all exported functions and components.
+/** + * Hook to access the current theme context. + * Must be used within a ThemeProvider. + * + * @returns ThemeContextType containing theme colors, mode, setter, and isDark flag + * @throws Error if used outside of ThemeProvider + */ export const useTheme = () => { const context = useContext(ThemeContext);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (4)
assets/images/hero-forest.jpgis excluded by!**/*.jpgassets/images/mockup-dashboard.jpgis excluded by!**/*.jpgassets/images/mockup-milestone.jpgis excluded by!**/*.jpgassets/images/mockup-sponsor.jpgis excluded by!**/*.jpg
📒 Files selected for processing (20)
__tests__/app/index.test.tsx(1 hunks)__tests__/app/tabs-layout.test.tsx(1 hunks)__tests__/components/landing/HeroSection.test.tsx(1 hunks)__tests__/lib/supabase.test.ts(1 hunks)__tests__/test-utils.tsx(1 hunks)app/_layout.tsx(4 hunks)app/index.tsx(1 hunks)components/landing/AppDemoSection.tsx(1 hunks)components/landing/FeaturesSection.tsx(1 hunks)components/landing/Footer.tsx(1 hunks)components/landing/FreeForeverSection.tsx(1 hunks)components/landing/HeroSection.tsx(1 hunks)components/landing/HowItWorksSection.tsx(1 hunks)components/landing/LandingPage.tsx(1 hunks)components/landing/Logo.tsx(1 hunks)components/landing/TestimonialsSection.tsx(1 hunks)contexts/ThemeContext.tsx(2 hunks)jest.config.js(1 hunks)jest.setup.js(5 hunks)utils/colors.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (13)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: All database operations must use typed client fromtypes/database.ts(source of truth)
Use ErrorBoundary component for graceful failure handling
All imports must use@/path alias (configured in tsconfig.json)
File organization order: imports → types → constants → helpers → main logic → exports with required section comments
JSDoc/TSDoc documentation is mandatory for all exported functions and components
Use mount status tracking with useRef to prevent closure issues in async operations
**/*.{ts,tsx}: Runpnpm typecheckto verify TypeScript types before committing
Write tests for any new or modified code, including happy path, edge cases, and error handling
Every exported function, hook, and component MUST have JSDoc/TSDoc comments that work with IntelliSense
Preferinterfacefor defining object shapes in TypeScript
Use strict mode in TypeScript (strict: truein tsconfig); avoidanytype, useunknownwith type guards instead
Use database types fromtypes/database.tsas the source of truth
Use Supabase client with typed database schema (types/database.ts); all data models derive from database types
Use platform-aware storage: SecureStore (native) / localStorage (web)
Session tokens are stored securely (SecureStore on native, localStorage on web)
Tasks flow unidirectionally from sponsor → sponsee within a relationship
Files:
utils/colors.tscomponents/landing/FreeForeverSection.tsx__tests__/lib/supabase.test.tscomponents/landing/FeaturesSection.tsx__tests__/test-utils.tsxcomponents/landing/HowItWorksSection.tsxapp/_layout.tsxcomponents/landing/AppDemoSection.tsxcomponents/landing/Footer.tsxcomponents/landing/Logo.tsx__tests__/components/landing/HeroSection.test.tsxcontexts/ThemeContext.tsxcomponents/landing/HeroSection.tsx__tests__/app/index.test.tsxcomponents/landing/LandingPage.tsx__tests__/app/tabs-layout.test.tsxapp/index.tsxcomponents/landing/TestimonialsSection.tsx
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx,js,jsx}: NEVER use console.log/error/warn directly - use logger fromlib/logger.ts
All logs are automatically sent to Sentry as breadcrumbs with categorized metadata using LogCategory enum
Logger reserved keys (error_message, error_stack, error_name) must be avoided in metadata
Boolean variables must use is/has/should prefix (isLoading, hasSlipUps)
**/*.{ts,tsx,js,jsx}: Runpnpm lintto check for code quality issues using ESLint before committing
Use camelCase for function and variable names
Use PascalCase for component and type/interface names
Use SCREAMING_SNAKE_CASE for constants
Use 'is', 'has', or 'should' prefix for boolean variables (e.g.,isLoading,hasSlipUps)
Use 'handle' prefix for event handlers (e.g.,handlePress,handleSubmit)
Name async functions with verbs describing the action (e.g.,fetchTasks,updateProfile)
Always use@/path alias for all local imports
Remove unused imports before committing
Always pass Error objects tologger.error()for stack traces and include contextual metadata
Validate and sanitize all user inputs
Use universal logger (lib/logger.ts) for centralized, structured logging with categorization viaLogCategoryenum
Five log levels available:logger.error(),logger.warn(),logger.info(),logger.debug(),logger.trace()
Organize files logically with sections: imports, types, constants, helper functions, component, styles
Files:
utils/colors.tscomponents/landing/FreeForeverSection.tsx__tests__/lib/supabase.test.tscomponents/landing/FeaturesSection.tsx__tests__/test-utils.tsxcomponents/landing/HowItWorksSection.tsxjest.config.jsapp/_layout.tsxcomponents/landing/AppDemoSection.tsxcomponents/landing/Footer.tsxcomponents/landing/Logo.tsx__tests__/components/landing/HeroSection.test.tsxcontexts/ThemeContext.tsxcomponents/landing/HeroSection.tsx__tests__/app/index.test.tsxcomponents/landing/LandingPage.tsx__tests__/app/tabs-layout.test.tsxjest.setup.jsapp/index.tsxcomponents/landing/TestimonialsSection.tsx
**/*.{ts,tsx,js,jsx,json,css}
📄 CodeRabbit inference engine (CLAUDE.md)
Run
pnpm formatto ensure consistent code formatting before committing
Files:
utils/colors.tscomponents/landing/FreeForeverSection.tsx__tests__/lib/supabase.test.tscomponents/landing/FeaturesSection.tsx__tests__/test-utils.tsxcomponents/landing/HowItWorksSection.tsxjest.config.jsapp/_layout.tsxcomponents/landing/AppDemoSection.tsxcomponents/landing/Footer.tsxcomponents/landing/Logo.tsx__tests__/components/landing/HeroSection.test.tsxcontexts/ThemeContext.tsxcomponents/landing/HeroSection.tsx__tests__/app/index.test.tsxcomponents/landing/LandingPage.tsx__tests__/app/tabs-layout.test.tsxjest.setup.jsapp/index.tsxcomponents/landing/TestimonialsSection.tsx
!(lib/logger.ts|lib/sentry.ts|jest.setup.js)
📄 CodeRabbit inference engine (CLAUDE.md)
Use ESLint no-console rule; never use console.log/error/warn directly - use the universal logger instead (exceptions: logger.ts, sentry.ts, jest.setup.js)
Files:
utils/colors.tscomponents/landing/FreeForeverSection.tsx__tests__/lib/supabase.test.tscomponents/landing/FeaturesSection.tsx__tests__/test-utils.tsxcomponents/landing/HowItWorksSection.tsxjest.config.jsapp/_layout.tsxcomponents/landing/AppDemoSection.tsxcomponents/landing/Footer.tsxcomponents/landing/Logo.tsx__tests__/components/landing/HeroSection.test.tsxcontexts/ThemeContext.tsxcomponents/landing/HeroSection.tsx__tests__/app/index.test.tsxcomponents/landing/LandingPage.tsx__tests__/app/tabs-layout.test.tsxjest.setup.jsapp/index.tsxcomponents/landing/TestimonialsSection.tsx
**/components/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/components/**/*.{ts,tsx}: Use functional components with hooks (no class components) in React/React Native
Use StyleSheet.create() for component styles instead of inline style objects
Define Props interfaces inline or export if shared; use StyleSheet.create() for component styles
Files:
components/landing/FreeForeverSection.tsxcomponents/landing/FeaturesSection.tsxcomponents/landing/HowItWorksSection.tsxcomponents/landing/AppDemoSection.tsxcomponents/landing/Footer.tsxcomponents/landing/Logo.tsx__tests__/components/landing/HeroSection.test.tsxcomponents/landing/HeroSection.tsxcomponents/landing/LandingPage.tsxcomponents/landing/TestimonialsSection.tsx
**/*supabase*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*supabase*.{ts,tsx}: Supabase client must use custom storage adapter for platform-aware persistence (SecureStore native, localStorage web) with singleton pattern via Proxy lazy initialization
Storage adapter must handle SSR gracefully (no-op during server-side rendering)
Supabase client must auto-refresh tokens and persist sessions across app restarts
Files:
__tests__/lib/supabase.test.ts
**/*.test.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.test.{ts,tsx}: UserenderWithProvidersfrom test-utils to wrap components with AuthContext/ThemeContext in tests
Test mocks must include platform detection (defaults to iOS) and timezone handling
Files:
__tests__/lib/supabase.test.ts__tests__/components/landing/HeroSection.test.tsx__tests__/app/index.test.tsx__tests__/app/tabs-layout.test.tsx
**/__tests__/**/*.test.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/__tests__/**/*.test.{ts,tsx}: Runpnpm testto verify all tests pass and coverage stays above 80% before committing
Place test files in__tests__/directory mirroring the source structure (e.g.,app/(tabs)/profile.tsx→__tests__/app/profile.test.tsx)
Use Jest with React Native Testing Library for testing; mock Supabase client for database operations
All tests must use descriptive test names and be independent; group related tests withdescribe()blocks
Clean up mocks inbeforeEach()orafterEach()blocks in tests
Test behavior, not implementation details
Wrap test components with AuthContext, ThemeContext; mock Supabase client for database operations
Use MSW (Mock Service Worker) for API mocking in tests
Add regression tests for bug fixes that would have caught the bug
Update tests when modifying existing code; add new tests for new behavior
UserenderWithProvidershelper function to wrap test components with required contexts
Mock navigation with expo-router mocks in tests
Files:
__tests__/lib/supabase.test.ts__tests__/components/landing/HeroSection.test.tsx__tests__/app/index.test.tsx__tests__/app/tabs-layout.test.tsx
app/_layout.tsx
📄 CodeRabbit inference engine (AGENTS.md)
Root layout (
app/_layout.tsx) must enforce auth routing: no user →/login, user without profile →/onboarding, complete profile →/(tabs)
app/_layout.tsx: Routing uses Expo Router v6 with typed routes (file-based routing inapp/) and authentication flow enforced in root layout (app/_layout.tsx)
Authentication flow in root layout must route users: unauthenticated → /login, authenticated without profile → /onboarding, fully onboarded → /(tabs)
Wrap app with Sentry SDK in root component for crash reporting and error tracking
Load JetBrains Mono font via expo-font and hide splash screen after fonts load inapp/_layout.tsx
Files:
app/_layout.tsx
{app/_layout.tsx,**/*context*.{ts,tsx}}
📄 CodeRabbit inference engine (AGENTS.md)
Use Context API only (no Redux/Zustand) - contexts must wrap entire app in root layout
Files:
app/_layout.tsx
contexts/ThemeContext.tsx
📄 CodeRabbit inference engine (CLAUDE.md)
ThemeContext must provide:
theme,isDark,setTheme(light/dark/system modes)
Files:
contexts/ThemeContext.tsx
{lib/logger.ts,lib/sentry.ts,jest.setup.js}
📄 CodeRabbit inference engine (AGENTS.md)
Console.log/error/warn are only permitted in logger.ts, sentry.ts, and jest.setup.js
Files:
jest.setup.js
jest.setup.js
📄 CodeRabbit inference engine (AGENTS.md)
jest.setup.js: Supabase client must be mocked with chainable query builder in jest.setup.js
AsyncStorage and SecureStore must be mocked to prevent actual storage during tests
Files:
jest.setup.js
🧠 Learnings (53)
📓 Common learnings
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to app/_layout.tsx : Authentication flow in root layout must route users: unauthenticated → /login, authenticated without profile → /onboarding, fully onboarded → /(tabs)
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to app/_layout.tsx : Root layout (`app/_layout.tsx`) must enforce auth routing: no user → `/login`, user without profile → `/onboarding`, complete profile → `/(tabs)`
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/components/**/*.{ts,tsx} : Define Props interfaces inline or export if shared; use StyleSheet.create() for component styles
Applied to files:
components/landing/FreeForeverSection.tsxcomponents/landing/FeaturesSection.tsxcomponents/landing/HowItWorksSection.tsxapp/_layout.tsxcomponents/landing/AppDemoSection.tsxcomponents/landing/Footer.tsxcomponents/landing/Logo.tsxcomponents/landing/HeroSection.tsxcomponents/landing/LandingPage.tsx__tests__/app/tabs-layout.test.tsxjest.setup.jscomponents/landing/TestimonialsSection.tsx
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to src/components/**/*.{ts,tsx} : Use framer-motion for motion and animation effects in navigation, hero, products, about, mentorship, and blog section components
Applied to files:
components/landing/FreeForeverSection.tsxcomponents/landing/FeaturesSection.tsxcomponents/landing/HowItWorksSection.tsxcomponents/landing/AppDemoSection.tsxcomponents/landing/HeroSection.tsxcomponents/landing/LandingPage.tsx__tests__/app/tabs-layout.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/components/**/*.{ts,tsx} : Use functional components with hooks (no class components) in React/React Native
Applied to files:
components/landing/FreeForeverSection.tsx__tests__/test-utils.tsxcomponents/landing/HowItWorksSection.tsxapp/_layout.tsxcomponents/landing/AppDemoSection.tsxcomponents/landing/Logo.tsxcomponents/landing/HeroSection.tsxcomponents/landing/LandingPage.tsxjest.setup.jsapp/index.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Organize files logically with sections: imports, types, constants, helper functions, component, styles
Applied to files:
components/landing/FreeForeverSection.tsxcomponents/landing/FeaturesSection.tsxcomponents/landing/HowItWorksSection.tsxcomponents/landing/AppDemoSection.tsxcomponents/landing/HeroSection.tsxcomponents/landing/LandingPage.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Use Jest with React Native Testing Library for testing; mock Supabase client for database operations
Applied to files:
__tests__/lib/supabase.test.ts__tests__/test-utils.tsx__tests__/components/landing/HeroSection.test.tsx__tests__/app/index.test.tsx__tests__/app/tabs-layout.test.tsxjest.setup.js
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Wrap test components with AuthContext, ThemeContext; mock Supabase client for database operations
Applied to files:
__tests__/lib/supabase.test.ts__tests__/test-utils.tsxapp/_layout.tsx__tests__/components/landing/HeroSection.test.tsxcontexts/ThemeContext.tsx__tests__/app/index.test.tsx__tests__/app/tabs-layout.test.tsxjest.setup.jscomponents/landing/TestimonialsSection.tsx
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to **/*.test.{ts,tsx} : Test mocks must include platform detection (defaults to iOS) and timezone handling
Applied to files:
__tests__/lib/supabase.test.tsjest.config.js__tests__/components/landing/HeroSection.test.tsx__tests__/app/index.test.tsx__tests__/app/tabs-layout.test.tsxjest.setup.js
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Update tests when modifying existing code; add new tests for new behavior
Applied to files:
__tests__/lib/supabase.test.ts__tests__/test-utils.tsx__tests__/components/landing/HeroSection.test.tsx__tests__/app/index.test.tsx__tests__/app/tabs-layout.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Clean up mocks in `beforeEach()` or `afterEach()` blocks in tests
Applied to files:
__tests__/lib/supabase.test.ts__tests__/components/landing/HeroSection.test.tsxjest.setup.js
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Test behavior, not implementation details
Applied to files:
__tests__/lib/supabase.test.ts__tests__/test-utils.tsx__tests__/components/landing/HeroSection.test.tsx__tests__/app/index.test.tsx__tests__/app/tabs-layout.test.tsx
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to jest.setup.js : AsyncStorage and SecureStore must be mocked to prevent actual storage during tests
Applied to files:
__tests__/lib/supabase.test.ts__tests__/app/index.test.tsxjest.setup.js
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to tests/**/*.{ts,tsx} : Add comprehensive test coverage for components, hooks, utilities, and API routes in tests/ directory
Applied to files:
__tests__/lib/supabase.test.ts__tests__/test-utils.tsx__tests__/components/landing/HeroSection.test.tsx__tests__/app/index.test.tsx__tests__/app/tabs-layout.test.tsxcomponents/landing/TestimonialsSection.tsx
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to jest.setup.ts : Initialize testing-library/jest-dom and mocks in jest.setup.ts for unit test setup
Applied to files:
__tests__/lib/supabase.test.ts__tests__/test-utils.tsxjest.setup.js
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Use MSW (Mock Service Worker) for API mocking in tests
Applied to files:
__tests__/lib/supabase.test.tsjest.config.jsjest.setup.js
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to jest.setup.js : Supabase client must be mocked with chainable query builder in jest.setup.js
Applied to files:
__tests__/lib/supabase.test.ts__tests__/app/index.test.tsxjest.setup.js
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Mock navigation with expo-router mocks in tests
Applied to files:
__tests__/lib/supabase.test.tsjest.config.js__tests__/components/landing/HeroSection.test.tsx__tests__/app/index.test.tsx__tests__/app/tabs-layout.test.tsxjest.setup.js
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to **/*supabase*.{ts,tsx} : Supabase client must use custom storage adapter for platform-aware persistence (SecureStore native, localStorage web) with singleton pattern via Proxy lazy initialization
Applied to files:
__tests__/lib/supabase.test.ts
📚 Learning: 2025-12-02T03:55:42.720Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.720Z
Learning: Applies to **/*storage*.{ts,tsx} : Storage must differ by platform: SecureStore (native) vs localStorage (web)
Applied to files:
__tests__/lib/supabase.test.tsapp/_layout.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx} : Use platform-aware storage: SecureStore (native) / localStorage (web)
Applied to files:
__tests__/lib/supabase.test.tsapp/_layout.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Use `renderWithProviders` helper function to wrap test components with required contexts
Applied to files:
__tests__/lib/supabase.test.ts__tests__/test-utils.tsx__tests__/components/landing/HeroSection.test.tsx__tests__/app/index.test.tsx
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to **/*.test.{ts,tsx} : Use `renderWithProviders` from test-utils to wrap components with AuthContext/ThemeContext in tests
Applied to files:
__tests__/lib/supabase.test.ts__tests__/test-utils.tsxapp/_layout.tsx__tests__/components/landing/HeroSection.test.tsx__tests__/app/index.test.tsxjest.setup.jscomponents/landing/TestimonialsSection.tsx
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to {jest.config.ts,jest.setup.ts,tests/**/*.{ts,tsx}} : Use Jest with Testing Library for unit tests located in tests/ directory with configuration via jest.config.ts and setup via jest.setup.ts
Applied to files:
__tests__/lib/supabase.test.tsjest.setup.js
📚 Learning: 2025-12-02T03:55:42.720Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.720Z
Learning: Applies to **/*theme*context*.{ts,tsx} : ThemeContext must provide: theme, isDark, setTheme (light/dark/system)
Applied to files:
__tests__/test-utils.tsxapp/_layout.tsxcontexts/ThemeContext.tsxcomponents/landing/HeroSection.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to contexts/ThemeContext.tsx : ThemeContext must provide: `theme`, `isDark`, `setTheme` (light/dark/system modes)
Applied to files:
__tests__/test-utils.tsxapp/_layout.tsxcontexts/ThemeContext.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Use Context API for global state (AuthContext, ThemeContext) wrapping the entire app in `app/_layout.tsx`; do not use Redux/Zustand
Applied to files:
__tests__/test-utils.tsxapp/_layout.tsxcontexts/ThemeContext.tsxcomponents/landing/HeroSection.tsxcomponents/landing/LandingPage.tsx
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to **/*.{ts,tsx} : File organization order: imports → types → constants → helpers → main logic → exports with required section comments
Applied to files:
components/landing/HowItWorksSection.tsx
📚 Learning: 2025-12-02T00:08:12.173Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T00:08:12.173Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use path alias `@/*` mapping to `src/*` as configured in tsconfig
Applied to files:
jest.config.js
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Always use `@/` path alias for all local imports
Applied to files:
jest.config.js
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to **/*.{ts,tsx} : All imports must use `@/` path alias (configured in tsconfig.json)
Applied to files:
jest.config.js
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to tsconfig.json : Use @/* path alias mapping to src/* via tsconfig.json paths configuration
Applied to files:
jest.config.js
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Place test files in `__tests__/` directory mirroring the source structure (e.g., `app/(tabs)/profile.tsx` → `__tests__/app/profile.test.tsx`)
Applied to files:
jest.config.js__tests__/app/tabs-layout.test.tsx
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to next.config.ts : Configure Next.js Image component in next.config.ts to allow remote patterns from GitHub (https://github.com)
Applied to files:
jest.config.js
📚 Learning: 2025-12-02T00:08:12.173Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T00:08:12.173Z
Learning: Applies to tests/**/*.{ts,tsx,js} : Use Jest for unit tests located in `tests/` directory
Applied to files:
jest.config.js
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to app/_layout.tsx : Routing uses Expo Router v6 with typed routes (file-based routing in `app/`) and authentication flow enforced in root layout (`app/_layout.tsx`)
Applied to files:
app/_layout.tsxcomponents/landing/HeroSection.tsx__tests__/app/index.test.tsxapp/index.tsx
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to app/_layout.tsx : Root layout (`app/_layout.tsx`) must enforce auth routing: no user → `/login`, user without profile → `/onboarding`, complete profile → `/(tabs)`
Applied to files:
app/_layout.tsx__tests__/app/index.test.tsxapp/index.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to app/_layout.tsx : Authentication flow in root layout must route users: unauthenticated → /login, authenticated without profile → /onboarding, fully onboarded → /(tabs)
Applied to files:
app/_layout.tsx__tests__/app/index.test.tsxapp/index.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to app/_layout.tsx : Wrap app with Sentry SDK in root component for crash reporting and error tracking
Applied to files:
app/_layout.tsxcomponents/landing/LandingPage.tsxapp/index.tsx
📚 Learning: 2025-12-02T03:55:42.720Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.720Z
Learning: Applies to {app/_layout.tsx,**/*context*.{ts,tsx}} : Use Context API only (no Redux/Zustand) - contexts must wrap entire app in root layout
Applied to files:
app/_layout.tsxcomponents/landing/AppDemoSection.tsxcomponents/landing/HeroSection.tsxcomponents/landing/LandingPage.tsxapp/index.tsx
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to **/*oauth*.{ts,tsx} : Google OAuth must use WebBrowser for native, direct redirect for web
Applied to files:
app/_layout.tsx
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to src/components/homepage-client.tsx : Track current section in homepage via scroll position in homepage-client.tsx and update navigation accordingly
Applied to files:
app/_layout.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to app/_layout.tsx : Load JetBrains Mono font via expo-font and hide splash screen after fonts load in `app/_layout.tsx`
Applied to files:
app/_layout.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to contexts/AuthContext.tsx : AuthContext must provide: `user`, `session`, `profile`, `loading`, and auth methods
Applied to files:
app/_layout.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx} : Write tests for any new or modified code, including happy path, edge cases, and error handling
Applied to files:
__tests__/components/landing/HeroSection.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : All tests must use descriptive test names and be independent; group related tests with `describe()` blocks
Applied to files:
__tests__/components/landing/HeroSection.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Add regression tests for bug fixes that would have caught the bug
Applied to files:
__tests__/components/landing/HeroSection.test.tsx__tests__/app/tabs-layout.test.tsx
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to src/components/providers/theme-provider.tsx : Use next-themes for theme management with system/light/dark modes, storing preference in localStorage as volvox-theme
Applied to files:
contexts/ThemeContext.tsx
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to {src/app/globals.css,tailwind.config.ts} : Use Tailwind CSS v4 with CSS-first configuration using theme directive in src/app/globals.css instead of JavaScript config file, with Lightning CSS for builds
Applied to files:
contexts/ThemeContext.tsx
📚 Learning: 2025-12-02T00:08:12.173Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T00:08:12.173Z
Learning: Applies to **/*.{ts,tsx} : Store theme preference in localStorage as `volvox-theme` key
Applied to files:
contexts/ThemeContext.tsx
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to src/app/globals.css : Define brand colors (Primary: Blue, Secondary: Purple, Accent: Orange) as CSS variables with hex codes in globals.css
Applied to files:
contexts/ThemeContext.tsx
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to src/components/**/*.{ts,tsx} : Use radix-ui/colors for color scales in component styling
Applied to files:
contexts/ThemeContext.tsx
📚 Learning: 2025-12-02T00:08:12.173Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T00:08:12.173Z
Learning: Applies to src/components/homepage-client.tsx : Homepage must use client-side scrolling with section tracking in `homepage-client.tsx`
Applied to files:
components/landing/LandingPage.tsx
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to src/app/**/*.{ts,tsx} : Use Server Components by default in src/app directory structure; mark interactive components with 'use client' directive
Applied to files:
app/index.tsx
🧬 Code graph analysis (13)
components/landing/FreeForeverSection.tsx (2)
contexts/ThemeContext.tsx (1)
useTheme(97-103)components/landing/Logo.tsx (1)
Logo(28-48)
components/landing/FeaturesSection.tsx (2)
contexts/ThemeContext.tsx (2)
useTheme(97-103)ThemeColors(8-31)utils/colors.ts (1)
withOpacity(12-25)
__tests__/test-utils.tsx (2)
contexts/AuthContext.tsx (1)
AuthProvider(49-636)contexts/ThemeContext.tsx (1)
ThemeProvider(105-158)
components/landing/HowItWorksSection.tsx (2)
contexts/ThemeContext.tsx (2)
useTheme(97-103)ThemeColors(8-31)utils/colors.ts (1)
withOpacity(12-25)
components/landing/AppDemoSection.tsx (2)
contexts/ThemeContext.tsx (2)
useTheme(97-103)ThemeColors(8-31)jest.setup.js (3)
View(5-5)Text(6-6)Image(15-15)
components/landing/Footer.tsx (2)
contexts/ThemeContext.tsx (2)
useTheme(97-103)ThemeColors(8-31)components/landing/Logo.tsx (1)
Logo(28-48)
components/landing/Logo.tsx (1)
jest.setup.js (4)
View(5-5)Svg(338-339)Circle(342-342)Path(345-345)
__tests__/components/landing/HeroSection.test.tsx (2)
__tests__/test-utils.tsx (1)
renderWithProviders(13-23)components/landing/HeroSection.tsx (1)
HeroSection(33-153)
components/landing/HeroSection.tsx (1)
contexts/ThemeContext.tsx (2)
useTheme(97-103)ThemeColors(8-31)
__tests__/app/index.test.tsx (2)
__tests__/test-utils.tsx (1)
renderWithProviders(13-23)app/index.tsx (1)
Index(21-30)
components/landing/LandingPage.tsx (2)
contexts/ThemeContext.tsx (2)
useTheme(97-103)ThemeColors(8-31)jest.setup.js (2)
View(5-5)ScrollView(10-10)
app/index.tsx (1)
components/landing/LandingPage.tsx (1)
LandingPage(28-71)
components/landing/TestimonialsSection.tsx (2)
contexts/ThemeContext.tsx (2)
useTheme(97-103)ThemeColors(8-31)utils/colors.ts (1)
withOpacity(12-25)
🪛 GitHub Check: Lint, Format, and Type Check
components/landing/LandingPage.tsx
[warning] 30-30:
'width' is assigned a value but never used
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Build for Web
🔇 Additional comments (33)
contexts/ThemeContext.tsx (1)
40-88: Theme color updates look good.The updated light and dark theme palettes improve consistency and contrast. The changes are well-documented with inline comments explaining each token's purpose.
jest.config.js (1)
19-27: LGTM!The moduleNameMapper ordering is correct — specific image patterns are evaluated before the general
@/alias, ensuring image files are properly mocked. The explanatory comments improve maintainability.components/landing/Logo.tsx (1)
28-48: LGTM!Clean SVG-based Logo implementation with proper use of functional components, inline Props interface, and
StyleSheet.create(). The fixed viewBox with scalable size prop is the correct approach for SVG scaling.components/landing/FreeForeverSection.tsx (1)
31-106: Well-structured component with good responsive design.The component follows coding guidelines with proper file organization, JSDoc documentation, functional component pattern, and responsive breakpoints. The platform-specific styling approach is appropriate for the cross-platform requirements.
components/landing/HowItWorksSection.tsx (4)
1-8: LGTM!Imports are well-organized with proper section comments and consistently use the
@/path alias as required by coding guidelines.
10-19: LGTM!Type definitions are clear and follow the required file organization structure.
25-100: LGTM!The component is well-structured with proper JSDoc documentation and follows functional component patterns. The hardcoded content is appropriate for a landing page section.
131-283: LGTM!The styling implementation is comprehensive with proper responsive breakpoints and platform-specific handling for web vs native. Good use of the
withOpacityutility for transparent colors.components/landing/AppDemoSection.tsx (3)
116-153: LGTM!The main styles are well-structured with proper responsive layout handling.
155-229: LGTM!The card styles properly handle platform-specific rendering with appropriate shadows and borders for both web and native platforms.
45-62: Verify that referenced image assets exist before deployment.The code uses
require()to load three image assets (mockup-dashboard.jpg,mockup-sponsor.jpg,mockup-milestone.jpg) with inline comments stating "You'll need to add this image". If these files are missing fromassets/images/, the app will fail to build or crash at runtime. Confirm these files have been added to the repository.components/landing/TestimonialsSection.tsx (2)
1-87: LGTM!The component is well-structured with proper JSDoc documentation, organized sections, and appropriate use of theming and responsive hooks.
160-282: LGTM!The styling implementation properly handles platform differences and responsive breakpoints. Good use of
withOpacityfor transparent colors on web with fallback toprimaryLighton native.components/landing/Footer.tsx (1)
156-292: LGTM!The styling implementation is comprehensive with proper responsive handling and platform-specific properties for web (cursor, transition).
components/landing/HeroSection.tsx (3)
56-153: LGTM!The component properly handles platform-specific rendering for background images and decorative elements. The CTAs are correctly wired to navigation routes.
159-441: LGTM!The styling is comprehensive with proper platform-specific handling. The
as anytype assertion forminHeight: '90vh'is necessary for web viewport units and is an acceptable workaround.
41-54: Verify that the background image asset exists at@/assets/images/hero-forest.jpg.The code handles missing images gracefully with try/catch and test environment stubs, but the actual asset file should be verified to exist to prevent unintended missing images in production.
jest.setup.js (5)
15-17: LGTM!The Image and ImageBackground component mocks are properly integrated into the React Native mock to support the new landing page components.
Also applies to: 80-81
224-242: LGTM!The expo-web-browser, expo-linking, and expo-auth-session mocks provide appropriate mock implementations for OAuth-related functionality.
257-295: LGTM!The lib utility mocks (@/lib/sentry, @/lib/logger, @/lib/date) and image asset mocks are properly configured to support the test environment.
304-367: LGTM!The lucide-react-native and react-native-svg mocks properly export all required icons and SVG components used by the landing page sections. The createIcon pattern with display names is well-implemented.
420-420: LGTM!The Supabase mock extensions (signInWithOAuth, setSession, rpc) appropriately expand the mock surface to support OAuth authentication flows used in the landing page.
Also applies to: 426-426, 429-429
__tests__/lib/supabase.test.ts (1)
15-16: LGTM!Moving Platform and AsyncStorage imports to the top before mock setup follows Jest best practices and ensures proper module resolution order.
app/index.tsx (1)
1-30: LGTM! Platform-specific routing is correctly implemented.The routing logic properly differentiates between web and native platforms:
- Web users see the landing page with CTAs to sign up or sign in
- Native users skip the marketing content and go directly to the login flow
This aligns with the PR objectives and makes sense from a UX perspective. Based on learnings, the authentication routing (unauthenticated → /login, authenticated without profile → /onboarding, complete profile → /(tabs)) is handled in the root layout (
app/_layout.tsx), so this entry point correctly serves as the initial platform-specific fork.__tests__/app/tabs-layout.test.tsx (1)
91-91: LGTM!The type notation change from
Array<{ ... }>to{ ... }[]is a valid stylistic preference. Both are functionally equivalent in TypeScript.__tests__/test-utils.tsx (1)
1-23: Well-structured test utility that aligns with coding guidelines.The
renderWithProvidershelper correctly wraps components withAuthProviderandThemeProvider, following the project's testing conventions. The JSDoc documentation is adequate and the@/path alias is used correctly.As per coding guidelines, this utility should now be used consistently across test files that need context providers.
__tests__/app/index.test.tsx (1)
35-59: Good platform-specific test coverage.The tests correctly verify the platform-specific routing behavior: native platforms redirect to login while web renders the landing page. The
afterEachcleanup properly restoresPlatform.OSto prevent test pollution.components/landing/FeaturesSection.tsx (1)
34-88: Well-structured component following project conventions.The component follows coding guidelines with proper file organization,
@/path aliases, JSDoc documentation,StyleSheet.create()patterns, and functional component with hooks. The responsive design usinguseWindowDimensionsand platform-specific styling viaPlatform.selectis well implemented.components/landing/LandingPage.tsx (1)
28-71: Clean composition of landing page sections.The component follows a straightforward composition pattern, assembling seven section components in a scrollable layout. The JSDoc documentation clearly describes the component's purpose and the
StyleSheet.create()pattern is correctly used.app/_layout.tsx (4)
67-74: Clear variable extraction for routing logic.The extraction of
isWeb,firstSegment,hasSegments, andinLandingimproves readability and makes the platform-specific routing conditions easier to understand.
88-99: Web landing page access correctly guarded.These early returns properly allow unauthenticated web users to view the landing page without being redirected to login. The two cases handled are:
- User navigating directly to the index route on web
- Initial page load at root URL on web
This aligns with the PR objective of web-only landing page functionality.
101-122: Routing logic correctly updated for platform-specific behavior.The updated conditions properly handle:
- Line 102-103: Redirecting unauthenticated users from protected
(tabs)routes- Line 104-107: Redirecting unauthenticated users from other routes (excluding web landing)
- Line 108-117: Redirecting authenticated users with complete profiles away from auth/landing screens
- Lines 118-122: Existing onboarding redirects preserved
The condition on line 104
!(inLanding && isWeb)correctly exempts the web landing page from the login redirect. Based on learnings, this maintains the required auth routing flow while adding the web landing exception.
136-136: Index screen registration enables landing page route.Adding the
Stack.Screenfor "index" is necessary for the landing page to be accessible in the navigation stack.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
♻️ Duplicate comments (6)
components/landing/FreeForeverSection.tsx (2)
47-49: Simplify redundant ternary forLogosize.
size={isMobile ? 48 : 48}always evaluates to48; you can drop the ternary for clarity.- <Logo size={isMobile ? 48 : 48} color={theme.primary} /> + <Logo size={48} color={theme.primary} />
169-191: Make benefit card gradient theme-aware for dark mode.The web-only
backgroundImageuses hardcoded light HSL colors, which will look off in dark theme. Consider deriving the gradient from theme tokens instead.benefit: { flexDirection: 'row', alignItems: 'flex-start', backgroundColor: theme.card, @@ gap: 16, ...Platform.select({ web: { - backgroundImage: 'linear-gradient(145deg, hsl(0 0% 100%) 0%, hsl(210 30% 98%) 100%)', + backgroundImage: `linear-gradient(145deg, ${theme.card} 0%, ${theme.surface} 100%)`, boxShadow: '0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05)', },This keeps the visual effect while respecting the active theme.
components/landing/FeaturesSection.tsx (1)
161-207: Clean up redundant ternaries and theme the web gradients.Two things worth tightening in the card styles:
Redundant ternaries that always return the same value:
padding: isMobile ? 32 : 32fontSize: isMobile ? 20 : 20lineHeight: isMobile ? 28 : 28Hardcoded light HSL gradients for web will clash in dark mode.
Suggested change:
return StyleSheet.create({ card: { backgroundColor: theme.card, borderRadius: 16, - padding: isMobile ? 32 : 32, + padding: 32, @@ borderWidth: 1, borderColor: theme.borderLight, ...Platform.select({ web: { - backgroundImage: 'linear-gradient(145deg, hsl(0 0% 100%) 0%, hsl(210 30% 98%) 100%)', + backgroundImage: `linear-gradient(145deg, ${theme.card} 0%, ${theme.surface} 100%)`, boxShadow: '0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05)', }, @@ iconContainer: { @@ marginBottom: 24, ...Platform.select({ web: { - backgroundImage: - 'linear-gradient(135deg, hsl(217 91% 60% / 0.1) 0%, hsl(217 91% 60% / 0.05) 100%)', + backgroundImage: `linear-gradient(135deg, ${withOpacity( + theme.primary, + 0.1, + )} 0%, ${withOpacity(theme.primary, 0.05)} 100%)`, }, @@ cardTitle: { - fontSize: isMobile ? 20 : 20, + fontSize: 20, @@ - lineHeight: isMobile ? 28 : 28, + lineHeight: 28,This reduces dead code and makes the card visuals respect the active theme.
components/landing/AppDemoSection.tsx (1)
43-62: Prefer stable keys for demos and confirm required assets exist.Two small follow-ups:
Keys for
DemoCard:
Sincedemosis a static list, using a stable identifier (e.g.,demo.title) is more robust than the index.
<View style={styles.demosGrid}>{demos.map((demo, index) => (<DemoCard key={index} demo={demo} theme={theme} width={width} />))}</View>
<View style={styles.demosGrid}>{demos.map((demo) => (<DemoCard key={demo.title} demo={demo} theme={theme} width={width} />))}</View>
- Image
requirecalls:
The comments say “you'll need to add this image” but the code already callsrequire('@/assets/images/mockup-*.jpg'). If those files are not actually present yet, bundling will fail. Either ensure the assets exist in this PR or temporarily swap to a safe placeholder pattern (like the HeroSection try/catch) until real images land.Also applies to: 74-78
components/landing/TestimonialsSection.tsx (1)
72-83: Align list keys, StatItem styles, and card gradient with best practices.A few consistency and theming nits:
Keys for testimonials
The list is static; prefer a stable key (e.g.,testimonial.authorplus a suffix) instead of the index:
<View style={styles.testimonialsGrid}>{testimonials.map((testimonial, index) => (<TestimonialCard key={index} testimonial={testimonial} theme={theme} width={width} />))}</View>
<View style={styles.testimonialsGrid}>{testimonials.map((testimonial) => (<TestimonialCardkey={`${testimonial.author}-${testimonial.daysSober}`}testimonial={testimonial}theme={theme}width={width}/>))}</View>
Move
StatItemstyles into a helper
Creating a newStyleSheeton every render is inconsistent with the rest of the file and a bit wasteful. You can mirror the pattern used for cards:function StatItem({ value, label, theme, width }: StatItemProps) {
- const isMobile = width < 768;
- const styles = StyleSheet.create({
- statItem: {
alignItems: 'center',flex: 1,- },
- statValue: {
fontSize: isMobile ? 40 : 48,fontFamily: theme.fontBold, // font-serif equivalentcolor: theme.primary,marginBottom: 8,lineHeight: isMobile ? 48 : 56,- },
- statLabel: {
fontSize: isMobile ? 14 : 16,fontFamily: theme.fontRegular,color: theme.textSecondary,textAlign: 'center',lineHeight: isMobile ? 20 : 24,- },
- });
- const styles = createStatItemStyles(theme, width);
@@
}+const createStatItemStyles = (theme: ThemeColors, width: number) => {
- const isMobile = width < 768;
- return StyleSheet.create({
- statItem: {
alignItems: 'center',flex: 1,- },
- statValue: {
fontSize: isMobile ? 40 : 48,fontFamily: theme.fontBold,color: theme.primary,marginBottom: 8,lineHeight: isMobile ? 48 : 56,- },
- statLabel: {
fontSize: isMobile ? 14 : 16,fontFamily: theme.fontRegular,color: theme.textSecondary,textAlign: 'center',lineHeight: isMobile ? 20 : 24,- },
- });
+};
Theme the testimonial card web gradient
As in other sections, the hardcoded light HSL card gradient will be jarring in dark mode:card: {@@
minWidth: isMobile ? undefined : 280,
...Platform.select({
web: {
backgroundImage: 'linear-gradient(145deg, hsl(0 0% 100%) 0%, hsl(210 30% 98%) 100%)',
backgroundImage: `linear-gradient(145deg, ${theme.card} 0%, ${theme.surface} 100%)`, boxShadow: '0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05)', },These keep the implementation consistent with other themed sections and avoid light-only styling.
Also applies to: 141-171, 223-299
__tests__/components/landing/HeroSection.test.tsx (1)
25-51: Good static coverage; consider adding CTA navigation interaction tests.These tests verify the key texts and CTAs render correctly. As a follow-up, you could simulate presses on “Get Started Free” and “Sign In” and assert
useRouter().pushis called with/signupand/loginrespectively (usingfireEvent.pressfrom RNTL), since expo-router is already mocked here.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (12)
.github/workflows/ci.yml(1 hunks)__tests__/app/index.test.tsx(1 hunks)__tests__/components/landing/HeroSection.test.tsx(1 hunks)__tests__/utils/colors.test.ts(1 hunks)components/landing/AppDemoSection.tsx(1 hunks)components/landing/FeaturesSection.tsx(1 hunks)components/landing/FreeForeverSection.tsx(1 hunks)components/landing/HowItWorksSection.tsx(1 hunks)components/landing/LandingPage.tsx(1 hunks)components/landing/TestimonialsSection.tsx(1 hunks)jest.config.js(2 hunks)utils/colors.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: All database operations must use typed client fromtypes/database.ts(source of truth)
Use ErrorBoundary component for graceful failure handling
All imports must use@/path alias (configured in tsconfig.json)
File organization order: imports → types → constants → helpers → main logic → exports with required section comments
JSDoc/TSDoc documentation is mandatory for all exported functions and components
Use mount status tracking with useRef to prevent closure issues in async operations
**/*.{ts,tsx}: Runpnpm typecheckto verify TypeScript types before committing
Write tests for any new or modified code, including happy path, edge cases, and error handling
Every exported function, hook, and component MUST have JSDoc/TSDoc comments that work with IntelliSense
Preferinterfacefor defining object shapes in TypeScript
Use strict mode in TypeScript (strict: truein tsconfig); avoidanytype, useunknownwith type guards instead
Use database types fromtypes/database.tsas the source of truth
Use Supabase client with typed database schema (types/database.ts); all data models derive from database types
Use platform-aware storage: SecureStore (native) / localStorage (web)
Session tokens are stored securely (SecureStore on native, localStorage on web)
Tasks flow unidirectionally from sponsor → sponsee within a relationship
Files:
components/landing/LandingPage.tsxcomponents/landing/HowItWorksSection.tsx__tests__/components/landing/HeroSection.test.tsxcomponents/landing/FreeForeverSection.tsxcomponents/landing/FeaturesSection.tsxcomponents/landing/AppDemoSection.tsx__tests__/app/index.test.tsx__tests__/utils/colors.test.tscomponents/landing/TestimonialsSection.tsxutils/colors.ts
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx,js,jsx}: NEVER use console.log/error/warn directly - use logger fromlib/logger.ts
All logs are automatically sent to Sentry as breadcrumbs with categorized metadata using LogCategory enum
Logger reserved keys (error_message, error_stack, error_name) must be avoided in metadata
Boolean variables must use is/has/should prefix (isLoading, hasSlipUps)
**/*.{ts,tsx,js,jsx}: Runpnpm lintto check for code quality issues using ESLint before committing
Use camelCase for function and variable names
Use PascalCase for component and type/interface names
Use SCREAMING_SNAKE_CASE for constants
Use 'is', 'has', or 'should' prefix for boolean variables (e.g.,isLoading,hasSlipUps)
Use 'handle' prefix for event handlers (e.g.,handlePress,handleSubmit)
Name async functions with verbs describing the action (e.g.,fetchTasks,updateProfile)
Always use@/path alias for all local imports
Remove unused imports before committing
Always pass Error objects tologger.error()for stack traces and include contextual metadata
Validate and sanitize all user inputs
Use universal logger (lib/logger.ts) for centralized, structured logging with categorization viaLogCategoryenum
Five log levels available:logger.error(),logger.warn(),logger.info(),logger.debug(),logger.trace()
Organize files logically with sections: imports, types, constants, helper functions, component, styles
Files:
components/landing/LandingPage.tsxcomponents/landing/HowItWorksSection.tsx__tests__/components/landing/HeroSection.test.tsxcomponents/landing/FreeForeverSection.tsxcomponents/landing/FeaturesSection.tsxcomponents/landing/AppDemoSection.tsx__tests__/app/index.test.tsxjest.config.js__tests__/utils/colors.test.tscomponents/landing/TestimonialsSection.tsxutils/colors.ts
**/*.{ts,tsx,js,jsx,json,css}
📄 CodeRabbit inference engine (CLAUDE.md)
Run
pnpm formatto ensure consistent code formatting before committing
Files:
components/landing/LandingPage.tsxcomponents/landing/HowItWorksSection.tsx__tests__/components/landing/HeroSection.test.tsxcomponents/landing/FreeForeverSection.tsxcomponents/landing/FeaturesSection.tsxcomponents/landing/AppDemoSection.tsx__tests__/app/index.test.tsxjest.config.js__tests__/utils/colors.test.tscomponents/landing/TestimonialsSection.tsxutils/colors.ts
!(lib/logger.ts|lib/sentry.ts|jest.setup.js)
📄 CodeRabbit inference engine (CLAUDE.md)
Use ESLint no-console rule; never use console.log/error/warn directly - use the universal logger instead (exceptions: logger.ts, sentry.ts, jest.setup.js)
Files:
components/landing/LandingPage.tsxcomponents/landing/HowItWorksSection.tsx__tests__/components/landing/HeroSection.test.tsxcomponents/landing/FreeForeverSection.tsxcomponents/landing/FeaturesSection.tsxcomponents/landing/AppDemoSection.tsx__tests__/app/index.test.tsxjest.config.js.github/workflows/ci.yml__tests__/utils/colors.test.tscomponents/landing/TestimonialsSection.tsxutils/colors.ts
**/components/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/components/**/*.{ts,tsx}: Use functional components with hooks (no class components) in React/React Native
Use StyleSheet.create() for component styles instead of inline style objects
Define Props interfaces inline or export if shared; use StyleSheet.create() for component styles
Files:
components/landing/LandingPage.tsxcomponents/landing/HowItWorksSection.tsx__tests__/components/landing/HeroSection.test.tsxcomponents/landing/FreeForeverSection.tsxcomponents/landing/FeaturesSection.tsxcomponents/landing/AppDemoSection.tsxcomponents/landing/TestimonialsSection.tsx
**/*.test.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.test.{ts,tsx}: UserenderWithProvidersfrom test-utils to wrap components with AuthContext/ThemeContext in tests
Test mocks must include platform detection (defaults to iOS) and timezone handling
Files:
__tests__/components/landing/HeroSection.test.tsx__tests__/app/index.test.tsx__tests__/utils/colors.test.ts
**/__tests__/**/*.test.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/__tests__/**/*.test.{ts,tsx}: Runpnpm testto verify all tests pass and coverage stays above 80% before committing
Place test files in__tests__/directory mirroring the source structure (e.g.,app/(tabs)/profile.tsx→__tests__/app/profile.test.tsx)
Use Jest with React Native Testing Library for testing; mock Supabase client for database operations
All tests must use descriptive test names and be independent; group related tests withdescribe()blocks
Clean up mocks inbeforeEach()orafterEach()blocks in tests
Test behavior, not implementation details
Wrap test components with AuthContext, ThemeContext; mock Supabase client for database operations
Use MSW (Mock Service Worker) for API mocking in tests
Add regression tests for bug fixes that would have caught the bug
Update tests when modifying existing code; add new tests for new behavior
UserenderWithProvidershelper function to wrap test components with required contexts
Mock navigation with expo-router mocks in tests
Files:
__tests__/components/landing/HeroSection.test.tsx__tests__/app/index.test.tsx__tests__/utils/colors.test.ts
🧠 Learnings (60)
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/components/**/*.{ts,tsx} : Define Props interfaces inline or export if shared; use StyleSheet.create() for component styles
Applied to files:
components/landing/LandingPage.tsxcomponents/landing/HowItWorksSection.tsxcomponents/landing/FreeForeverSection.tsxcomponents/landing/FeaturesSection.tsxcomponents/landing/AppDemoSection.tsxcomponents/landing/TestimonialsSection.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Organize files logically with sections: imports, types, constants, helper functions, component, styles
Applied to files:
components/landing/LandingPage.tsxcomponents/landing/HowItWorksSection.tsx__tests__/components/landing/HeroSection.test.tsxcomponents/landing/FreeForeverSection.tsxcomponents/landing/AppDemoSection.tsxjest.config.js
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to src/components/**/*.{ts,tsx} : Use framer-motion for motion and animation effects in navigation, hero, products, about, mentorship, and blog section components
Applied to files:
components/landing/LandingPage.tsxcomponents/landing/HowItWorksSection.tsxcomponents/landing/FreeForeverSection.tsxcomponents/landing/FeaturesSection.tsxcomponents/landing/AppDemoSection.tsx
📚 Learning: 2025-12-02T00:08:12.173Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T00:08:12.173Z
Learning: Applies to src/components/homepage-client.tsx : Homepage must use client-side scrolling with section tracking in `homepage-client.tsx`
Applied to files:
components/landing/LandingPage.tsx
📚 Learning: 2025-12-02T03:55:42.720Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.720Z
Learning: Applies to {app/_layout.tsx,**/*context*.{ts,tsx}} : Use Context API only (no Redux/Zustand) - contexts must wrap entire app in root layout
Applied to files:
components/landing/LandingPage.tsxcomponents/landing/AppDemoSection.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Use Context API for global state (AuthContext, ThemeContext) wrapping the entire app in `app/_layout.tsx`; do not use Redux/Zustand
Applied to files:
components/landing/LandingPage.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to app/_layout.tsx : Wrap app with Sentry SDK in root component for crash reporting and error tracking
Applied to files:
components/landing/LandingPage.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to app/_layout.tsx : Routing uses Expo Router v6 with typed routes (file-based routing in `app/`) and authentication flow enforced in root layout (`app/_layout.tsx`)
Applied to files:
components/landing/LandingPage.tsx__tests__/app/index.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/components/**/*.{ts,tsx} : Use functional components with hooks (no class components) in React/React Native
Applied to files:
components/landing/HowItWorksSection.tsxcomponents/landing/FreeForeverSection.tsxcomponents/landing/AppDemoSection.tsx
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to **/*.{ts,tsx} : JSDoc/TSDoc documentation is mandatory for all exported functions and components
Applied to files:
components/landing/HowItWorksSection.tsxcomponents/landing/AppDemoSection.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx} : Every exported function, hook, and component MUST have JSDoc/TSDoc comments that work with IntelliSense
Applied to files:
components/landing/HowItWorksSection.tsxcomponents/landing/AppDemoSection.tsx
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to tests/**/*.{ts,tsx} : Add comprehensive test coverage for components, hooks, utilities, and API routes in tests/ directory
Applied to files:
__tests__/components/landing/HeroSection.test.tsx__tests__/app/index.test.tsxjest.config.js__tests__/utils/colors.test.tscomponents/landing/TestimonialsSection.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Mock navigation with expo-router mocks in tests
Applied to files:
__tests__/components/landing/HeroSection.test.tsx__tests__/app/index.test.tsxjest.config.js
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Update tests when modifying existing code; add new tests for new behavior
Applied to files:
__tests__/components/landing/HeroSection.test.tsx__tests__/app/index.test.tsxjest.config.js__tests__/utils/colors.test.ts
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx} : Write tests for any new or modified code, including happy path, edge cases, and error handling
Applied to files:
__tests__/components/landing/HeroSection.test.tsx__tests__/utils/colors.test.ts
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Use `renderWithProviders` helper function to wrap test components with required contexts
Applied to files:
__tests__/components/landing/HeroSection.test.tsx__tests__/app/index.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Test behavior, not implementation details
Applied to files:
__tests__/components/landing/HeroSection.test.tsx__tests__/app/index.test.tsx__tests__/utils/colors.test.ts
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Wrap test components with AuthContext, ThemeContext; mock Supabase client for database operations
Applied to files:
__tests__/components/landing/HeroSection.test.tsx__tests__/app/index.test.tsxcomponents/landing/TestimonialsSection.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Add regression tests for bug fixes that would have caught the bug
Applied to files:
__tests__/components/landing/HeroSection.test.tsx__tests__/app/index.test.tsx__tests__/utils/colors.test.ts
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to **/*.test.{ts,tsx} : Use `renderWithProviders` from test-utils to wrap components with AuthContext/ThemeContext in tests
Applied to files:
__tests__/components/landing/HeroSection.test.tsx__tests__/app/index.test.tsxcomponents/landing/TestimonialsSection.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : All tests must use descriptive test names and be independent; group related tests with `describe()` blocks
Applied to files:
__tests__/components/landing/HeroSection.test.tsx__tests__/app/index.test.tsx__tests__/utils/colors.test.ts
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to **/*.{ts,tsx} : All imports must use `@/` path alias (configured in tsconfig.json)
Applied to files:
__tests__/components/landing/HeroSection.test.tsx__tests__/app/index.test.tsxjest.config.js
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Always use `@/` path alias for all local imports
Applied to files:
__tests__/components/landing/HeroSection.test.tsx__tests__/app/index.test.tsxjest.config.js
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Remove unused imports before committing
Applied to files:
__tests__/components/landing/HeroSection.test.tsx__tests__/app/index.test.tsxjest.config.js
📚 Learning: 2025-12-02T00:08:12.173Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T00:08:12.173Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use path alias `@/*` mapping to `src/*` as configured in tsconfig
Applied to files:
__tests__/components/landing/HeroSection.test.tsx__tests__/app/index.test.tsxjest.config.js
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Run `pnpm test` to verify all tests pass and coverage stays above 80% before committing
Applied to files:
__tests__/components/landing/HeroSection.test.tsx__tests__/app/index.test.tsx.github/workflows/ci.yml__tests__/utils/colors.test.tscomponents/landing/TestimonialsSection.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Use Jest with React Native Testing Library for testing; mock Supabase client for database operations
Applied to files:
__tests__/components/landing/HeroSection.test.tsx__tests__/app/index.test.tsxjest.config.js
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to **/*.test.{ts,tsx} : Test mocks must include platform detection (defaults to iOS) and timezone handling
Applied to files:
__tests__/components/landing/HeroSection.test.tsx__tests__/app/index.test.tsxjest.config.js
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Clean up mocks in `beforeEach()` or `afterEach()` blocks in tests
Applied to files:
__tests__/components/landing/HeroSection.test.tsxjest.config.js
📚 Learning: 2025-12-02T03:55:42.720Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.720Z
Learning: Applies to **/*theme*context*.{ts,tsx} : ThemeContext must provide: theme, isDark, setTheme (light/dark/system)
Applied to files:
components/landing/FreeForeverSection.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to contexts/ThemeContext.tsx : ThemeContext must provide: `theme`, `isDark`, `setTheme` (light/dark/system modes)
Applied to files:
components/landing/FreeForeverSection.tsx
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to src/components/**/*.{ts,tsx} : Use radix-ui/colors for color scales in component styling
Applied to files:
components/landing/FreeForeverSection.tsx__tests__/utils/colors.test.ts
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to src/components/providers/theme-provider.tsx : Use next-themes for theme management with system/light/dark modes, storing preference in localStorage as volvox-theme
Applied to files:
components/landing/FreeForeverSection.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/components/**/*.{ts,tsx} : Use StyleSheet.create() for component styles instead of inline style objects
Applied to files:
components/landing/FeaturesSection.tsxcomponents/landing/AppDemoSection.tsx
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to src/components/mdx-components.tsx : Define custom MDX component overrides (Callout, headings with anchors, code blocks, images with zoom, tables, task lists) in src/components/mdx-components.tsx
Applied to files:
components/landing/AppDemoSection.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to app/_layout.tsx : Authentication flow in root layout must route users: unauthenticated → /login, authenticated without profile → /onboarding, fully onboarded → /(tabs)
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to app/_layout.tsx : Root layout (`app/_layout.tsx`) must enforce auth routing: no user → `/login`, user without profile → `/onboarding`, complete profile → `/(tabs)`
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to jest.setup.js : AsyncStorage and SecureStore must be mocked to prevent actual storage during tests
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to jest.setup.js : Supabase client must be mocked with chainable query builder in jest.setup.js
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-02T00:08:12.173Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T00:08:12.173Z
Learning: Applies to src/app/page.tsx : Homepage must use `Promise.allSettled()` for data fetching to tolerate partial content loading failures
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to {jest.config.ts,jest.setup.ts,tests/**/*.{ts,tsx}} : Use Jest with Testing Library for unit tests located in tests/ directory with configuration via jest.config.ts and setup via jest.setup.ts
Applied to files:
jest.config.js
📚 Learning: 2025-12-02T00:08:12.173Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T00:08:12.173Z
Learning: Applies to tests/**/*.{ts,tsx,js} : Use Jest for unit tests located in `tests/` directory
Applied to files:
jest.config.js
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to jest.setup.ts : Initialize testing-library/jest-dom and mocks in jest.setup.ts for unit test setup
Applied to files:
jest.config.js
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Use MSW (Mock Service Worker) for API mocking in tests
Applied to files:
jest.config.js
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to tsconfig.json : Use @/* path alias mapping to src/* via tsconfig.json paths configuration
Applied to files:
jest.config.js
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Place test files in `__tests__/` directory mirroring the source structure (e.g., `app/(tabs)/profile.tsx` → `__tests__/app/profile.test.tsx`)
Applied to files:
jest.config.js
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to next.config.ts : Configure Next.js Image component in next.config.ts to allow remote patterns from GitHub (https://github.com)
Applied to files:
jest.config.js
📚 Learning: 2025-12-02T00:08:12.173Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T00:08:12.173Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Structure files in order: imports → types → constants → logic → exports
Applied to files:
jest.config.js
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to **/*.{ts,tsx} : File organization order: imports → types → constants → helpers → main logic → exports with required section comments
Applied to files:
jest.config.js
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Validate and sanitize all user inputs
Applied to files:
jest.config.js
📚 Learning: 2025-12-02T00:08:12.173Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T00:08:12.173Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Organize imports in order: framework → third-party → local
Applied to files:
jest.config.js
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx} : Use strict mode in TypeScript (`strict: true` in tsconfig); avoid `any` type, use `unknown` with type guards instead
Applied to files:
jest.config.js
📚 Learning: 2025-12-02T00:08:12.173Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T00:08:12.173Z
Learning: Applies to **/*.{ts,tsx} : Use strict TypeScript mode with explicit types for public APIs
Applied to files:
jest.config.js
📚 Learning: 2025-12-02T00:08:12.173Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T00:08:12.173Z
Learning: After changing any files, run validation workflow: `pnpm format && pnpm typecheck && pnpm lint && pnpm test && pnpm build`. All checks must pass before committing.
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to src/**/*.{ts,tsx} : Run pnpm test to ensure all unit tests pass after any file changes
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-02T03:55:42.720Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.720Z
Learning: Use `pnpm format && pnpm lint && pnpm typecheck && pnpm build:web && pnpm test` validation workflow before committing
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Run complete validation workflow: `pnpm format && pnpm lint && pnpm typecheck && pnpm build:web && pnpm test` before committing
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to src/**/*.{ts,tsx,js,jsx,css} : Run pnpm build to verify production build passes after any file changes
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Run `pnpm lint` to check for code quality issues using ESLint before committing
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx,js,jsx,json,css} : Run `pnpm format` to ensure consistent code formatting before committing
Applied to files:
.github/workflows/ci.yml
🧬 Code graph analysis (8)
components/landing/LandingPage.tsx (2)
contexts/ThemeContext.tsx (2)
useTheme(97-103)ThemeColors(8-31)jest.setup.js (2)
View(5-5)ScrollView(10-10)
components/landing/HowItWorksSection.tsx (2)
contexts/ThemeContext.tsx (2)
useTheme(97-103)ThemeColors(8-31)utils/colors.ts (1)
withOpacity(12-39)
__tests__/components/landing/HeroSection.test.tsx (2)
__tests__/test-utils.tsx (1)
renderWithProviders(13-23)components/landing/HeroSection.tsx (1)
HeroSection(33-153)
components/landing/FreeForeverSection.tsx (3)
contexts/ThemeContext.tsx (2)
useTheme(97-103)ThemeColors(8-31)components/landing/Logo.tsx (1)
Logo(28-48)utils/colors.ts (1)
withOpacity(12-39)
components/landing/FeaturesSection.tsx (2)
contexts/ThemeContext.tsx (2)
useTheme(97-103)ThemeColors(8-31)utils/colors.ts (1)
withOpacity(12-39)
components/landing/AppDemoSection.tsx (1)
contexts/ThemeContext.tsx (2)
useTheme(97-103)ThemeColors(8-31)
__tests__/utils/colors.test.ts (1)
utils/colors.ts (1)
withOpacity(12-39)
components/landing/TestimonialsSection.tsx (2)
contexts/ThemeContext.tsx (2)
useTheme(97-103)ThemeColors(8-31)utils/colors.ts (1)
withOpacity(12-39)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Build for Web
🔇 Additional comments (9)
.github/workflows/ci.yml (1)
50-51: Verify coverage generation: step name and command don't align.Line 51 removes the
--coverageflag frompnpm test:ci, but the step name still indicates "Run tests with coverage". Additionally, downstream steps (Codecov upload and coverage artifact upload on lines 53-65) expect coverage data to exist.Either the
--coverageflag needs to be restored, or if coverage generation has been moved into thetest:ciscript itself, the step name should be updated for clarity. This matters for the project's coverage tracking requirement (>80% per validation workflow).utils/colors.ts (1)
1-39: Past review feedback has been addressed.The implementation now includes short hex expansion (lines 16-23) and validation for invalid parsing results (lines 30-33), which were suggested in the previous review.
__tests__/utils/colors.test.ts (1)
1-107: Excellent test coverage; consider adding test for long hex inputs.The test suite comprehensively covers valid inputs, clamping behavior, and various edge cases. The tests follow best practices with descriptive names and independent assertions.
Consider adding a test case for hex colors with more than 6 characters (e.g.,
"#ABCDEFG") to verify they are handled as invalid inputs:it('should return original color for too long hex input', () => { const invalidColor = '#ABCDEFG'; const result = withOpacity(invalidColor, 0.5); expect(result).toBe(invalidColor); });This would catch the edge case where 7+ character hex strings are currently partially parsed instead of rejected.
Based on learnings: comprehensive test coverage should include all edge cases.
jest.config.js (2)
20-27: Well-structured module mapper configuration.The ordering is correct: specific image mock patterns before the general
@/alias ensures proper resolution precedence. The added comments clearly document the intent.
35-35: Coverage configuration properly expanded.Adding
utils/**/*.{ts,tsx}to coverage collection aligns with the new utils directory and maintains the 80% coverage threshold requirement.Based on coding guidelines: coverage must stay above 80% and be configured for all source directories.
components/landing/FeaturesSection.tsx (1)
25-88: FeaturesSection composition and theming look solid.Typed
Featuremodel, JSDoc on the export, ThemeContext usage, and usingfeature.titleas the key all align well with the guidelines. No functional issues spotted here.components/landing/TestimonialsSection.tsx (1)
24-87: TestimonialsSection structure and documentation look good.Exported component and subcomponents are well-typed, use ThemeContext correctly, and JSDoc coverage is solid. Layout and copy read clearly for the landing page.
components/landing/LandingPage.tsx (1)
19-69: LandingPage composition and theming look correct.The landing page cleanly composes all sections inside a themed
ScrollView, with JSDoc on the export and a small, focusedcreateStyleshelper. The earlier unused-dimension concern appears resolved.components/landing/HowItWorksSection.tsx (1)
25-100: HowItWorksSection is well-factored and theme-aware.Clear JSDoc on the export and
StepCard, typedStep/StepCardProps, responsive layout, and use ofwithOpacity/ThemeColors all look good. I don’t see any behavioral or style issues here.Also applies to: 112-133
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
♻️ Duplicate comments (1)
__tests__/app/index.test.tsx (1)
38-44: Platform.OS mocking approach is now correct.The
Object.definePropertyapproach properly handles the readonlyPlatform.OSproperty, addressing the previous review concern. The cleanup inafterEachcorrectly restores the original platform value.Also applies to: 53-60
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/ci.yml(5 hunks)__tests__/app/index.test.tsx(1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
!(lib/logger.ts|lib/sentry.ts|jest.setup.js)
📄 CodeRabbit inference engine (CLAUDE.md)
Use ESLint no-console rule; never use console.log/error/warn directly - use the universal logger instead (exceptions: logger.ts, sentry.ts, jest.setup.js)
Files:
.github/workflows/ci.yml__tests__/app/index.test.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: All database operations must use typed client fromtypes/database.ts(source of truth)
Use ErrorBoundary component for graceful failure handling
All imports must use@/path alias (configured in tsconfig.json)
File organization order: imports → types → constants → helpers → main logic → exports with required section comments
JSDoc/TSDoc documentation is mandatory for all exported functions and components
Use mount status tracking with useRef to prevent closure issues in async operations
**/*.{ts,tsx}: Runpnpm typecheckto verify TypeScript types before committing
Write tests for any new or modified code, including happy path, edge cases, and error handling
Every exported function, hook, and component MUST have JSDoc/TSDoc comments that work with IntelliSense
Preferinterfacefor defining object shapes in TypeScript
Use strict mode in TypeScript (strict: truein tsconfig); avoidanytype, useunknownwith type guards instead
Use database types fromtypes/database.tsas the source of truth
Use Supabase client with typed database schema (types/database.ts); all data models derive from database types
Use platform-aware storage: SecureStore (native) / localStorage (web)
Session tokens are stored securely (SecureStore on native, localStorage on web)
Tasks flow unidirectionally from sponsor → sponsee within a relationship
Files:
__tests__/app/index.test.tsx
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx,js,jsx}: NEVER use console.log/error/warn directly - use logger fromlib/logger.ts
All logs are automatically sent to Sentry as breadcrumbs with categorized metadata using LogCategory enum
Logger reserved keys (error_message, error_stack, error_name) must be avoided in metadata
Boolean variables must use is/has/should prefix (isLoading, hasSlipUps)
**/*.{ts,tsx,js,jsx}: Runpnpm lintto check for code quality issues using ESLint before committing
Use camelCase for function and variable names
Use PascalCase for component and type/interface names
Use SCREAMING_SNAKE_CASE for constants
Use 'is', 'has', or 'should' prefix for boolean variables (e.g.,isLoading,hasSlipUps)
Use 'handle' prefix for event handlers (e.g.,handlePress,handleSubmit)
Name async functions with verbs describing the action (e.g.,fetchTasks,updateProfile)
Always use@/path alias for all local imports
Remove unused imports before committing
Always pass Error objects tologger.error()for stack traces and include contextual metadata
Validate and sanitize all user inputs
Use universal logger (lib/logger.ts) for centralized, structured logging with categorization viaLogCategoryenum
Five log levels available:logger.error(),logger.warn(),logger.info(),logger.debug(),logger.trace()
Organize files logically with sections: imports, types, constants, helper functions, component, styles
Files:
__tests__/app/index.test.tsx
**/*.test.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.test.{ts,tsx}: UserenderWithProvidersfrom test-utils to wrap components with AuthContext/ThemeContext in tests
Test mocks must include platform detection (defaults to iOS) and timezone handling
Files:
__tests__/app/index.test.tsx
**/*.{ts,tsx,js,jsx,json,css}
📄 CodeRabbit inference engine (CLAUDE.md)
Run
pnpm formatto ensure consistent code formatting before committing
Files:
__tests__/app/index.test.tsx
**/__tests__/**/*.test.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/__tests__/**/*.test.{ts,tsx}: Runpnpm testto verify all tests pass and coverage stays above 80% before committing
Place test files in__tests__/directory mirroring the source structure (e.g.,app/(tabs)/profile.tsx→__tests__/app/profile.test.tsx)
Use Jest with React Native Testing Library for testing; mock Supabase client for database operations
All tests must use descriptive test names and be independent; group related tests withdescribe()blocks
Clean up mocks inbeforeEach()orafterEach()blocks in tests
Test behavior, not implementation details
Wrap test components with AuthContext, ThemeContext; mock Supabase client for database operations
Use MSW (Mock Service Worker) for API mocking in tests
Add regression tests for bug fixes that would have caught the bug
Update tests when modifying existing code; add new tests for new behavior
UserenderWithProvidershelper function to wrap test components with required contexts
Mock navigation with expo-router mocks in tests
Files:
__tests__/app/index.test.tsx
🧠 Learnings (28)
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Run `pnpm test` to verify all tests pass and coverage stays above 80% before committing
Applied to files:
.github/workflows/ci.yml__tests__/app/index.test.tsx
📚 Learning: 2025-12-02T03:55:42.720Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.720Z
Learning: Use `pnpm format && pnpm lint && pnpm typecheck && pnpm build:web && pnpm test` validation workflow before committing
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to src/**/*.{ts,tsx} : Run pnpm test to ensure all unit tests pass after any file changes
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Run complete validation workflow: `pnpm format && pnpm lint && pnpm typecheck && pnpm build:web && pnpm test` before committing
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-02T00:08:12.173Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T00:08:12.173Z
Learning: After changing any files, run validation workflow: `pnpm format && pnpm typecheck && pnpm lint && pnpm test && pnpm build`. All checks must pass before committing.
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Mock navigation with expo-router mocks in tests
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to tests/**/*.{ts,tsx} : Add comprehensive test coverage for components, hooks, utilities, and API routes in tests/ directory
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to **/*.test.{ts,tsx} : Test mocks must include platform detection (defaults to iOS) and timezone handling
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to app/_layout.tsx : Routing uses Expo Router v6 with typed routes (file-based routing in `app/`) and authentication flow enforced in root layout (`app/_layout.tsx`)
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Wrap test components with AuthContext, ThemeContext; mock Supabase client for database operations
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Test behavior, not implementation details
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to **/*.test.{ts,tsx} : Use `renderWithProviders` from test-utils to wrap components with AuthContext/ThemeContext in tests
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Use Jest with React Native Testing Library for testing; mock Supabase client for database operations
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Update tests when modifying existing code; add new tests for new behavior
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Use `renderWithProviders` helper function to wrap test components with required contexts
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to **/*.{ts,tsx} : All imports must use `@/` path alias (configured in tsconfig.json)
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Always use `@/` path alias for all local imports
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-02T00:08:12.173Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T00:08:12.173Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use path alias `@/*` mapping to `src/*` as configured in tsconfig
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Remove unused imports before committing
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-02T03:55:42.720Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.720Z
Learning: Applies to **/*storage*.{ts,tsx} : Storage must differ by platform: SecureStore (native) vs localStorage (web)
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Use MSW (Mock Service Worker) for API mocking in tests
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to jest.setup.js : AsyncStorage and SecureStore must be mocked to prevent actual storage during tests
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx} : Use platform-aware storage: SecureStore (native) / localStorage (web)
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx} : Write tests for any new or modified code, including happy path, edge cases, and error handling
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to app/_layout.tsx : Authentication flow in root layout must route users: unauthenticated → /login, authenticated without profile → /onboarding, fully onboarded → /(tabs)
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to app/_layout.tsx : Root layout (`app/_layout.tsx`) must enforce auth routing: no user → `/login`, user without profile → `/onboarding`, complete profile → `/(tabs)`
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-02T00:08:12.173Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T00:08:12.173Z
Learning: Applies to src/app/page.tsx : Homepage must use `Promise.allSettled()` for data fetching to tolerate partial content loading failures
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : All tests must use descriptive test names and be independent; group related tests with `describe()` blocks
Applied to files:
__tests__/app/index.test.tsx
🧬 Code graph analysis (1)
__tests__/app/index.test.tsx (3)
jest.setup.js (9)
React(3-3)React(163-163)React(306-306)React(335-335)require(164-164)require(298-298)require(307-307)require(336-336)Text(6-6)__tests__/test-utils.tsx (1)
renderWithProviders(13-23)app/index.tsx (1)
Index(21-30)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Build for Web
🔇 Additional comments (5)
.github/workflows/ci.yml (3)
73-73: LGTM! Sensible timeout configuration.The build job timeout (10 min) with a nested step timeout (8 min) follows the same well-structured pattern as the test job. This prevents runaway builds while allowing adequate time for the web build process.
Also applies to: 84-84
96-96: Good defensive addition for artifact uploads.Adding
if-no-files-found: warnprevents silent failures when thedist/directory is empty or missing, while not failing the entire CI run. This improves debuggability.
42-42: Verify coverage is generated after removing the--coverageflag from the test command.The test command at line 52 was changed from
pnpm test:ci --coveragetopnpm test:ci, but line 96 still uploads coverage artifacts. Confirm that coverage is configured injest.config.jswithcollectCoverage: true, otherwise the Codecov step will fail when./coverage/coverage-final.jsonis not found.The tiered timeouts (12 min step < 15 min job) are appropriately structured.
__tests__/app/index.test.tsx (2)
3-4: LGTM! Path alias imports are correct.The imports now properly use the
@/path alias as required by coding guidelines.
62-78: LGTM! Focused, behavior-driven tests.The tests correctly verify:
- Native platforms redirect to
/login- Web platform renders the
LandingPageThis aligns with the
app/index.tsximplementation and follows the coding guideline to "test behavior, not implementation details."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
__tests__/app/index.test.tsx(1 hunks)__tests__/test-utils.tsx(1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: All database operations must use typed client fromtypes/database.ts(source of truth)
Use ErrorBoundary component for graceful failure handling
All imports must use@/path alias (configured in tsconfig.json)
File organization order: imports → types → constants → helpers → main logic → exports with required section comments
JSDoc/TSDoc documentation is mandatory for all exported functions and components
Use mount status tracking with useRef to prevent closure issues in async operations
**/*.{ts,tsx}: Runpnpm typecheckto verify TypeScript types before committing
Write tests for any new or modified code, including happy path, edge cases, and error handling
Every exported function, hook, and component MUST have JSDoc/TSDoc comments that work with IntelliSense
Preferinterfacefor defining object shapes in TypeScript
Use strict mode in TypeScript (strict: truein tsconfig); avoidanytype, useunknownwith type guards instead
Use database types fromtypes/database.tsas the source of truth
Use Supabase client with typed database schema (types/database.ts); all data models derive from database types
Use platform-aware storage: SecureStore (native) / localStorage (web)
Session tokens are stored securely (SecureStore on native, localStorage on web)
Tasks flow unidirectionally from sponsor → sponsee within a relationship
Files:
__tests__/app/index.test.tsx__tests__/test-utils.tsx
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx,js,jsx}: NEVER use console.log/error/warn directly - use logger fromlib/logger.ts
All logs are automatically sent to Sentry as breadcrumbs with categorized metadata using LogCategory enum
Logger reserved keys (error_message, error_stack, error_name) must be avoided in metadata
Boolean variables must use is/has/should prefix (isLoading, hasSlipUps)
**/*.{ts,tsx,js,jsx}: Runpnpm lintto check for code quality issues using ESLint before committing
Use camelCase for function and variable names
Use PascalCase for component and type/interface names
Use SCREAMING_SNAKE_CASE for constants
Use 'is', 'has', or 'should' prefix for boolean variables (e.g.,isLoading,hasSlipUps)
Use 'handle' prefix for event handlers (e.g.,handlePress,handleSubmit)
Name async functions with verbs describing the action (e.g.,fetchTasks,updateProfile)
Always use@/path alias for all local imports
Remove unused imports before committing
Always pass Error objects tologger.error()for stack traces and include contextual metadata
Validate and sanitize all user inputs
Use universal logger (lib/logger.ts) for centralized, structured logging with categorization viaLogCategoryenum
Five log levels available:logger.error(),logger.warn(),logger.info(),logger.debug(),logger.trace()
Organize files logically with sections: imports, types, constants, helper functions, component, styles
Files:
__tests__/app/index.test.tsx__tests__/test-utils.tsx
**/*.test.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.test.{ts,tsx}: UserenderWithProvidersfrom test-utils to wrap components with AuthContext/ThemeContext in tests
Test mocks must include platform detection (defaults to iOS) and timezone handling
Files:
__tests__/app/index.test.tsx
**/*.{ts,tsx,js,jsx,json,css}
📄 CodeRabbit inference engine (CLAUDE.md)
Run
pnpm formatto ensure consistent code formatting before committing
Files:
__tests__/app/index.test.tsx__tests__/test-utils.tsx
**/__tests__/**/*.test.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/__tests__/**/*.test.{ts,tsx}: Runpnpm testto verify all tests pass and coverage stays above 80% before committing
Place test files in__tests__/directory mirroring the source structure (e.g.,app/(tabs)/profile.tsx→__tests__/app/profile.test.tsx)
Use Jest with React Native Testing Library for testing; mock Supabase client for database operations
All tests must use descriptive test names and be independent; group related tests withdescribe()blocks
Clean up mocks inbeforeEach()orafterEach()blocks in tests
Test behavior, not implementation details
Wrap test components with AuthContext, ThemeContext; mock Supabase client for database operations
Use MSW (Mock Service Worker) for API mocking in tests
Add regression tests for bug fixes that would have caught the bug
Update tests when modifying existing code; add new tests for new behavior
UserenderWithProvidershelper function to wrap test components with required contexts
Mock navigation with expo-router mocks in tests
Files:
__tests__/app/index.test.tsx
!(lib/logger.ts|lib/sentry.ts|jest.setup.js)
📄 CodeRabbit inference engine (CLAUDE.md)
Use ESLint no-console rule; never use console.log/error/warn directly - use the universal logger instead (exceptions: logger.ts, sentry.ts, jest.setup.js)
Files:
__tests__/app/index.test.tsx__tests__/test-utils.tsx
🧠 Learnings (28)
📓 Common learnings
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to tests/**/*.{ts,tsx} : Add comprehensive test coverage for components, hooks, utilities, and API routes in tests/ directory
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to **/*.test.{ts,tsx} : Test mocks must include platform detection (defaults to iOS) and timezone handling
Applied to files:
__tests__/app/index.test.tsx__tests__/test-utils.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Mock navigation with expo-router mocks in tests
Applied to files:
__tests__/app/index.test.tsx__tests__/test-utils.tsx
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to tests/**/*.{ts,tsx} : Add comprehensive test coverage for components, hooks, utilities, and API routes in tests/ directory
Applied to files:
__tests__/app/index.test.tsx__tests__/test-utils.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Test behavior, not implementation details
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to app/_layout.tsx : Routing uses Expo Router v6 with typed routes (file-based routing in `app/`) and authentication flow enforced in root layout (`app/_layout.tsx`)
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Wrap test components with AuthContext, ThemeContext; mock Supabase client for database operations
Applied to files:
__tests__/app/index.test.tsx__tests__/test-utils.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Update tests when modifying existing code; add new tests for new behavior
Applied to files:
__tests__/app/index.test.tsx__tests__/test-utils.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : All tests must use descriptive test names and be independent; group related tests with `describe()` blocks
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Use Jest with React Native Testing Library for testing; mock Supabase client for database operations
Applied to files:
__tests__/app/index.test.tsx__tests__/test-utils.tsx
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to **/*.test.{ts,tsx} : Use `renderWithProviders` from test-utils to wrap components with AuthContext/ThemeContext in tests
Applied to files:
__tests__/app/index.test.tsx__tests__/test-utils.tsx
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to **/*.{ts,tsx} : All imports must use `@/` path alias (configured in tsconfig.json)
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Always use `@/` path alias for all local imports
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Use `renderWithProviders` helper function to wrap test components with required contexts
Applied to files:
__tests__/app/index.test.tsx__tests__/test-utils.tsx
📚 Learning: 2025-12-02T00:08:12.173Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T00:08:12.173Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use path alias `@/*` mapping to `src/*` as configured in tsconfig
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Remove unused imports before committing
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Run `pnpm test` to verify all tests pass and coverage stays above 80% before committing
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-02T03:55:42.720Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.720Z
Learning: Applies to **/*storage*.{ts,tsx} : Storage must differ by platform: SecureStore (native) vs localStorage (web)
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Use MSW (Mock Service Worker) for API mocking in tests
Applied to files:
__tests__/app/index.test.tsx__tests__/test-utils.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Add regression tests for bug fixes that would have caught the bug
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx} : Write tests for any new or modified code, including happy path, edge cases, and error handling
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to jest.setup.js : AsyncStorage and SecureStore must be mocked to prevent actual storage during tests
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx} : Use platform-aware storage: SecureStore (native) / localStorage (web)
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Clean up mocks in `beforeEach()` or `afterEach()` blocks in tests
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to **/*oauth*.{ts,tsx} : Google OAuth must use WebBrowser for native, direct redirect for web
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-02T00:08:12.173Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T00:08:12.173Z
Learning: Applies to src/app/page.tsx : Homepage must use `Promise.allSettled()` for data fetching to tolerate partial content loading failures
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to jest.setup.ts : Initialize testing-library/jest-dom and mocks in jest.setup.ts for unit test setup
Applied to files:
__tests__/test-utils.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/components/**/*.{ts,tsx} : Use functional components with hooks (no class components) in React/React Native
Applied to files:
__tests__/test-utils.tsx
🧬 Code graph analysis (1)
__tests__/app/index.test.tsx (2)
__tests__/test-utils.tsx (3)
restorePlatformOS(46-52)setPlatformOS(34-40)renderWithProviders(14-24)app/index.tsx (1)
Index(21-30)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Build for Web
🔇 Additional comments (5)
__tests__/app/index.test.tsx (2)
1-28: LGTM! Clean imports and appropriate mocks.The imports correctly use the
@/path alias, and the mocks are minimal and focused on testing the platform-specific behavior. The expo-router mock properly simulates Redirect and useRouter, while the LandingPage mock provides a simple, testable component.
34-42: Excellent test setup and cleanup.The beforeEach/afterEach hooks properly ensure test isolation by clearing mocks and restoring the platform state. This follows the coding guidelines for cleanup and prevents cross-test contamination.
__tests__/test-utils.tsx (3)
1-24: Well-implemented renderWithProviders utility.The function properly wraps components with AuthProvider and ThemeProvider as required by coding guidelines. The JSDoc documentation is complete and follows TSDoc conventions, and the TypeScript typing is precise.
26-40: Robust platform mocking implementation.The
setPlatformOShelper correctly usesObject.definePropertyto modify the readonlyPlatform.OSproperty, avoiding TypeScript type errors. The capturedoriginalPlatformvalue at module load enables proper restoration, and the type constraint ensures only valid platform values are used.
42-52: Clean platform restoration helper.The
restorePlatformOSfunction properly restoresPlatform.OSto its original value using the module-leveloriginalPlatformconstant. This ensures consistent test isolation when used inafterEachhooks, as demonstrated in the test file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (4)
__tests__/lib/date.test.ts (1)
11-21: Critical:jest.unmock()must be called before imports.The
jest.unmock('@/lib/date')call on line 21 occurs after the module is already imported (lines 12-19). In Jest, unmocking must happen before the import statement to affect module resolution. The current order means the module is likely already loaded (potentially as a mock), so the unmock call has no effect and tests may not exercise the real implementation.Apply this diff to fix the ordering:
+jest.unmock('@/lib/date'); + // Unmock the date module to test the actual implementation import { parseDateAsLocal, formatLocalDate, formatDateWithTimezone, getDateDiffInDays, getUserTimezone, DEVICE_TIMEZONE, } from '@/lib/date'; -jest.unmock('@/lib/date'); -__tests__/contexts/ThemeContext.test.tsx (1)
45-47: Consider using renderWithProviders for consistency.The custom wrapper works correctly for this test, but the PR introduces a
renderWithProvidershelper in test-utils. Using it would improve consistency across the test suite and make future updates easier if the provider setup becomes more complex.Based on learnings, tests should use
renderWithProvidersfrom test-utils to wrap components with required contexts.__tests__/lib/sentry.test.ts (2)
111-122: Inconsistent mock reference pattern between positive and negative tests.This test uses the top-level
mockInitreference (line 121) while positive tests re-require the module and usesentryModule.init. Although both work due to reference persistence, maintaining consistency aids readability and prevents confusion.Consider applying the same re-require pattern for consistency:
it('skips initialization when DSN is not configured', () => { - mockInit.mockClear(); - // Set env var BEFORE resetModules so it's available when module loads process.env.EXPO_PUBLIC_SENTRY_DSN = ''; jest.resetModules(); + // eslint-disable-next-line @typescript-eslint/no-require-imports + const sentryModule = require('@sentry/react-native'); + sentryModule.init.mockClear(); // eslint-disable-next-line @typescript-eslint/no-require-imports const { initializeSentry } = require('@/lib/sentry'); initializeSentry(); - expect(mockInit).not.toHaveBeenCalled(); + expect(sentryModule.init).not.toHaveBeenCalled(); });
84-109: Consider extracting a helper to reduce repetitive reset-require-clear boilerplate.The same pattern repeats across most tests: set env →
resetModules()→ re-require mock → clear → re-require sentry module. Extracting this would improve maintainability and reduce the scatteredeslint-disablecomments.// Helper at the top of the test file function setupSentryTest(dsn: string) { process.env.EXPO_PUBLIC_SENTRY_DSN = dsn; jest.resetModules(); // eslint-disable-next-line @typescript-eslint/no-require-imports const sentryMocks = require('@sentry/react-native'); Object.values(sentryMocks).forEach((mock) => { if (typeof mock === 'function' && 'mockClear' in mock) { (mock as jest.Mock).mockClear(); } }); // eslint-disable-next-line @typescript-eslint/no-require-imports const sentry = require('@/lib/sentry'); return { sentryMocks, sentry }; } // Usage in tests: it('initializes Sentry when DSN is configured', () => { const { sentryMocks, sentry } = setupSentryTest('https://test@sentry.io/123'); sentry.initializeSentry(); expect(sentryMocks.init).toHaveBeenCalledTimes(1); // ... });Also applies to: 188-205
♻️ Duplicate comments (1)
.github/workflows/ci.yml (1)
52-52: Restore the--coverageflag as requested in past review.The
--coverageflag was removed from the test command, but a past reviewer (BillChirico) explicitly requested: "We should still run with coverage". Additionally, the coding guidelines require maintaining 80% test coverage, which needs the coverage flag to verify.Apply this diff to restore coverage generation:
- run: pnpm test:ci + run: pnpm test:ci --coverageThe
if-no-files-found: ignoresetting on Line 73 will hide the absence of coverage files, making this regression silent.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (7)
.github/workflows/ci.yml(3 hunks).github/workflows/claude-code-review.yml(1 hunks)__tests__/app/index.test.tsx(1 hunks)__tests__/contexts/ThemeContext.test.tsx(1 hunks)__tests__/lib/date.test.ts(2 hunks)__tests__/lib/sentry.test.ts(12 hunks)__tests__/lib/supabase.test.ts(4 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
**/*supabase*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*supabase*.{ts,tsx}: Supabase client must use custom storage adapter for platform-aware persistence (SecureStore native, localStorage web) with singleton pattern via Proxy lazy initialization
Storage adapter must handle SSR gracefully (no-op during server-side rendering)
Supabase client must auto-refresh tokens and persist sessions across app restarts
Files:
__tests__/lib/supabase.test.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: All database operations must use typed client fromtypes/database.ts(source of truth)
Use ErrorBoundary component for graceful failure handling
All imports must use@/path alias (configured in tsconfig.json)
File organization order: imports → types → constants → helpers → main logic → exports with required section comments
JSDoc/TSDoc documentation is mandatory for all exported functions and components
Use mount status tracking with useRef to prevent closure issues in async operations
**/*.{ts,tsx}: Runpnpm typecheckto verify TypeScript types before committing
Write tests for any new or modified code, including happy path, edge cases, and error handling
Every exported function, hook, and component MUST have JSDoc/TSDoc comments that work with IntelliSense
Preferinterfacefor defining object shapes in TypeScript
Use strict mode in TypeScript (strict: truein tsconfig); avoidanytype, useunknownwith type guards instead
Use database types fromtypes/database.tsas the source of truth
Use Supabase client with typed database schema (types/database.ts); all data models derive from database types
Use platform-aware storage: SecureStore (native) / localStorage (web)
Session tokens are stored securely (SecureStore on native, localStorage on web)
Tasks flow unidirectionally from sponsor → sponsee within a relationship
Files:
__tests__/lib/supabase.test.ts__tests__/app/index.test.tsx__tests__/contexts/ThemeContext.test.tsx__tests__/lib/date.test.ts__tests__/lib/sentry.test.ts
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx,js,jsx}: NEVER use console.log/error/warn directly - use logger fromlib/logger.ts
All logs are automatically sent to Sentry as breadcrumbs with categorized metadata using LogCategory enum
Logger reserved keys (error_message, error_stack, error_name) must be avoided in metadata
Boolean variables must use is/has/should prefix (isLoading, hasSlipUps)
**/*.{ts,tsx,js,jsx}: Runpnpm lintto check for code quality issues using ESLint before committing
Use camelCase for function and variable names
Use PascalCase for component and type/interface names
Use SCREAMING_SNAKE_CASE for constants
Use 'is', 'has', or 'should' prefix for boolean variables (e.g.,isLoading,hasSlipUps)
Use 'handle' prefix for event handlers (e.g.,handlePress,handleSubmit)
Name async functions with verbs describing the action (e.g.,fetchTasks,updateProfile)
Always use@/path alias for all local imports
Remove unused imports before committing
Always pass Error objects tologger.error()for stack traces and include contextual metadata
Validate and sanitize all user inputs
Use universal logger (lib/logger.ts) for centralized, structured logging with categorization viaLogCategoryenum
Five log levels available:logger.error(),logger.warn(),logger.info(),logger.debug(),logger.trace()
Organize files logically with sections: imports, types, constants, helper functions, component, styles
Files:
__tests__/lib/supabase.test.ts__tests__/app/index.test.tsx__tests__/contexts/ThemeContext.test.tsx__tests__/lib/date.test.ts__tests__/lib/sentry.test.ts
**/*.test.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.test.{ts,tsx}: UserenderWithProvidersfrom test-utils to wrap components with AuthContext/ThemeContext in tests
Test mocks must include platform detection (defaults to iOS) and timezone handling
Files:
__tests__/lib/supabase.test.ts__tests__/app/index.test.tsx__tests__/contexts/ThemeContext.test.tsx__tests__/lib/date.test.ts__tests__/lib/sentry.test.ts
**/*.{ts,tsx,js,jsx,json,css}
📄 CodeRabbit inference engine (CLAUDE.md)
Run
pnpm formatto ensure consistent code formatting before committing
Files:
__tests__/lib/supabase.test.ts__tests__/app/index.test.tsx__tests__/contexts/ThemeContext.test.tsx__tests__/lib/date.test.ts__tests__/lib/sentry.test.ts
**/__tests__/**/*.test.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/__tests__/**/*.test.{ts,tsx}: Runpnpm testto verify all tests pass and coverage stays above 80% before committing
Place test files in__tests__/directory mirroring the source structure (e.g.,app/(tabs)/profile.tsx→__tests__/app/profile.test.tsx)
Use Jest with React Native Testing Library for testing; mock Supabase client for database operations
All tests must use descriptive test names and be independent; group related tests withdescribe()blocks
Clean up mocks inbeforeEach()orafterEach()blocks in tests
Test behavior, not implementation details
Wrap test components with AuthContext, ThemeContext; mock Supabase client for database operations
Use MSW (Mock Service Worker) for API mocking in tests
Add regression tests for bug fixes that would have caught the bug
Update tests when modifying existing code; add new tests for new behavior
UserenderWithProvidershelper function to wrap test components with required contexts
Mock navigation with expo-router mocks in tests
Files:
__tests__/lib/supabase.test.ts__tests__/app/index.test.tsx__tests__/contexts/ThemeContext.test.tsx__tests__/lib/date.test.ts__tests__/lib/sentry.test.ts
!(lib/logger.ts|lib/sentry.ts|jest.setup.js)
📄 CodeRabbit inference engine (CLAUDE.md)
Use ESLint no-console rule; never use console.log/error/warn directly - use the universal logger instead (exceptions: logger.ts, sentry.ts, jest.setup.js)
Files:
__tests__/lib/supabase.test.ts__tests__/app/index.test.tsx__tests__/contexts/ThemeContext.test.tsx.github/workflows/ci.yml.github/workflows/claude-code-review.yml__tests__/lib/date.test.ts__tests__/lib/sentry.test.ts
🧠 Learnings (42)
📓 Common learnings
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to tests/**/*.{ts,tsx} : Add comprehensive test coverage for components, hooks, utilities, and API routes in tests/ directory
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Use Jest with React Native Testing Library for testing; mock Supabase client for database operations
Applied to files:
__tests__/lib/supabase.test.ts__tests__/app/index.test.tsx__tests__/lib/date.test.ts__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Wrap test components with AuthContext, ThemeContext; mock Supabase client for database operations
Applied to files:
__tests__/lib/supabase.test.ts__tests__/app/index.test.tsx__tests__/contexts/ThemeContext.test.tsx__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to jest.setup.js : Supabase client must be mocked with chainable query builder in jest.setup.js
Applied to files:
__tests__/lib/supabase.test.ts__tests__/app/index.test.tsx__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to **/*.test.{ts,tsx} : Test mocks must include platform detection (defaults to iOS) and timezone handling
Applied to files:
__tests__/lib/supabase.test.ts__tests__/app/index.test.tsx__tests__/lib/date.test.ts__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to **/*supabase*.{ts,tsx} : Supabase client must use custom storage adapter for platform-aware persistence (SecureStore native, localStorage web) with singleton pattern via Proxy lazy initialization
Applied to files:
__tests__/lib/supabase.test.ts
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Use MSW (Mock Service Worker) for API mocking in tests
Applied to files:
__tests__/lib/supabase.test.ts__tests__/app/index.test.tsx__tests__/lib/date.test.ts__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to jest.setup.ts : Initialize testing-library/jest-dom and mocks in jest.setup.ts for unit test setup
Applied to files:
__tests__/lib/supabase.test.ts__tests__/lib/date.test.ts__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Clean up mocks in `beforeEach()` or `afterEach()` blocks in tests
Applied to files:
__tests__/lib/supabase.test.ts__tests__/app/index.test.tsx__tests__/lib/date.test.ts__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Update tests when modifying existing code; add new tests for new behavior
Applied to files:
__tests__/lib/supabase.test.ts__tests__/app/index.test.tsx__tests__/contexts/ThemeContext.test.tsx__tests__/lib/date.test.ts__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to jest.setup.js : AsyncStorage and SecureStore must be mocked to prevent actual storage during tests
Applied to files:
__tests__/lib/supabase.test.ts__tests__/app/index.test.tsx__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Mock navigation with expo-router mocks in tests
Applied to files:
__tests__/lib/supabase.test.ts__tests__/app/index.test.tsx__tests__/lib/date.test.ts__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-02T03:55:42.720Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.720Z
Learning: Applies to **/*storage*.{ts,tsx} : Storage must differ by platform: SecureStore (native) vs localStorage (web)
Applied to files:
__tests__/lib/supabase.test.ts__tests__/app/index.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx} : Use platform-aware storage: SecureStore (native) / localStorage (web)
Applied to files:
__tests__/lib/supabase.test.ts__tests__/app/index.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Use `renderWithProviders` helper function to wrap test components with required contexts
Applied to files:
__tests__/lib/supabase.test.ts__tests__/app/index.test.tsx__tests__/contexts/ThemeContext.test.tsx__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to **/*.test.{ts,tsx} : Use `renderWithProviders` from test-utils to wrap components with AuthContext/ThemeContext in tests
Applied to files:
__tests__/lib/supabase.test.ts__tests__/app/index.test.tsx__tests__/contexts/ThemeContext.test.tsx__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to {jest.config.ts,jest.setup.ts,tests/**/*.{ts,tsx}} : Use Jest with Testing Library for unit tests located in tests/ directory with configuration via jest.config.ts and setup via jest.setup.ts
Applied to files:
__tests__/lib/supabase.test.ts__tests__/lib/date.test.ts__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to **/*supabase*.{ts,tsx} : Supabase client must auto-refresh tokens and persist sessions across app restarts
Applied to files:
__tests__/lib/supabase.test.ts
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to tests/**/*.{ts,tsx} : Add comprehensive test coverage for components, hooks, utilities, and API routes in tests/ directory
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Test behavior, not implementation details
Applied to files:
__tests__/app/index.test.tsx__tests__/contexts/ThemeContext.test.tsx__tests__/lib/date.test.ts__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : All tests must use descriptive test names and be independent; group related tests with `describe()` blocks
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to **/*.{ts,tsx} : All imports must use `@/` path alias (configured in tsconfig.json)
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Always use `@/` path alias for all local imports
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-02T00:08:12.173Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T00:08:12.173Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use path alias `@/*` mapping to `src/*` as configured in tsconfig
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Remove unused imports before committing
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Run `pnpm test` to verify all tests pass and coverage stays above 80% before committing
Applied to files:
__tests__/app/index.test.tsx.github/workflows/ci.yml
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Add regression tests for bug fixes that would have caught the bug
Applied to files:
__tests__/app/index.test.tsx__tests__/contexts/ThemeContext.test.tsx__tests__/lib/date.test.ts
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx} : Write tests for any new or modified code, including happy path, edge cases, and error handling
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to **/*oauth*.{ts,tsx} : Google OAuth must use WebBrowser for native, direct redirect for web
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to app/_layout.tsx : Authentication flow in root layout must route users: unauthenticated → /login, authenticated without profile → /onboarding, fully onboarded → /(tabs)
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-02T00:08:12.173Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T00:08:12.173Z
Learning: Applies to src/app/page.tsx : Homepage must use `Promise.allSettled()` for data fetching to tolerate partial content loading failures
Applied to files:
__tests__/app/index.test.tsx
📚 Learning: 2025-12-02T03:55:42.720Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.720Z
Learning: Applies to **/*theme*context*.{ts,tsx} : ThemeContext must provide: theme, isDark, setTheme (light/dark/system)
Applied to files:
__tests__/contexts/ThemeContext.test.tsx
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to contexts/ThemeContext.tsx : ThemeContext must provide: `theme`, `isDark`, `setTheme` (light/dark/system modes)
Applied to files:
__tests__/contexts/ThemeContext.test.tsx
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to src/components/providers/theme-provider.tsx : Use next-themes for theme management with system/light/dark modes, storing preference in localStorage as volvox-theme
Applied to files:
__tests__/contexts/ThemeContext.test.tsx
📚 Learning: 2025-12-02T03:55:42.720Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.720Z
Learning: Use `pnpm format && pnpm lint && pnpm typecheck && pnpm build:web && pnpm test` validation workflow before committing
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Run complete validation workflow: `pnpm format && pnpm lint && pnpm typecheck && pnpm build:web && pnpm test` before committing
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to src/**/*.{ts,tsx} : Use date-fns for date manipulation and formatting in TypeScript files
Applied to files:
__tests__/lib/date.test.ts
📚 Learning: 2025-12-02T00:08:12.173Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T00:08:12.173Z
Learning: Applies to tests/**/*.{ts,tsx,js} : Use Jest for unit tests located in `tests/` directory
Applied to files:
__tests__/lib/date.test.ts
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Set NEXT_PUBLIC_SENTRY_DSN environment variable to configure Sentry DSN; if not set, Sentry is disabled
Applied to files:
__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to app/_layout.tsx : Wrap app with Sentry SDK in root component for crash reporting and error tracking
Applied to files:
__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to src/**/*.{ts,tsx} : Use reportError(context, error) from src/lib/logger.ts to report errors to Sentry with context metadata, falling back to console.error
Applied to files:
__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-02T00:08:12.173Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T00:08:12.173Z
Learning: Applies to **/*.{ts,tsx} : Forward error reporting to Sentry using custom `reportError()` function from `src/lib/logger.ts` with context
Applied to files:
__tests__/lib/sentry.test.ts
🧬 Code graph analysis (2)
__tests__/app/index.test.tsx (2)
__tests__/test-utils.tsx (2)
restorePlatformOS(46-52)setPlatformOS(34-40)app/index.tsx (1)
Index(21-30)
__tests__/lib/sentry.test.ts (1)
lib/sentry.ts (6)
initializeSentry(58-115)setSentryUser(120-126)clearSentryUser(131-134)setSentryContext(139-142)wrapRootComponent(148-151)captureSentryException(156-162)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Build for Web
🔇 Additional comments (16)
.github/workflows/claude-code-review.yml (1)
26-33: Ensure action failures are surfaced, not silently masked.Adding
continue-on-error: true(line 29) allows the workflow to proceed even if the Claude Code Review action fails. While this improves resilience, it can silently mask legitimate action failures—the job will appear successful even when the step fails.Since the step has
id: claude-review, mitigation options include:
- Add a final validation step with
if: always()to inspectsteps.claude-review.outcomeand fail the job if needed- Post a PR comment when the action fails using a conditional step (
if: failure() && steps.claude-review.conclusion == 'failure')- Log failure details or emit annotations so CI dashboards capture the issue
Without such mitigation, reviewers may not notice when code review checks have failed.
__tests__/contexts/ThemeContext.test.tsx (1)
223-224: Verify that light theme background color #ffffff matches the ThemeContext implementation.The assertion has been updated to expect
#fffffffor the light theme background. This should be verified against the actual ThemeContext implementation to ensure the test now correctly reflects the component's behavior.Additionally, consider updating this test to use
renderWithProvidersfrom test-utils (as specified in coding guidelines for**/*.test.{ts,tsx}files) instead of a custom wrapper, to ensure consistency with other tests in the suite and proper wrapping with AuthContext and ThemeContext.__tests__/lib/sentry.test.ts (6)
17-41: Mock setup pattern is well-designed for module reset scenarios.Defining mocks outside the factory ensures reference persistence across
jest.resetModules()calls. This is a correct approach for testing modules that need fresh imports with different environment configurations.
70-77: LGTM!The
beforeEachcorrectly clears mocks and sets up default environment. Moving module resets to individual tests that need fresh state is a reasonable approach that improves test isolation control.
154-185: LGTM!The error handling test properly verifies that
initializeSentrycatches and logs errors without throwing. Theconsole.errorspy is correctly restored, and the mock implementation is reset after the test.
386-396: Test relies on module cache state from prior tests.Unlike other tests, this doesn't call
resetModules(), so it receives a cached module wheremockReactNavigationIntegrationwas already invoked during a prior test's import. The assertiontoHaveBeenCalled()passes due to accumulated calls, not fresh verification.If this is intentional (testing that integration exists), consider documenting it. If isolated verification is desired:
describe('navigationIntegration', () => { it('exports navigation integration', () => { + jest.resetModules(); + mockReactNavigationIntegration.mockClear(); process.env.EXPO_PUBLIC_SENTRY_DSN = 'https://test@sentry.io/123'; // eslint-disable-next-line @typescript-eslint/no-require-imports const { navigationIntegration } = require('@/lib/sentry'); expect(navigationIntegration).toEqual({ name: 'ReactNavigation' }); expect(mockReactNavigationIntegration).toHaveBeenCalled(); }); });
124-152: LGTM!The test correctly manipulates
global.__DEV__to verify environment-based configuration, with proper save and restore of the original value.
327-369: LGTM!The
captureSentryExceptiontests comprehensively cover both scenarios: with and without optional context. The assertions correctly verify the call structure matches the implementation inlib/sentry.ts.__tests__/app/index.test.tsx (1)
1-70: Excellent test coverage for platform-specific routing behavior!The test suite is well-structured and follows all coding guidelines:
- Uses
@/path alias for all imports ✓- Uses
renderWithProviderswrapper as required ✓- Platform detection properly mocked using
setPlatformOS/restorePlatformOSutilities ✓- Comprehensive coverage across iOS, Android, and web platforms ✓
- Tests behavior (redirect vs. landing page rendering) not implementation details ✓
- Proper cleanup with
afterEachto prevent test pollution ✓- Descriptive test names that clearly communicate intent ✓
All previous review concerns have been successfully addressed.
Based on learnings and coding guidelines.
.github/workflows/ci.yml (5)
42-42: Good practice: Timeout configurations prevent hanging jobs.The addition of 10-minute timeouts at both job and step levels ensures that CI pipelines don't hang indefinitely. The consistent 10-minute duration across all jobs aligns with the past review feedback.
Also applies to: 53-53, 79-79, 97-97
54-56: Sensible defaults for test environment.Providing fallback values for Supabase configuration ensures tests can run in environments where secrets aren't configured (e.g., forks, local testing). The test-specific defaults are clearly distinguishable from production values.
88-93: Proactive secret validation improves developer experience.The secret check step provides early, actionable feedback when required configuration is missing. This helps developers identify setup issues before the build fails, improving the debugging experience.
102-103: Appropriate build-time environment configuration.Setting
EXPO_PUBLIC_APP_ENV: 'production'clearly designates the build context, and defaultingEXPO_PUBLIC_FACEBOOK_APP_IDto an empty string prevents build failures when the optional Facebook integration isn't configured.
59-59: Coverage upload guards are correct, but depend on coverage generation.Using
if: always()ensures coverage artifacts are uploaded even when tests fail, which is essential for tracking coverage trends. However, these steps depend on coverage being generated in the first place (see comment on Line 52 about the missing--coverageflag).Also applies to: 67-67
__tests__/lib/supabase.test.ts (2)
15-32: Supabase mocking setup and imports look solidImporting
PlatformandAsyncStorageat the top and centralizingmockCreateClientas ajest.fnwired into the@supabase/supabase-jsmock gives you a single, inspectable client factory and keeps the storage adapter tests focused on behavior, which matches the Supabase mocking guidance in the learnings. No issues here.Based on learnings, this aligns with the expectation to mock Supabase and storage consistently in tests.
75-96: Lazy-init test now correctly uses the re-required Supabase mock afterjest.resetModulesRequiring
@supabase/supabase-jsafterjest.resetModules()and asserting againstsupabaseJs.createClient.mock.callsavoids stale references to the mock and makes the lazy-initialization behavior ofsupabaseobservable in a realistic way. The assertions on the first two arguments (URL and anon key) are robust and not tied to the exact options object shape. This is a good, resilient pattern.Based on learnings, this gives you stronger guarantees around Supabase client initialization in a reset JSDOM environment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
♻️ Duplicate comments (1)
.github/workflows/ci.yml (1)
60-66: Missing coverage flag — contradicts prior review feedback.Line 61 removes the
--coverageflag from the test command (pnpm test:ciinstead ofpnpm test:ci --coverage). However, a prior reviewer explicitly requested: "We should still run with coverage." Additionally, project learnings emphasize that coverage must stay above 80%. Without the--coverageflag, the coverage upload steps (lines 67–82) will have no data to report.Restore the
--coverageflag:- name: Run tests with coverage - run: pnpm test:ci + run: pnpm test:ci --coverage timeout-minutes: 10 env: EXPO_PUBLIC_SUPABASE_URL: ${{ secrets.EXPO_PUBLIC_SUPABASE_URL || 'https://test.supabase.co' }} EXPO_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.EXPO_PUBLIC_SUPABASE_ANON_KEY || 'test-anon-key' }}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/ci.yml(3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
!(lib/logger.ts|lib/sentry.ts|jest.setup.js)
📄 CodeRabbit inference engine (CLAUDE.md)
Use ESLint no-console rule; never use console.log/error/warn directly - use the universal logger instead (exceptions: logger.ts, sentry.ts, jest.setup.js)
Files:
.github/workflows/ci.yml
🧠 Learnings (8)
📓 Common learnings
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to tests/**/*.{ts,tsx} : Add comprehensive test coverage for components, hooks, utilities, and API routes in tests/ directory
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Run `pnpm test` to verify all tests pass and coverage stays above 80% before committing
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to src/**/*.{ts,tsx} : Run pnpm test to ensure all unit tests pass after any file changes
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-02T03:55:42.720Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.720Z
Learning: Use `pnpm format && pnpm lint && pnpm typecheck && pnpm build:web && pnpm test` validation workflow before committing
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-02T00:08:12.173Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T00:08:12.173Z
Learning: After changing any files, run validation workflow: `pnpm format && pnpm typecheck && pnpm lint && pnpm test && pnpm build`. All checks must pass before committing.
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to tests/**/*.{ts,tsx} : Add comprehensive test coverage for components, hooks, utilities, and API routes in tests/ directory
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Run complete validation workflow: `pnpm format && pnpm lint && pnpm typecheck && pnpm build:web && pnpm test` before committing
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to src/**/*.{ts,tsx,js,jsx,css} : Run pnpm build to verify production build passes after any file changes
Applied to files:
.github/workflows/ci.yml
🔇 Additional comments (3)
.github/workflows/ci.yml (3)
104-113: Good defensive check for required build secrets.The explicit validation of Supabase secrets before attempting the build is a solid practice. It provides clear error messaging and prevents silent failures downstream.
64-65: Sensible environment variable defaults for local testing.Providing fallback values for Supabase secrets improves the local development experience and allows test runs without GitHub secrets configured.
68-68: Coverage uploads withif: always()improves visibility.Running uploads unconditionally ensures coverage artifacts and reports are captured even if tests fail, which aids debugging and CI transparency.
Also applies to: 76-76
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (1)
.github/workflows/ci.yml (1)
51-58: Verification steps may still mask missing tools — consider strict failure mode.This step uses
||fallbacks to prevent failures when Jest or test files are missing. While these are helpful for diagnostics, they won't alert you to actual configuration issues. Per a previous review comment, consider addingset -eto make verification strict.- name: Verify test setup run: | + set -e echo "Node version: $(node --version)" echo "pnpm version: $(pnpm --version)" echo "Checking if jest is available..." pnpm jest --version || echo "Jest not found" echo "Checking test files..." find . -name "*.test.*" -o -name "*.spec.*" | head -5 || echo "No test files found"Alternatively, remove the
||fallbacks entirely to fail fast if tools are missing.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/ci.yml(3 hunks)__tests__/lib/supabase.test.ts(5 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
**/*supabase*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*supabase*.{ts,tsx}: Supabase client must use custom storage adapter for platform-aware persistence (SecureStore native, localStorage web) with singleton pattern via Proxy lazy initialization
Storage adapter must handle SSR gracefully (no-op during server-side rendering)
Supabase client must auto-refresh tokens and persist sessions across app restarts
Files:
__tests__/lib/supabase.test.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: All database operations must use typed client fromtypes/database.ts(source of truth)
Use ErrorBoundary component for graceful failure handling
All imports must use@/path alias (configured in tsconfig.json)
File organization order: imports → types → constants → helpers → main logic → exports with required section comments
JSDoc/TSDoc documentation is mandatory for all exported functions and components
Use mount status tracking with useRef to prevent closure issues in async operations
**/*.{ts,tsx}: Runpnpm typecheckto verify TypeScript types before committing
Write tests for any new or modified code, including happy path, edge cases, and error handling
Every exported function, hook, and component MUST have JSDoc/TSDoc comments that work with IntelliSense
Preferinterfacefor defining object shapes in TypeScript
Use strict mode in TypeScript (strict: truein tsconfig); avoidanytype, useunknownwith type guards instead
Use database types fromtypes/database.tsas the source of truth
Use Supabase client with typed database schema (types/database.ts); all data models derive from database types
Use platform-aware storage: SecureStore (native) / localStorage (web)
Session tokens are stored securely (SecureStore on native, localStorage on web)
Tasks flow unidirectionally from sponsor → sponsee within a relationship
Files:
__tests__/lib/supabase.test.ts
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx,js,jsx}: NEVER use console.log/error/warn directly - use logger fromlib/logger.ts
All logs are automatically sent to Sentry as breadcrumbs with categorized metadata using LogCategory enum
Logger reserved keys (error_message, error_stack, error_name) must be avoided in metadata
Boolean variables must use is/has/should prefix (isLoading, hasSlipUps)
**/*.{ts,tsx,js,jsx}: Runpnpm lintto check for code quality issues using ESLint before committing
Use camelCase for function and variable names
Use PascalCase for component and type/interface names
Use SCREAMING_SNAKE_CASE for constants
Use 'is', 'has', or 'should' prefix for boolean variables (e.g.,isLoading,hasSlipUps)
Use 'handle' prefix for event handlers (e.g.,handlePress,handleSubmit)
Name async functions with verbs describing the action (e.g.,fetchTasks,updateProfile)
Always use@/path alias for all local imports
Remove unused imports before committing
Always pass Error objects tologger.error()for stack traces and include contextual metadata
Validate and sanitize all user inputs
Use universal logger (lib/logger.ts) for centralized, structured logging with categorization viaLogCategoryenum
Five log levels available:logger.error(),logger.warn(),logger.info(),logger.debug(),logger.trace()
Organize files logically with sections: imports, types, constants, helper functions, component, styles
Files:
__tests__/lib/supabase.test.ts
**/*.test.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.test.{ts,tsx}: UserenderWithProvidersfrom test-utils to wrap components with AuthContext/ThemeContext in tests
Test mocks must include platform detection (defaults to iOS) and timezone handling
Files:
__tests__/lib/supabase.test.ts
**/*.{ts,tsx,js,jsx,json,css}
📄 CodeRabbit inference engine (CLAUDE.md)
Run
pnpm formatto ensure consistent code formatting before committing
Files:
__tests__/lib/supabase.test.ts
**/__tests__/**/*.test.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/__tests__/**/*.test.{ts,tsx}: Runpnpm testto verify all tests pass and coverage stays above 80% before committing
Place test files in__tests__/directory mirroring the source structure (e.g.,app/(tabs)/profile.tsx→__tests__/app/profile.test.tsx)
Use Jest with React Native Testing Library for testing; mock Supabase client for database operations
All tests must use descriptive test names and be independent; group related tests withdescribe()blocks
Clean up mocks inbeforeEach()orafterEach()blocks in tests
Test behavior, not implementation details
Wrap test components with AuthContext, ThemeContext; mock Supabase client for database operations
Use MSW (Mock Service Worker) for API mocking in tests
Add regression tests for bug fixes that would have caught the bug
Update tests when modifying existing code; add new tests for new behavior
UserenderWithProvidershelper function to wrap test components with required contexts
Mock navigation with expo-router mocks in tests
Files:
__tests__/lib/supabase.test.ts
!(lib/logger.ts|lib/sentry.ts|jest.setup.js)
📄 CodeRabbit inference engine (CLAUDE.md)
Use ESLint no-console rule; never use console.log/error/warn directly - use the universal logger instead (exceptions: logger.ts, sentry.ts, jest.setup.js)
Files:
__tests__/lib/supabase.test.ts.github/workflows/ci.yml
🧠 Learnings (29)
📓 Common learnings
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to tests/**/*.{ts,tsx} : Add comprehensive test coverage for components, hooks, utilities, and API routes in tests/ directory
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Use Jest with React Native Testing Library for testing; mock Supabase client for database operations
Applied to files:
__tests__/lib/supabase.test.ts
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Wrap test components with AuthContext, ThemeContext; mock Supabase client for database operations
Applied to files:
__tests__/lib/supabase.test.ts
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to jest.setup.js : Supabase client must be mocked with chainable query builder in jest.setup.js
Applied to files:
__tests__/lib/supabase.test.ts
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to **/*.test.{ts,tsx} : Test mocks must include platform detection (defaults to iOS) and timezone handling
Applied to files:
__tests__/lib/supabase.test.ts
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to **/*supabase*.{ts,tsx} : Supabase client must use custom storage adapter for platform-aware persistence (SecureStore native, localStorage web) with singleton pattern via Proxy lazy initialization
Applied to files:
__tests__/lib/supabase.test.ts
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Use MSW (Mock Service Worker) for API mocking in tests
Applied to files:
__tests__/lib/supabase.test.ts
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Clean up mocks in `beforeEach()` or `afterEach()` blocks in tests
Applied to files:
__tests__/lib/supabase.test.ts
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to jest.setup.ts : Initialize testing-library/jest-dom and mocks in jest.setup.ts for unit test setup
Applied to files:
__tests__/lib/supabase.test.ts
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Update tests when modifying existing code; add new tests for new behavior
Applied to files:
__tests__/lib/supabase.test.ts
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to jest.setup.js : AsyncStorage and SecureStore must be mocked to prevent actual storage during tests
Applied to files:
__tests__/lib/supabase.test.ts
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Test behavior, not implementation details
Applied to files:
__tests__/lib/supabase.test.ts
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to **/*supabase*.{ts,tsx} : Supabase client must auto-refresh tokens and persist sessions across app restarts
Applied to files:
__tests__/lib/supabase.test.ts
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Mock navigation with expo-router mocks in tests
Applied to files:
__tests__/lib/supabase.test.ts
📚 Learning: 2025-12-02T03:55:42.720Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.720Z
Learning: Applies to **/*storage*.{ts,tsx} : Storage must differ by platform: SecureStore (native) vs localStorage (web)
Applied to files:
__tests__/lib/supabase.test.ts
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx} : Use platform-aware storage: SecureStore (native) / localStorage (web)
Applied to files:
__tests__/lib/supabase.test.ts
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Use `renderWithProviders` helper function to wrap test components with required contexts
Applied to files:
__tests__/lib/supabase.test.ts
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to **/*.test.{ts,tsx} : Use `renderWithProviders` from test-utils to wrap components with AuthContext/ThemeContext in tests
Applied to files:
__tests__/lib/supabase.test.ts
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to {jest.config.ts,jest.setup.ts,tests/**/*.{ts,tsx}} : Use Jest with Testing Library for unit tests located in tests/ directory with configuration via jest.config.ts and setup via jest.setup.ts
Applied to files:
__tests__/lib/supabase.test.ts
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Run `pnpm test` to verify all tests pass and coverage stays above 80% before committing
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to src/**/*.{ts,tsx} : Run pnpm test to ensure all unit tests pass after any file changes
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-02T03:55:42.720Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.720Z
Learning: Use `pnpm format && pnpm lint && pnpm typecheck && pnpm build:web && pnpm test` validation workflow before committing
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-02T00:08:12.173Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T00:08:12.173Z
Learning: After changing any files, run validation workflow: `pnpm format && pnpm typecheck && pnpm lint && pnpm test && pnpm build`. All checks must pass before committing.
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to tests/**/*.{ts,tsx} : Add comprehensive test coverage for components, hooks, utilities, and API routes in tests/ directory
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Run complete validation workflow: `pnpm format && pnpm lint && pnpm typecheck && pnpm build:web && pnpm test` before committing
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx} : Run `pnpm typecheck` to verify TypeScript types before committing
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Run `pnpm lint` to check for code quality issues using ESLint before committing
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx,js,jsx,json,css} : Run `pnpm format` to ensure consistent code formatting before committing
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to src/**/*.{ts,tsx,js,jsx,css} : Run pnpm build to verify production build passes after any file changes
Applied to files:
.github/workflows/ci.yml
🧬 Code graph analysis (1)
__tests__/lib/supabase.test.ts (2)
jest.setup.js (4)
require(164-164)require(298-298)require(307-307)require(336-336)lib/supabase.ts (1)
supabase(78-87)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Unit Tests
🔇 Additional comments (9)
.github/workflows/ci.yml (5)
61-70: Environment variable defaults in test job — verify they're intentional.Lines 68–69 provide fallback values for
EXPO_PUBLIC_SUPABASE_URLandEXPO_PUBLIC_SUPABASE_ANON_KEYwhen secrets are not set. This is appropriate for running tests in CI, but verify that these defaults don't leak into production builds or mask real secret configuration issues during test runs.
72-78: Good addition: failure diagnostics with test and build output summaries.The new "Display test/build summary on failure" steps improve observability by capturing tail output from log files. This aligns well with the earlier CI improvements and provides helpful context for debugging failures.
Also applies to: 145-151
117-132: Secrets validation step is effective for build prerequisites.The explicit check for required Supabase secrets before the build step provides clear feedback. However, verify that this validation is consistent with how the test job handles missing secrets (which uses fallback values on line 68–69). If both jobs require valid secrets, consider either:
- Requiring secrets in both jobs with no fallbacks, or
- Documenting why test defaults are acceptable but build secrets must be present.
81-81: Coverage upload configuration looks sound.The
if: always()conditions ensure artifacts are captured even on test failure, andif-no-files-found: ignoreprevents spurious failures if coverage reports are missing.Also applies to: 89-89, 95-95
42-42: Job-level timeouts are consistent at 10 minutes.Both test and build jobs now have
timeout-minutes: 10at the job level. This appears to address the prior feedback to keep timeouts consistent and avoids redundancy.Also applies to: 101-101
__tests__/lib/supabase.test.ts (4)
15-16: LGTM: Imports properly placed for mock setup.The imports are correctly positioned before the mock definitions, which is necessary for Jest to properly mock these modules later in the file.
28-31: LGTM: Clean mock factory pattern.The
mockCreateClientfactory function provides a consistent way to generate the mock Supabase client across all tests, improving maintainability.
84-99: LGTM: Lazy initialization test properly refactored.The test correctly implements the module reset pattern and successfully uses the new helper function. The redundant
mockCreateClient.mockClear()call mentioned in past reviews has been removed, and the clear comments help explain the re-require flow.
336-349: LGTM: Environment validation test properly refactored.This test successfully implements the same refactoring pattern as the lazy initialization test, using the helper function to verify environment-based configuration. The previous duplication concern has been resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/ci.yml(3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
!(lib/logger.ts|lib/sentry.ts|jest.setup.js)
📄 CodeRabbit inference engine (CLAUDE.md)
Use ESLint no-console rule; never use console.log/error/warn directly - use the universal logger instead (exceptions: logger.ts, sentry.ts, jest.setup.js)
Files:
.github/workflows/ci.yml
🧠 Learnings (9)
📓 Common learnings
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to tests/**/*.{ts,tsx} : Add comprehensive test coverage for components, hooks, utilities, and API routes in tests/ directory
📚 Learning: 2025-12-02T00:08:12.173Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T00:08:12.173Z
Learning: After changing any files, run validation workflow: `pnpm format && pnpm typecheck && pnpm lint && pnpm test && pnpm build`. All checks must pass before committing.
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Run `pnpm test` to verify all tests pass and coverage stays above 80% before committing
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to src/**/*.{ts,tsx} : Run pnpm test to ensure all unit tests pass after any file changes
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-02T03:55:42.720Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.720Z
Learning: Use `pnpm format && pnpm lint && pnpm typecheck && pnpm build:web && pnpm test` validation workflow before committing
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx} : Run `pnpm typecheck` to verify TypeScript types before committing
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Run `pnpm lint` to check for code quality issues using ESLint before committing
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Run complete validation workflow: `pnpm format && pnpm lint && pnpm typecheck && pnpm build:web && pnpm test` before committing
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx,js,jsx,json,css} : Run `pnpm format` to ensure consistent code formatting before committing
Applied to files:
.github/workflows/ci.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Build for Web
🔇 Additional comments (3)
.github/workflows/ci.yml (3)
53-55: Environment variable defaults improve local and CI robustness.The fallback defaults for
EXPO_PUBLIC_SUPABASE_URLandEXPO_PUBLIC_SUPABASE_ANON_KEYallow tests to run locally and in CI even when secrets are not configured, reducing friction and enabling better test isolation.
42-42: Consistent job-level timeout configuration.Job-level
timeout-minutes: 10is now consistently applied to both the test and build jobs, addressing the earlier feedback to keep timeouts uniform and avoiding the redundancy that was previously flagged.Also applies to: 78-78
58-58: Appropriate conditional artifact handling.The use of
if: always()on coverage steps (lines 58, 66) ensures coverage is uploaded even on test failure, improving observability. Theif-no-files-foundsettings (ignorefor coverage,warnfor build artifacts) are sensible defaults for optional versus expected outputs.Also applies to: 66-66, 72-72, 100-100
…point into feature/web-only-lp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (5)
.github/workflows/ci.yml(3 hunks)__tests__/hooks/useDaysSober.test.ts(1 hunks)__tests__/lib/logger.test.ts(14 hunks)__tests__/lib/sentry.test.ts(11 hunks)jest.setup.js(6 hunks)
🧰 Additional context used
📓 Path-based instructions (9)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx,js,jsx}: NEVER use console.log/error/warn directly - use logger fromlib/logger.ts
All logs are automatically sent to Sentry as breadcrumbs with categorized metadata using LogCategory enum
Logger reserved keys (error_message, error_stack, error_name) must be avoided in metadata
Boolean variables must use is/has/should prefix (isLoading, hasSlipUps)
**/*.{ts,tsx,js,jsx}: Runpnpm lintto check for code quality issues using ESLint before committing
Use camelCase for function and variable names
Use PascalCase for component and type/interface names
Use SCREAMING_SNAKE_CASE for constants
Use 'is', 'has', or 'should' prefix for boolean variables (e.g.,isLoading,hasSlipUps)
Use 'handle' prefix for event handlers (e.g.,handlePress,handleSubmit)
Name async functions with verbs describing the action (e.g.,fetchTasks,updateProfile)
Always use@/path alias for all local imports
Remove unused imports before committing
Always pass Error objects tologger.error()for stack traces and include contextual metadata
Validate and sanitize all user inputs
Use universal logger (lib/logger.ts) for centralized, structured logging with categorization viaLogCategoryenum
Five log levels available:logger.error(),logger.warn(),logger.info(),logger.debug(),logger.trace()
Organize files logically with sections: imports, types, constants, helper functions, component, styles
Files:
jest.setup.js__tests__/hooks/useDaysSober.test.ts__tests__/lib/logger.test.ts__tests__/lib/sentry.test.ts
{lib/logger.ts,lib/sentry.ts,jest.setup.js}
📄 CodeRabbit inference engine (AGENTS.md)
Console.log/error/warn are only permitted in logger.ts, sentry.ts, and jest.setup.js
Files:
jest.setup.js
jest.setup.js
📄 CodeRabbit inference engine (AGENTS.md)
jest.setup.js: Supabase client must be mocked with chainable query builder in jest.setup.js
AsyncStorage and SecureStore must be mocked to prevent actual storage during tests
Files:
jest.setup.js
**/*.{ts,tsx,js,jsx,json,css}
📄 CodeRabbit inference engine (CLAUDE.md)
Run
pnpm formatto ensure consistent code formatting before committing
Files:
jest.setup.js__tests__/hooks/useDaysSober.test.ts__tests__/lib/logger.test.ts__tests__/lib/sentry.test.ts
!(lib/logger.ts|lib/sentry.ts|jest.setup.js)
📄 CodeRabbit inference engine (CLAUDE.md)
Use ESLint no-console rule; never use console.log/error/warn directly - use the universal logger instead (exceptions: logger.ts, sentry.ts, jest.setup.js)
Files:
jest.setup.js__tests__/hooks/useDaysSober.test.ts__tests__/lib/logger.test.ts__tests__/lib/sentry.test.ts.github/workflows/ci.yml
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: All database operations must use typed client fromtypes/database.ts(source of truth)
Use ErrorBoundary component for graceful failure handling
All imports must use@/path alias (configured in tsconfig.json)
File organization order: imports → types → constants → helpers → main logic → exports with required section comments
JSDoc/TSDoc documentation is mandatory for all exported functions and components
Use mount status tracking with useRef to prevent closure issues in async operations
**/*.{ts,tsx}: Runpnpm typecheckto verify TypeScript types before committing
Write tests for any new or modified code, including happy path, edge cases, and error handling
Every exported function, hook, and component MUST have JSDoc/TSDoc comments that work with IntelliSense
Preferinterfacefor defining object shapes in TypeScript
Use strict mode in TypeScript (strict: truein tsconfig); avoidanytype, useunknownwith type guards instead
Use database types fromtypes/database.tsas the source of truth
Use Supabase client with typed database schema (types/database.ts); all data models derive from database types
Use platform-aware storage: SecureStore (native) / localStorage (web)
Session tokens are stored securely (SecureStore on native, localStorage on web)
Tasks flow unidirectionally from sponsor → sponsee within a relationship
Files:
__tests__/hooks/useDaysSober.test.ts__tests__/lib/logger.test.ts__tests__/lib/sentry.test.ts
**/*.test.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.test.{ts,tsx}: UserenderWithProvidersfrom test-utils to wrap components with AuthContext/ThemeContext in tests
Test mocks must include platform detection (defaults to iOS) and timezone handling
Files:
__tests__/hooks/useDaysSober.test.ts__tests__/lib/logger.test.ts__tests__/lib/sentry.test.ts
**/__tests__/**/*.test.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/__tests__/**/*.test.{ts,tsx}: Runpnpm testto verify all tests pass and coverage stays above 80% before committing
Place test files in__tests__/directory mirroring the source structure (e.g.,app/(tabs)/profile.tsx→__tests__/app/profile.test.tsx)
Use Jest with React Native Testing Library for testing; mock Supabase client for database operations
All tests must use descriptive test names and be independent; group related tests withdescribe()blocks
Clean up mocks inbeforeEach()orafterEach()blocks in tests
Test behavior, not implementation details
Wrap test components with AuthContext, ThemeContext; mock Supabase client for database operations
Use MSW (Mock Service Worker) for API mocking in tests
Add regression tests for bug fixes that would have caught the bug
Update tests when modifying existing code; add new tests for new behavior
UserenderWithProvidershelper function to wrap test components with required contexts
Mock navigation with expo-router mocks in tests
Files:
__tests__/hooks/useDaysSober.test.ts__tests__/lib/logger.test.ts__tests__/lib/sentry.test.ts
**/hooks/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Extract reusable logic into custom hooks
Files:
__tests__/hooks/useDaysSober.test.ts
🧠 Learnings (43)
📓 Common learnings
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to tests/**/*.{ts,tsx} : Add comprehensive test coverage for components, hooks, utilities, and API routes in tests/ directory
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Use Jest with React Native Testing Library for testing; mock Supabase client for database operations
Applied to files:
jest.setup.js__tests__/hooks/useDaysSober.test.ts__tests__/lib/logger.test.ts__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Wrap test components with AuthContext, ThemeContext; mock Supabase client for database operations
Applied to files:
jest.setup.js__tests__/hooks/useDaysSober.test.ts__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to jest.setup.js : Supabase client must be mocked with chainable query builder in jest.setup.js
Applied to files:
jest.setup.js__tests__/lib/logger.test.ts__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to jest.setup.js : AsyncStorage and SecureStore must be mocked to prevent actual storage during tests
Applied to files:
jest.setup.js__tests__/hooks/useDaysSober.test.ts__tests__/lib/logger.test.ts__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to **/*.test.{ts,tsx} : Test mocks must include platform detection (defaults to iOS) and timezone handling
Applied to files:
jest.setup.js__tests__/hooks/useDaysSober.test.ts__tests__/lib/logger.test.ts__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to jest.setup.ts : Initialize testing-library/jest-dom and mocks in jest.setup.ts for unit test setup
Applied to files:
jest.setup.js__tests__/hooks/useDaysSober.test.ts__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Mock navigation with expo-router mocks in tests
Applied to files:
jest.setup.js__tests__/hooks/useDaysSober.test.ts__tests__/lib/logger.test.ts__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Use MSW (Mock Service Worker) for API mocking in tests
Applied to files:
jest.setup.js__tests__/hooks/useDaysSober.test.ts__tests__/lib/logger.test.ts__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/components/**/*.{ts,tsx} : Use functional components with hooks (no class components) in React/React Native
Applied to files:
jest.setup.js
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/components/**/*.{ts,tsx} : Define Props interfaces inline or export if shared; use StyleSheet.create() for component styles
Applied to files:
jest.setup.js
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Use `renderWithProviders` helper function to wrap test components with required contexts
Applied to files:
jest.setup.js__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Clean up mocks in `beforeEach()` or `afterEach()` blocks in tests
Applied to files:
jest.setup.js__tests__/hooks/useDaysSober.test.ts__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-02T00:08:12.173Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T00:08:12.173Z
Learning: Applies to tests/**/*.{ts,tsx,js} : Use Jest for unit tests located in `tests/` directory
Applied to files:
jest.setup.js__tests__/hooks/useDaysSober.test.ts
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to **/*.test.{ts,tsx} : Use `renderWithProviders` from test-utils to wrap components with AuthContext/ThemeContext in tests
Applied to files:
jest.setup.js__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to {jest.config.ts,jest.setup.ts,tests/**/*.{ts,tsx}} : Use Jest with Testing Library for unit tests located in tests/ directory with configuration via jest.config.ts and setup via jest.setup.ts
Applied to files:
jest.setup.js__tests__/hooks/useDaysSober.test.ts__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Test behavior, not implementation details
Applied to files:
__tests__/hooks/useDaysSober.test.ts__tests__/lib/logger.test.ts__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to src/**/*.{ts,tsx} : Use date-fns for date manipulation and formatting in TypeScript files
Applied to files:
__tests__/hooks/useDaysSober.test.ts
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Update tests when modifying existing code; add new tests for new behavior
Applied to files:
__tests__/hooks/useDaysSober.test.ts__tests__/lib/logger.test.ts__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to {lib/logger.ts,lib/sentry.ts,jest.setup.js} : Console.log/error/warn are only permitted in logger.ts, sentry.ts, and jest.setup.js
Applied to files:
__tests__/lib/logger.test.ts
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to src/**/*.{ts,tsx} : Use reportError(context, error) from src/lib/logger.ts to report errors to Sentry with context metadata, falling back to console.error
Applied to files:
__tests__/lib/logger.test.ts__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-02T00:08:12.173Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T00:08:12.173Z
Learning: Applies to **/*.{ts,tsx} : Forward error reporting to Sentry using custom `reportError()` function from `src/lib/logger.ts` with context
Applied to files:
__tests__/lib/logger.test.ts__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : All logs are automatically sent to Sentry as breadcrumbs with categorized metadata using LogCategory enum
Applied to files:
__tests__/lib/logger.test.ts
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to !(lib/logger.ts|lib/sentry.ts|jest.setup.js) : Use ESLint no-console rule; never use console.log/error/warn directly - use the universal logger instead (exceptions: logger.ts, sentry.ts, jest.setup.js)
Applied to files:
__tests__/lib/logger.test.ts
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Add regression tests for bug fixes that would have caught the bug
Applied to files:
__tests__/lib/logger.test.ts
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use universal logger (`lib/logger.ts`) for centralized, structured logging with categorization via `LogCategory` enum
Applied to files:
__tests__/lib/logger.test.ts
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Five log levels available: `logger.error()`, `logger.warn()`, `logger.info()`, `logger.debug()`, `logger.trace()`
Applied to files:
__tests__/lib/logger.test.ts
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to **/*auth*.{ts,tsx} : Auth errors must include detailed context for debugging without exposing sensitive data
Applied to files:
__tests__/lib/logger.test.ts
📚 Learning: 2025-12-02T03:55:42.719Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.719Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : NEVER use console.log/error/warn directly - use logger from `lib/logger.ts`
Applied to files:
__tests__/lib/logger.test.ts
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to app/_layout.tsx : Wrap app with Sentry SDK in root component for crash reporting and error tracking
Applied to files:
__tests__/lib/logger.test.ts__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to sentry.server.config.ts : Configure Sentry with trace sampling (100%), logs enabled, PII enabled, replay integration with 10% session sampling and 100% on errors, and request error tracking via onRequestError hook
Applied to files:
__tests__/lib/logger.test.ts
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to {sentry.server.config.ts,sentry.edge.config.ts,src/instrumentation-client.ts,src/instrumentation.ts} : Use Sentry for error tracking and performance monitoring with configuration files sentry.server.config.ts and sentry.edge.config.ts, and client instrumentation via src/instrumentation-client.ts
Applied to files:
__tests__/lib/logger.test.ts
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to tests/**/*.{ts,tsx} : Add comprehensive test coverage for components, hooks, utilities, and API routes in tests/ directory
Applied to files:
__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Set NEXT_PUBLIC_SENTRY_DSN environment variable to configure Sentry DSN; if not set, Sentry is disabled
Applied to files:
__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : All tests must use descriptive test names and be independent; group related tests with `describe()` blocks
Applied to files:
__tests__/lib/sentry.test.ts
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/__tests__/**/*.test.{ts,tsx} : Run `pnpm test` to verify all tests pass and coverage stays above 80% before committing
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-02T00:07:55.331Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-02T00:07:55.331Z
Learning: Applies to src/**/*.{ts,tsx} : Run pnpm test to ensure all unit tests pass after any file changes
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-02T00:08:12.173Z
Learnt from: CR
Repo: VolvoxCommunity/Volvox.Website PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T00:08:12.173Z
Learning: After changing any files, run validation workflow: `pnpm format && pnpm typecheck && pnpm lint && pnpm test && pnpm build`. All checks must pass before committing.
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-02T03:55:42.720Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-02T03:55:42.720Z
Learning: Use `pnpm format && pnpm lint && pnpm typecheck && pnpm build:web && pnpm test` validation workflow before committing
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Run complete validation workflow: `pnpm format && pnpm lint && pnpm typecheck && pnpm build:web && pnpm test` before committing
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx} : Run `pnpm typecheck` to verify TypeScript types before committing
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Run `pnpm lint` to check for code quality issues using ESLint before committing
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-12-04T03:11:15.106Z
Learnt from: CR
Repo: VolvoxCommunity/Sobriety-Waypoint PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-04T03:11:15.106Z
Learning: Applies to **/*.{ts,tsx,js,jsx,json,css} : Run `pnpm format` to ensure consistent code formatting before committing
Applied to files:
.github/workflows/ci.yml
🧬 Code graph analysis (3)
__tests__/hooks/useDaysSober.test.ts (1)
jest.setup.js (1)
actualDate(303-303)
__tests__/lib/logger.test.ts (1)
lib/logger.ts (1)
logger(255-261)
__tests__/lib/sentry.test.ts (1)
lib/sentry.ts (7)
initializeSentry(58-115)setSentryUser(120-126)clearSentryUser(131-134)setSentryContext(139-142)wrapRootComponent(148-151)captureSentryException(156-162)navigationIntegration(10-12)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Build for Web
🔇 Additional comments (12)
__tests__/hooks/useDaysSober.test.ts (1)
40-48: LGTM! The date module mock appropriately uses real implementation with controlled overrides.The mock pattern correctly spreads the actual implementation while overriding
DEVICE_TIMEZONEandparseDateAsLocal. This aligns with the approach injest.setup.js(line 302) and ensuresgetDateDiffInDaysuses the real implementation for accurate testing..github/workflows/ci.yml (2)
88-97: Well-structured environment fallback pattern for build.The dual approach using both GitHub secrets in
env:block and shell-level fallbacks with${VAR:-default}ensures the build succeeds even when secrets are unavailable (e.g., in forked repositories). This is a robust CI pattern.
52-55: Missing--coverageflag in test command.The test step runs
pnpm test:ciwithout an explicit--coverageflag, but subsequent steps attempt to upload coverage to Codecov (lines 57-63) and publish coverage artifacts (lines 65-72). Verify whether thetest:ciscript inpackage.jsonalready includes coverage collection; if not, add--coverageto the command or update the script to include it.__tests__/lib/sentry.test.ts (3)
17-48: LGTM! Well-designed mock persistence strategy for module reset testing.The approach of defining mock functions outside the factory ensures they survive
jest.resetModules()calls. The factory returning mocks directly (not wrapped) is the correct pattern for this use case. The inline comments explaining the persistence requirement are helpful for maintainability.
91-116: LGTM! Consistent reset-and-require pattern for module initialization testing.The test correctly follows the pattern: set environment variable before
resetModules(), re-require the mocked module to get fresh references, clear mocks, then test. This ensures the module under test sees the correct environment at load time.
393-408: LGTM! Navigation integration test correctly verifies module load-time behavior.The test appropriately verifies that
navigationIntegrationis created at module load time (viareactNavigationIntegrationcall) and has the expectedregisterNavigationContainerproperty, aligning with the actual implementation inlib/sentry.ts(lines 9-11).jest.setup.js (3)
320-326: LGTM! Correct mock ordering for Supabase client.The comment clearly documents the dependency on
@supabase/supabase-jsmock being defined first. The pattern correctly creates a mock client using the mockedcreateClientfunction, ensuring consistent behavior across tests.
357-391: LGTM! Comprehensive SVG mock supporting both import patterns.The mock correctly handles both default and named imports with
__esModule: true. ThetestIDattributes on components enable easy querying in tests. ThedisplayNameassignments improve debugging and test output readability.
444-453: LGTM! Supabase mock expanded with OAuth, session, and RPC support.The additions for
signInWithOAuth,setSession, andrpcfollow the established mock pattern returning{ data, error }objects. This enables comprehensive testing of authentication flows and stored procedure calls. As per coding guidelines, the Supabase client mock with chainable query builder is correctly maintained in jest.setup.js.__tests__/lib/logger.test.ts (3)
1-13: LGTM! Clean pattern for testing real implementation with mocked Sentry.The approach of importing the logger first, then unmocking it, followed by defining mock functions and setting up the Sentry mock is correct. The factory functions delegate to module-level mocks, ensuring
jest.clearAllMocks()works as expected. This is a cleaner pattern than thereset-and-requireapproach used in sentry.test.ts.
190-199: LGTM! Consistent use ofglobalThisfor__DEV__access.Using
globalThisinstead ofglobalis the correct cross-environment approach for accessing the__DEV__flag. The pattern of saving, modifying, and restoring the original value inbeforeEach/afterEachensures test isolation.
318-346: LGTM! Robust error handling tests for Sentry failures.The tests verify that the logger gracefully handles Sentry failures by:
- Not throwing when
captureExceptionfails (line 328)- Logging a debug message about Sentry not being initialized (lines 330-332)
- Not throwing when
addBreadcrumbfails (line 345)This ensures application stability when Sentry is unavailable or misconfigured.
No description provided.