Skip to content

Dev#52

Merged
aryansoni-dev merged 2 commits into
mainfrom
dev
Jul 8, 2026
Merged

Dev#52
aryansoni-dev merged 2 commits into
mainfrom
dev

Conversation

@aryansoni-dev

@aryansoni-dev aryansoni-dev commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Added clearer offline handling in sign-in and sign-up, with an offline notice and disabled actions when connectivity is unavailable.
    • Improved the home screen so starting a new journal entry works more smoothly when no prompt is available.
  • Bug Fixes

    • Refined AI report generation settings for more consistent structured responses.
  • Documentation

    • Added a detailed product/testing guide for the journaling experience.
  • Chores

    • Updated app version and platform build numbers.

    - 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
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This 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.

Changes

Offline-aware Auth and Home Flow

Layer / File(s) Summary
Clerk resource cache wiring
app/_layout.tsx
Imports resourceCache and passes it to ClerkProvider via __experimental_resourceCache.
Offline detection and action gating
components/auth/auth-screen.tsx
Adds useConnectivity, derives isOffline/isAuthActionDisabled/isSocialActionDisabled, and blocks submit/social handlers early with an error when offline.
Auth screen UI updates
components/auth/auth-screen.tsx
Renders OfflineNotice conditionally, updates CTA and social button disabled/opacity states.
Home reflection navigation
components/home/home-screen.tsx
Routes to /journal/new with only source param when prompt missing, updates accessibility label, and always wires empty-state CTA.

AI Provider Request Body Update

Layer / File(s) Summary
Typed request body and provider capability check
supabase/functions/generate-insight-report/index.ts
Adds ChatCompletionRequestBody type, sets temperature to 0.25, conditionally includes response_format, and adds hostname-based provider capability helpers.

Version Bump and PRD Documentation

Layer / File(s) Summary
App version bump
app.json
Updates version, iOS buildNumber, and Android versionCode.
Test PRD document
testsprite-deardiary-prd.md
Adds a new PRD document describing requirements and flows.

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
Loading

Possibly related PRs

  • aryansoni-dev/dear-diary#44: Also modifies components/auth/auth-screen.tsx's AuthScreen component, adding a related prop and wiring alongside the offline handling changes.
  • aryansoni-dev/dear-diary#45: Also modifies SocialButtons/OAuth handling in components/auth/auth-screen.tsx, overlapping with the disabled-state logic added here.
  • aryansoni-dev/dear-diary#46: Also updates the AI provider request body/response handling in supabase/functions/generate-insight-report/index.ts.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is too generic to describe the actual changes in this pull request. Rename it to a concise summary of the main change, such as offline auth handling and AI response formatting updates.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between e95e396 and 1a98f7f.

📒 Files selected for processing (6)
  • app.json
  • app/_layout.tsx
  • components/auth/auth-screen.tsx
  • components/home/home-screen.tsx
  • supabase/functions/generate-insight-report/index.ts
  • testsprite-deardiary-prd.md

Comment thread app/_layout.tsx
Comment thread components/auth/auth-screen.tsx
Comment thread supabase/functions/generate-insight-report/index.ts
@aryansoni-dev aryansoni-dev merged commit 6c3dbf3 into main Jul 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant