-
Notifications
You must be signed in to change notification settings - Fork 39
feat: Add inspectable pull requests to your profile #117
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
base: main
Are you sure you want to change the base?
Conversation
This feature enhances your profile page by adding a section to display and inspect individual pull requests associated with you. Key changes: 1. **New Data Type**: I defined `PullRequestData` in `src/lib/data/types.ts` for consistent PR representation. 2. **New Query Function**: I implemented `getUserPullRequests` in `src/app/profile/[username]/queries.ts` to fetch paginated and filterable pull requests (by status: OPEN, MERGED, CLOSED). 3. **Server Action**: I created `fetchUserPullRequestsAction` in `src/app/profile/[username]/actions.ts` to allow client components to fetch PR data. 4. **New UI Component**: I developed `PullRequestList.tsx` in `src/app/profile/[username]/components/`. This client component displays PRs with: * Tabs for filtering by status (ALL, OPEN, MERGED, CLOSED). * A list of PRs showing title (linked to GitHub), author, number, creation date, and status. * Pagination controls. 5. **Profile Page Update**: * I modified `src/app/profile/[username]/components/UserProfile.tsx` to include the `PullRequestList` component. * I updated `src/app/profile/[username]/page.tsx` to fetch the initial set of PRs and total count for the "ALL" filter to pass to `PullRequestList`. 6. **Testing**: * I added unit tests for `getUserPullRequests` in `src/app/profile/[username]/queries.test.ts`, covering various filtering and pagination scenarios. * I added component tests for `PullRequestList.tsx` in `src/app/profile/[username]/components/PullRequestList.test.tsx`, covering UI interactions, data fetching calls, and rendering. This provides you with a more detailed view of your contributions and activities related to pull requests directly on your profile page.
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
i approve
This feature enhances your profile page by adding a section to display and inspect individual pull requests associated with you.
Key changes:
PullRequestData
insrc/lib/data/types.ts
for consistent PR representation.getUserPullRequests
insrc/app/profile/[username]/queries.ts
to fetch paginated and filterable pull requests (by status: OPEN, MERGED, CLOSED).fetchUserPullRequestsAction
insrc/app/profile/[username]/actions.ts
to allow client components to fetch PR data.PullRequestList.tsx
insrc/app/profile/[username]/components/
. This client component displays PRs with:src/app/profile/[username]/components/UserProfile.tsx
to include thePullRequestList
component.src/app/profile/[username]/page.tsx
to fetch the initial set of PRs and total count for the "ALL" filter to pass toPullRequestList
.getUserPullRequests
insrc/app/profile/[username]/queries.test.ts
, covering various filtering and pagination scenarios.PullRequestList.tsx
insrc/app/profile/[username]/components/PullRequestList.test.tsx
, covering UI interactions, data fetching calls, and rendering.This provides you with a more detailed view of your contributions and activities related to pull requests directly on your profile page.