-
-
Notifications
You must be signed in to change notification settings - Fork 88
feat: added profile visit functionality from projects and launches #164
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
feat: added profile visit functionality from projects and launches #164
Conversation
|
@Spandan-Mishra is attempting to deploy a commit to the ossdotnow Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThe rendering logic for project and launch cards was updated to wrap the project owner's avatar and name in a clickable link to their profile page if an owner ID exists. This enables navigation to user profiles directly from project and launch listings. Fallback UI for missing avatars remains unchanged. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ProjectCard
participant LaunchCard
participant Router
User->>ProjectCard: Clicks on owner avatar
alt ownerId exists
ProjectCard->>Router: Navigate to /profile/{ownerId}
else ownerId missing
ProjectCard-->>User: No navigation
end
User->>LaunchCard: Clicks on owner avatar or name
alt owner.id exists
LaunchCard->>Router: Navigate to /profile/{owner.id}
else owner.id missing
LaunchCard-->>User: No navigation
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
apps/web/app/(public)/launches/launch-card.tsxOops! Something went wrong! :( ESLint: 9.32.0 ESLint couldn't find an eslint.config.(js|mjs|cjs) file. From ESLint v9.0.0, the default configuration file is now eslint.config.js. https://eslint.org/docs/latest/use/configure/migration-guide If you still have problems after following the migration guide, please stop by Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
🧪 Generate unit tests
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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
apps/web/app/(public)/(projects)/projects/project-card.tsx (1)
42-66: Consider reducing code duplication in the avatar rendering logic.The implementation correctly adds profile navigation functionality, but the
Imagecomponent is duplicated between the linked and non-linked branches. This could be refactored for better maintainability.- project.ownerId ? ( - <Link - href={`/profile/${project.ownerId}`} - onClick={(e) => e.stopPropagation()} - className="z-10 shrink-0 rounded-none" - > - <Image - src={repo?.owner?.avatar_url || `https://gitlab.com${repo?.namespace?.avatar_url}`} - alt={project.name ?? 'Project Logo'} - width={256} - height={256} - className="h-[78px] w-[78px] rounded-none hover:opacity-80 transition-opacity" - loading="lazy" - /> - </Link> - ) : ( - <Image - src={repo?.owner?.avatar_url || `https://gitlab.com${repo?.namespace?.avatar_url}`} - alt={project.name ?? 'Project Logo'} - width={256} - height={256} - className="h-[78px] w-[78px] rounded-none" - loading="lazy" - /> - ) + (() => { + const avatarImage = ( + <Image + src={repo?.owner?.avatar_url || `https://gitlab.com${repo?.namespace?.avatar_url}`} + alt={project.name ?? 'Project Logo'} + width={256} + height={256} + className={`h-[78px] w-[78px] rounded-none ${ + project.ownerId ? 'hover:opacity-80 transition-opacity' : '' + }`} + loading="lazy" + /> + ); + + return project.ownerId ? ( + <Link + href={`/profile/${project.ownerId}`} + onClick={(e) => e.stopPropagation()} + className="z-10 shrink-0 rounded-none" + > + {avatarImage} + </Link> + ) : ( + avatarImage + ); + })()
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apps/web/app/(public)/(projects)/projects/project-card.tsx(1 hunks)apps/web/app/(public)/launches/launch-card.tsx(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
apps/web/app/(public)/launches/launch-card.tsx (2)
packages/db/src/schema/projects.ts (1)
project(16-64)packages/ui/src/components/link.tsx (1)
Link(17-44)
apps/web/app/(public)/(projects)/projects/project-card.tsx (2)
packages/db/src/schema/projects.ts (1)
project(16-64)packages/ui/src/components/link.tsx (1)
Link(17-44)
|
Good work @Spandan-Mishra |
|
@cursor run |
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.
Bugbot free trial expires on July 29, 2025
Learn more in the Cursor dashboard.
|
@Spandan-Mishra can you please check the comments from code-rabbit and cursor? |
|
Yeah sure I'll make the fixes. |
Description
Brief description of what this PR does:
Added the feature to visit the profile of a user from projects and launches page
Fixes #91
Type of Change
Testing
Checklist
Screenshots (if applicable)
Add any relevant screenshots here
Please ensure your PR title clearly describes the change.
Summary by CodeRabbit
New Features
Style