-
Notifications
You must be signed in to change notification settings - Fork 95
Ishtiyaque Alam- landing page UI fix #188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ishtiyaque Alam- landing page UI fix #188
Conversation
…sistent untill user analyzes a repositories
WalkthroughPropagate an optional Changes
Sequence Diagram(s)mermaid Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
frontend/src/components/pages/AnalyticsPage.tsx (1)
41-113: Analytics data is hardcoded and not derived from repository data.All the analytics cards, charts, and visualizations use placeholder/mock data (analyticsCards, areaData, lineData, radarData, pieData) rather than actual repository statistics from
repoData. This means the Analytics page displays static data regardless of which repository is analyzed.Would you like me to help generate code that derives analytics from the actual
repoDataobject, or should this be tracked as a separate issue for future implementation?frontend/src/App.tsx (1)
22-38: RepositoryData interface is incomplete.The
RepositoryDatainterface doesn't includepull_requestsorcontributorsfields that are accessed in Dashboard.tsx (line 46, 52), ContributorsPage.tsx (line 18), AnalyticsPage.tsx (line 126), and PullRequestsPage.tsx (line 28). This creates a type mismatch.interface RepositoryData { id: string; name: string; full_name: string; description?: string; html_url: string; stargazers_count: number; forks_count: number; language?: string; created_at: string; updated_at: string; owner: { login: string; avatar_url: string; }; + contributors?: Array<{ + login: string; + avatar_url: string; + contributions: number; + }>; + pull_requests?: { + open?: number; + details: Array<{ + number: number; + title: string; + author: { + login: string; + avatar_url: string; + profile_url: string; + }; + state: string; + url: string; + comments?: number; + created_at?: string; + }>; + }; }
🧹 Nitpick comments (3)
frontend/src/components/pages/AnalyticsPage.tsx (1)
118-119: Use proper TypeScript types instead ofany.The
repoDataprop is typed asany, which defeats TypeScript's type safety. Consider defining a proper interface or type for repository data.+interface RepositoryData { + pull_requests?: { + details: any[]; + open?: number; + }; + contributors?: any[]; + // ... other fields +} + interface Props { - repoData: any; + repoData: RepositoryData | null; setRepoData?: (data: any) => void; }frontend/src/components/dashboard/Dashboard.tsx (1)
9-12: Use proper TypeScript types instead ofany.Similar to other pages,
repoDatashould have a proper type definition.frontend/src/components/contributors/ContributorsPage.tsx (1)
7-10: Use proper TypeScript types instead ofany.Consider defining a proper interface for
repoDatato improve type safety.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
frontend/src/App.tsx(1 hunks)frontend/src/components/contributors/ContributorsPage.tsx(2 hunks)frontend/src/components/dashboard/Dashboard.tsx(1 hunks)frontend/src/components/landing/LandingPage.tsx(2 hunks)frontend/src/components/pages/AnalyticsPage.tsx(3 hunks)frontend/src/components/pages/PullRequestsPage.tsx(2 hunks)
🔇 Additional comments (3)
frontend/src/components/landing/LandingPage.tsx (1)
13-13: Consider using nullish coalescing for consistency.The safeSetRepoData fallback is correctly implemented, but using the nullish coalescing operator (
??) is more idiomatic for this pattern.frontend/src/components/pages/PullRequestsPage.tsx (1)
5-22: Good use of TypeScript interfaces.This file demonstrates better type safety with the
PullRequestinterface and a more specific type for thePropsinterface. This pattern should be applied consistently across other pages.frontend/src/App.tsx (1)
163-168: setRepoData propagation looks correct.The propagation of
setRepoDatato all protected routes is implemented consistently and allows child components to update the parent state.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (4)
frontend/src/components/contributors/ContributorsPage.tsx (1)
31-33: Past review comment addressed - implementation looks good.The required
messageprop is now correctly provided to LandingPage, resolving the previous critical issue. The fallback pattern forsetRepoDatais appropriate given the optional prop.frontend/src/components/dashboard/Dashboard.tsx (1)
15-17: Past review comment addressed - LGTM.The
messageprop is now correctly provided, resolving the previous critical issue. The implementation is clean and consistent with other pages.frontend/src/components/pages/AnalyticsPage.tsx (1)
123-125: Past review comment addressed - implementation correct.The
messageprop is now provided to LandingPage, resolving the previous critical issue.frontend/src/components/pages/PullRequestsPage.tsx (1)
25-27: Past review comment addressed - implementation correct.The
messageprop is now properly provided to LandingPage, resolving the previous critical issue.
🧹 Nitpick comments (4)
frontend/src/components/contributors/ContributorsPage.tsx (1)
9-9: Consider replacinganywith a proper interface.For better type safety, consider defining an interface for the repository data structure instead of using
any.Example:
interface RepositoryData { contributors?: Array<{ login: string; avatar_url: string; contributions: number; }>; // ... other fields } interface Props { repoData: RepositoryData | null; setRepoData?: (data: RepositoryData | null) => void; }frontend/src/components/dashboard/Dashboard.tsx (1)
11-11: Consider replacinganywith a typed interface.For improved type safety and better IDE support, define an interface for the repository data structure.
frontend/src/components/pages/AnalyticsPage.tsx (1)
118-119: Consider stronger typing for repository data.Replace
anywith a proper interface to improve type safety and catch potential data structure issues at compile time.frontend/src/components/pages/PullRequestsPage.tsx (1)
21-21: Consider aligning setRepoData type with repoData interface.The
repoDataprop has a specific interface, butsetRepoDataacceptsany. Consider matching the types for consistency.- setRepoData?: (data: any) => void; + setRepoData?: (data: { pull_requests: { details: PullRequest[] } } | null) => void;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
frontend/src/components/contributors/ContributorsPage.tsx(2 hunks)frontend/src/components/dashboard/Dashboard.tsx(1 hunks)frontend/src/components/landing/LandingPage.tsx(3 hunks)frontend/src/components/pages/AnalyticsPage.tsx(3 hunks)frontend/src/components/pages/PullRequestsPage.tsx(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- frontend/src/components/landing/LandingPage.tsx
🔇 Additional comments (2)
frontend/src/components/pages/AnalyticsPage.tsx (1)
126-133: Dual-condition handling provides specific user feedback.The separate check for missing
pull_requestsdata provides more granular feedback when repository data exists but PR-specific data is unavailable. This is appropriate for the analytics context.frontend/src/components/pages/PullRequestsPage.tsx (1)
28-30: Dual-condition handling appropriate for PR-specific context.The separate check for missing
pull_requestsprovides targeted feedback when repository data exists but lacks PR information. This aligns with the page's purpose.
|
I don't think this is very essential as of now, as it'll be removed/changed once I merge the PR that enables Analyze Repository functionality. |
Closes # 189
📝 Description
The LandingPage would disappear initially when switching between pages, and there is no option for the user to analyze their repository.
Also, when switching between pages, an "uninitialized" message appears, but there is no option to go back and index the repository.
I changed the properties of the LandingPage props so that, unless the data is available, the page displays the landingPage instead of just showing a simple message.
Please look at the video shown
🔧 Changes Made
Files changed
LandingPage.tsx props
PullRequest.tsx
App.tsx
Contribution.tsx
Analytics.tsx
Dashboard.tsx
📷 Screenshots or Visual Changes (if applicable)
Before
https://github.com/user-attachments/assets/6afe0652-d1f0-4989-bd50-1ece538a9b51
After
https://github.com/user-attachments/assets/731bfa8d-8d7e-423c-b41e-f1405796c7bf
🤝 Collaboration
✅ Checklist
Summary by CodeRabbit
Bug Fixes
Refactor
New Features
✏️ Tip: You can customize this high-level summary in your review settings.