Fix: keep LandingPage visible until repo initialization on core pages#201
Fix: keep LandingPage visible until repo initialization on core pages#201Divine-P-77777 wants to merge 1 commit intoAOSSIE-Org:mainfrom
Conversation
📝 WalkthroughWalkthroughThe changes address a landing page persistence issue by modifying App.tsx to conditionally render a LandingPage component on specific routes when no repository data is present. Additionally, minor formatting adjustments were applied to related components. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 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: 2
🧹 Nitpick comments (2)
frontend/src/components/contributors/ContributorsPage.tsx (1)
30-30: Unusual JSX formatting: remove trailing spaces before closing brackets.Lines 30, 53, 61, and 75 have extra spaces before the closing
>in JSX tags (e.g.,<div >,<motion.button). This is inconsistent with standard JSX formatting conventions and may have been introduced accidentally by an IDE or formatter.🔎 Proposed formatting fix
- return <div >No data available. Please analyze a repository first.</div>; + return <div>No data available. Please analyze a repository first.</div>;- <motion.button + <motion.button whileHover={{ scale: 1.05 }}- <motion.button + <motion.button whileHover={{ scale: 1.05 }}- <ContributorCard + <ContributorCard key={contributor.login}Also applies to: 53-53, 61-61, 75-75
frontend/src/components/dashboard/Dashboard.tsx (1)
29-29: Unusual JSX formatting: remove trailing spaces before closing brackets.Lines 29, 41, 47, 53, 59, 70, 77, and 84 have extra spaces before the closing
>in JSX tags (e.g.,<motion.button,<StatCard,<BotIntegration). This formatting pattern is inconsistent with standard JSX conventions and appears across multiple files in this PR.Also applies to: 41-41, 47-47, 53-53, 59-59, 70-70, 77-77, 84-84
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
frontend/src/App.tsxfrontend/src/components/contributors/ContributorsPage.tsxfrontend/src/components/dashboard/Dashboard.tsx
🧰 Additional context used
🧬 Code graph analysis (1)
frontend/src/components/dashboard/Dashboard.tsx (1)
frontend/src/components/dashboard/StatCard.tsx (1)
StatCard(11-43)
| import { supabase } from './lib/supabaseClient'; | ||
| import ForgotPasswordPage from './components/pages/ForgotPasswordPage'; | ||
| import ResetPasswordPage from './components/pages/ResetPasswordPage'; | ||
| import { useLocation } from 'react-router-dom'; |
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major
Consolidate duplicate import from 'react-router-dom'.
The useLocation import on line 21 creates a second import statement from 'react-router-dom', when it should be added to the existing import on line 2.
🔎 Proposed fix
-import { BrowserRouter as Router, Routes, Route, Navigate, Outlet } from 'react-router-dom';
+import { BrowserRouter as Router, Routes, Route, Navigate, Outlet, useLocation } from 'react-router-dom';Remove line 21:
-import { useLocation } from 'react-router-dom';
-📝 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.
| import { useLocation } from 'react-router-dom'; | |
| import { BrowserRouter as Router, Routes, Route, Navigate, Outlet, useLocation } from 'react-router-dom'; |
🤖 Prompt for AI Agents
In frontend/src/App.tsx around line 21, there's a duplicate import from
'react-router-dom' for useLocation; remove the separate import on line 21 and
add useLocation to the existing import declaration at the top of the file (line
2) so all react-router-dom imports are consolidated into a single import
statement.
|
Thanks @Divine-P-77777, I'm sorry, but this isn't required, as it soon will be changed after merging a few other PRs. |
What changed
ProtectedLayoutto conditionally render the LandingPageuntil a repository is initialized
Why
Previously, switching routes before initializing a repository caused the
LandingPage to disappear with no way to re-initialize.
How it works
repoDataand current routeScreenshots / Demo
2025-12-27.23-12-05.mp4
Fixes #189
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.