Skip to content

Conversation

@codeunia-dev
Copy link
Owner

@codeunia-dev codeunia-dev commented Sep 15, 2025

  • Fix font loading 404 errors by removing non-existent local font preloads
  • Add explicit text-gray-900 to all input fields to ensure typed text is visible
  • Improve Supabase API error handling with graceful fallbacks
  • Remove preload links for /fonts/geist-sans.woff2 and /fonts/geist-mono.woff2
  • Update profileService to return null instead of throwing on API errors
  • Add better error handling in complete-profile page for null profiles
  • Fix performance optimization file to remove local font references

This resolves:

  • Console 404 errors for missing font files
  • Invisible typed text in name input fields
  • Supabase API 406 errors with graceful fallback
  • All console log errors shown in the screenshot

Summary by CodeRabbit

  • Bug Fixes

    • Improved profile loading resilience: if no profile is found, users can proceed with completing the form; genuine errors still show a toast.
  • Style

    • Enhanced input readability with darker text for First Name, Last Name, and Username fields.
  • Chores

    • Removed local font preloads and aligned with Google Fonts usage.
    • Stopped preloading a local font in resource hints to avoid unnecessary requests.

- Fix font loading 404 errors by removing non-existent local font preloads
- Add explicit text-gray-900 to all input fields to ensure typed text is visible
- Improve Supabase API error handling with graceful fallbacks
- Remove preload links for /fonts/geist-sans.woff2 and /fonts/geist-mono.woff2
- Update profileService to return null instead of throwing on API errors
- Add better error handling in complete-profile page for null profiles
- Fix performance optimization file to remove local font references

This resolves:
- Console 404 errors for missing font files
- Invisible typed text in name input fields
- Supabase API 406 errors with graceful fallback
- All console log errors shown in the screenshot
@vercel
Copy link

vercel bot commented Sep 15, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
codeunia Building Building Preview Comment Sep 15, 2025 4:57am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 15, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This PR adjusts profile-fetch error handling to return null on failure, updates the complete-profile page to handle a null profile path, removes local font preloads in layout and performance hints, and applies minor input class updates. No exported API signatures change.

Changes

Cohort / File(s) Summary
Complete Profile flow
app/complete-profile/page.tsx
Adds explicit else path when profile is falsy to proceed with form setup; maintains catch-to-toast error path. Adds text-gray-900 to form inputs; formatting tweaks.
Profile service error handling
lib/services/profile.ts
Wraps getProfile in try/catch; on non-PGRST116 errors logs and returns null instead of throwing. Keeps PGRST116 create-and-return behavior. No signature change.
Layout font preloads
app/layout.tsx
Removes local geist font <link rel="preload"> tags; comment added noting Google Fonts usage. No logic changes to RootLayout.
Performance resource hints
lib/performance/optimization.ts
Removes preload hint for /fonts/geist-sans.woff2 from generateResourceHints; other hints unchanged.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant UI as CompleteProfilePage
  participant SVC as ProfileService.getProfile
  participant DB as Supabase/PostgREST
  participant Toast as Toast

  UI->>SVC: getProfile(userId)
  SVC->>DB: fetch profile
  alt success
    DB-->>SVC: profile data
    SVC-->>UI: profile
    alt profile exists
      UI->>UI: pre-fill form with profile
    else profile is null
      UI->>UI: init empty form
    end
  else PGRST116 (not found)
    SVC->>DB: create profile
    DB-->>SVC: new profile
    SVC-->>UI: profile
    UI->>UI: pre-fill form with profile
  else other error
    SVC->>SVC: log and return null
    SVC-->>UI: null
    UI->>UI: init empty form
    UI->>Toast: show error toast
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

A nibble of fonts, a hop through profiles' warren,
I sniffed out errors, returned nulls—no sorrowin’.
Fields now gleam dark-gray, neat as a burrow,
Hints trimmed light, like dawn’s first furrow.
Thump! The flow is clear—onward I scurry,
Carrot-commits merged, with very little worry. 🥕🐇

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/oauth-profile-completion

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5358cad and 4976f2f.

📒 Files selected for processing (4)
  • app/complete-profile/page.tsx (3 hunks)
  • app/layout.tsx (1 hunks)
  • lib/performance/optimization.ts (0 hunks)
  • lib/services/profile.ts (1 hunks)

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

@codeunia-dev codeunia-dev merged commit b0a651a into main Sep 15, 2025
2 of 4 checks 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.

2 participants