Dev#52
Conversation
- Cache Clerk resources for offline cold starts
- Show no-internet feedback on auth screens and disable auth actions offline
- Request JSON-mode AI responses for insight reports to reduce malformed report failures
📝 WalkthroughWalkthroughThis PR bumps app version numbers, enables Clerk resource caching in the root layout, adds offline detection to the auth screen with disabled actions and notices, adjusts home screen daily reflection navigation, updates AI provider request typing/config in the insight-report function, and adds a PRD markdown document. ChangesOffline-aware Auth and Home Flow
AI Provider Request Body Update
Version Bump and PRD Documentation
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant AuthScreen
participant Connectivity as useConnectivity
participant Clerk
User->>AuthScreen: Tap submit or social sign-in
AuthScreen->>Connectivity: Check isOffline
alt isOffline is true
AuthScreen->>User: Show "No Internet Access" error
else online
AuthScreen->>Clerk: Proceed with auth/SSO flow
end
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app/_layout.tsx`:
- Line 4: The Clerk offline cache setup in the app layout should explicitly
reflect the experimental nature of the API. Keep the `resourceCache` integration
aligned with Clerk’s documented offline pattern in `_layout.tsx`, and add a
clear note near the `resourceCache`/`__experimental_resourceCache` usage that
this is experimental and not a production-stable dependency so future SDK
changes are expected.
In `@components/auth/auth-screen.tsx`:
- Around line 480-486: The primary CTA and social button opacity is still being
controlled with inline style in auth-screen, which should be moved to NativeWind
className. Update the button components in auth-screen so the disabled state
uses conditional opacity classes (for example, a low-opacity class when disabled
and opacity-100 when enabled) instead of style={{ opacity: ... }}, keeping the
existing logic in handlePrimaryPress and the social button render paths intact.
In `@supabase/functions/generate-insight-report/index.ts`:
- Around line 827-842: Refactor the request payload construction in
generate-insight-report so the ChatCompletionRequestBody is built immutably
instead of mutating requestBody after declaration. Update the logic around the
requestBody setup and supportsJsonObjectResponseFormat(baseUrl) check to
conditionally include response_format in the initial object expression, keeping
the fetch call unchanged. Use the existing requestBody symbol as the anchor and
preserve the same fields and behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 8d45cb38-d47f-43dd-b0fc-d2432a751a0a
📒 Files selected for processing (6)
app.jsonapp/_layout.tsxcomponents/auth/auth-screen.tsxcomponents/home/home-screen.tsxsupabase/functions/generate-insight-report/index.tstestsprite-deardiary-prd.md
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Chores