Skip to content

[FOSSOVERFLOW-26] supabase integration issues resolved#4

Merged
Asp-irin merged 3 commits intoOpenLake:mainfrom
Sri-Varshith:main
Mar 3, 2026
Merged

[FOSSOVERFLOW-26] supabase integration issues resolved#4
Asp-irin merged 3 commits intoOpenLake:mainfrom
Sri-Varshith:main

Conversation

@Sri-Varshith
Copy link
Contributor

@Sri-Varshith Sri-Varshith commented Mar 2, 2026

the app had issues in build after supabase integration resolved them

Summary by CodeRabbit

  • Chores

    • Removed development-specific IDE configuration file
  • Refactor

    • Streamlined homepage to load and display a user profile with a clear loading state instead of live document streams
    • Simplified layout and reduced dynamic drawer/header complexity while preserving navigation and account actions
    • Standardized UI text formatting and adjusted header typography
    • Minor visual elevation tweak in the AI chat header for clearer depth separation

@coderabbitai
Copy link

coderabbitai bot commented Mar 2, 2026

Walkthrough

Removed an IDE settings file and refactored the homepage from Firestore/Realtime streams to a Supabase one-time profile fetch with loading state; small visual elevation change in the AI chat AppBar.

Changes

Cohort / File(s) Summary
IDE Configuration
\.vscode/settings.json
Deleted editor configuration (Java and CMake settings removed).
Homepage — profile & UI refactor
flutter_app/lib/pages/homepage.dart
Replaced Firestore/StreamBuilder-driven user data with a Supabase-backed one-time _loadUserProfile() flow; added isLoading and userProfile state, removed realtime Drawer/header blocks, adjusted greeting/name rendering and logout to use authService.signOut().
AI Chat — visual tweak
flutter_app/lib/pages/ai_chat.dart
Changed AppBar elevation from 1 to 4 (UI-only change).

Sequence Diagram

sequenceDiagram
    actor User
    participant HomePage as HomePage Widget
    participant Supabase as Supabase Service
    participant AuthService as Auth Service
    participant UI as UI Renderer

    User->>HomePage: Open homepage
    Note over HomePage: initState() → _loadUserProfile()\nisLoading = true
    HomePage->>Supabase: Request user profile
    Supabase-->>HomePage: Return profile data
    HomePage->>HomePage: setState(userProfile, isLoading=false)
    HomePage->>UI: Render greeting and features
    User->>HomePage: Tap logout
    HomePage->>AuthService: authService.signOut()
    AuthService-->>HomePage: Sign-out complete
    HomePage->>UI: Reset/clear user state
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰
From streams that bubbled to Supabase calm,
I fetched a profile with one gentle psalm.
A header that waits, a cleaner parade,
Drawer trimmed back, new routes softly laid.
Hop, hop — code refreshed, a tidy charade. 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title references Supabase integration issues, which aligns with the main changes: replacing Firestore with Supabase in homepage.dart and adjusting the user data flow. However, the title is somewhat vague ("issues resolved") and doesn't clearly convey the specific architectural changes made.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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 and usage tips.

Copy link

@coderabbitai coderabbitai bot left a 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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
flutter_app/lib/pages/homepage.dart (1)

35-53: ⚠️ Potential issue | 🟠 Major

Loading state can get stuck indefinitely.

If no user ID is available, the method exits without setting isLoading to false, so the spinner can remain forever. Ensure loading is finalized on every path.

✅ Proposed fix
   Future<void> _loadUserProfile() async {
     try {
       final userId = Supabase.instance.client.auth.currentUser?.id;
       if (userId != null) {
-        final profile = await authService.getUserProfile(userId);
-        if (mounted) {
-          setState(() {
-            userProfile = profile;
-            isLoading = false;
-          });
-        }
+        userProfile = await authService.getUserProfile(userId);
       }
     } catch (e) {
-      if (mounted) {
-        setState(() {
-          isLoading = false;
-        });
-      }
+      // Optional: surface an error message/snackbar.
+    } finally {
+      if (mounted) {
+        setState(() {
+          isLoading = false;
+        });
+      }
     }
   }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@flutter_app/lib/pages/homepage.dart` around lines 35 - 53, The
_loadUserProfile function can leave isLoading true when currentUser?.id is null;
modify _loadUserProfile so that isLoading is set to false on every exit path
(e.g., move the setState that sets isLoading = false into a finally block or
ensure you call setState when userId == null), keeping updates guarded by
mounted; update references to userProfile only when a profile is returned and
always clear/stop the loading spinner in the finally section so the spinner
cannot remain indefinitely.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@flutter_app/lib/pages/homepage.dart`:
- Around line 76-80: The IconButton in homepage.dart (the IconButton with icon:
Icons.notifications) is a dead tap target; update its onPressed handler to
either navigate to a real NotificationsPage or provide immediate UX feedback.
Fix by implementing a simple NotificationsPage widget (e.g., NotificationsPage
scaffold) and wire a route push from the IconButton using Navigator.pushNamed or
Navigator.push with MaterialPageRoute to that widget, or alternatively show a
SnackBar/AlertDialog with a “Coming soon” message from the current BuildContext
so taps give visible feedback; ensure you reference the IconButton's onPressed
and the NotificationsPage class or route name when making the change.

---

Outside diff comments:
In `@flutter_app/lib/pages/homepage.dart`:
- Around line 35-53: The _loadUserProfile function can leave isLoading true when
currentUser?.id is null; modify _loadUserProfile so that isLoading is set to
false on every exit path (e.g., move the setState that sets isLoading = false
into a finally block or ensure you call setState when userId == null), keeping
updates guarded by mounted; update references to userProfile only when a profile
is returned and always clear/stop the loading spinner in the finally section so
the spinner cannot remain indefinitely.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 264f97c and 97ee146.

📒 Files selected for processing (2)
  • .vscode/settings.json
  • flutter_app/lib/pages/homepage.dart
💤 Files with no reviewable changes (1)
  • .vscode/settings.json

Comment on lines 76 to 80
IconButton(
icon: const Icon(Icons.notifications),
onPressed: () {
// Handle notifications
// open notifications page later
},
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Notifications action is currently a dead tap target.

The icon is interactive but performs no action. Either wire navigation now or provide explicit “coming soon” feedback.

💡 Minimal UX-safe fallback
             IconButton(
               icon: const Icon(Icons.notifications),
               onPressed: () {
-                // open notifications page later
+                ScaffoldMessenger.of(context).showSnackBar(
+                  const SnackBar(content: Text('Notifications coming soon')),
+                );
               },
             ),

If you want, I can also draft a small NotificationsPage scaffold and route wiring.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
IconButton(
icon: const Icon(Icons.notifications),
onPressed: () {
// Handle notifications
// open notifications page later
},
IconButton(
icon: const Icon(Icons.notifications),
onPressed: () {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('Notifications coming soon')),
);
},
),
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@flutter_app/lib/pages/homepage.dart` around lines 76 - 80, The IconButton in
homepage.dart (the IconButton with icon: Icons.notifications) is a dead tap
target; update its onPressed handler to either navigate to a real
NotificationsPage or provide immediate UX feedback. Fix by implementing a simple
NotificationsPage widget (e.g., NotificationsPage scaffold) and wire a route
push from the IconButton using Navigator.pushNamed or Navigator.push with
MaterialPageRoute to that widget, or alternatively show a SnackBar/AlertDialog
with a “Coming soon” message from the current BuildContext so taps give visible
feedback; ensure you reference the IconButton's onPressed and the
NotificationsPage class or route name when making the change.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
flutter_app/lib/pages/homepage.dart (1)

76-80: ⚠️ Potential issue | 🟡 Minor

Notifications action is still a dead tap target.

onPressed currently does nothing, so users get no feedback. Please wire navigation or show a temporary “coming soon” message.

💡 Minimal UX-safe fallback
             IconButton(
               icon: const Icon(Icons.notifications),
               onPressed: () {
-                // open notifications page later
+                ScaffoldMessenger.of(context).showSnackBar(
+                  const SnackBar(content: Text('Notifications coming soon')),
+                );
               },
             ),
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@flutter_app/lib/pages/homepage.dart` around lines 76 - 80, The IconButton's
onPressed in the Homepage build currently does nothing; wire it to provide
feedback by either navigating to the notifications screen or showing a temporary
message. Replace the empty onPressed closure for the IconButton with a call to
Navigator.pushNamed(context, '/notifications') (or Navigator.push to
NotificationsPage) if a page exists, otherwise use
ScaffoldMessenger.of(context).showSnackBar(...) with a short "Coming soon"
message; reference the IconButton and its onPressed closure in homepage.dart and
use Navigator/ScaffoldMessenger APIs to implement the behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@flutter_app/lib/pages/homepage.dart`:
- Around line 76-80: The IconButton's onPressed in the Homepage build currently
does nothing; wire it to provide feedback by either navigating to the
notifications screen or showing a temporary message. Replace the empty onPressed
closure for the IconButton with a call to Navigator.pushNamed(context,
'/notifications') (or Navigator.push to NotificationsPage) if a page exists,
otherwise use ScaffoldMessenger.of(context).showSnackBar(...) with a short
"Coming soon" message; reference the IconButton and its onPressed closure in
homepage.dart and use Navigator/ScaffoldMessenger APIs to implement the
behavior.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 97ee146 and a740376.

📒 Files selected for processing (2)
  • flutter_app/lib/pages/ai_chat.dart
  • flutter_app/lib/pages/homepage.dart

@Asp-irin Asp-irin merged commit 0122b32 into OpenLake:main Mar 3, 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.

2 participants