feat: add Join Community button to Contributors page#770
feat: add Join Community button to Contributors page#770GeethaBurigalla wants to merge 4 commits into
Conversation
|
CodeAnt AI is reviewing your PR. |
|
@GeethaBurigalla is attempting to deploy a commit to the Karan Mani Tripathi 's projects Team on Vercel. A member of the Team first needs to authorize it. |
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughAdds a ChangesDiscord Join Community CTA
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ 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.
Hello there! 🎉 Thank you so much for your first pull request to DoubtDesk!
We really appreciate your contribution. A maintainer will review your code soon. If you are participating in GSSoC, ensure your PR is linked to an open issue. Please make sure you have followed all rules in our Contributing Guidelines. Happy coding!
There was a problem hiding this comment.
⭐ Star Required
Hi @GeethaBurigalla! Thank you for your contribution to DoubtDesk.
Before we can complete the review and merge this pull request, please star the DoubtDesk repository.
Once you have starred the repository, please drop a comment here saying "done" and we will proceed with reviewing your PR. Thank you!
|
@coderabbitai review |
| export const DISCORD_INVITE_URL = | ||
| process.env.NEXT_PUBLIC_DISCORD_INVITE_URL ?? "https://discord.gg/doubtdesk"; No newline at end of file |
There was a problem hiding this comment.
Suggestion: The fallback logic only handles null/undefined; if NEXT_PUBLIC_DISCORD_INVITE_URL is set to an empty string, the Join Community link resolves to an empty href instead of the Discord default. Treat empty/whitespace-only values as invalid and fall back to the default invite URL so the CTA never becomes a broken link. [incorrect condition logic]
Severity Level: Major ⚠️
- ❌ Contributors CTA Discord link broken on empty env.
- ⚠️ Users can’t reach Discord from contributors CTA.Steps of Reproduction ✅
1. Set environment variable `NEXT_PUBLIC_DISCORD_INVITE_URL` to an empty string (e.g.,
`NEXT_PUBLIC_DISCORD_INVITE_URL=`) in `.env.local`, so at build time
`process.env.NEXT_PUBLIC_DISCORD_INVITE_URL` resolves to `""` in
`src/lib/constants.ts:5-6`.
2. Start the Next.js app; the constant `DISCORD_INVITE_URL` is computed in
`src/lib/constants.ts:5-6` using nullish coalescing, so the empty string is preserved
instead of falling back to `"https://discord.gg/doubtdesk"`.
3. In a browser, navigate to the Contributors page route implemented in
`src/app/contributors/page.tsx:52-218`, where the CTA section renders the `Join Community`
button using `<Link href={DISCORD_INVITE_URL}>` at lines `201-205`.
4. Inspect the rendered HTML or click the `Join Community` button and observe that the
anchor `href` is `""` (navigates to the current page) instead of the Discord invite URL,
meaning the CTA link is effectively broken when the env var is set to an empty string.(Use Cmd/Ctrl + Click for best experience)
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** src/lib/constants.ts
**Line:** 5:6
**Comment:**
*Incorrect Condition Logic: The fallback logic only handles `null`/`undefined`; if `NEXT_PUBLIC_DISCORD_INVITE_URL` is set to an empty string, the `Join Community` link resolves to an empty `href` instead of the Discord default. Treat empty/whitespace-only values as invalid and fall back to the default invite URL so the CTA never becomes a broken link.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix|
CodeAnt AI finished reviewing your PR. |
There was a problem hiding this comment.
🧹 Nitpick comments (3)
.env.example (1)
25-28: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueEnv var documentation looks good; minor key ordering nit.
Static analysis flags
NEXT_PUBLIC_DISCORD_INVITE_URLas out of alphabetical order relative toNEXT_PUBLIC_SITE_URL. Purely cosmetic, but worth tidying for consistency with the rest of the file.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.env.example around lines 25 - 28, The Discord invite env var entry is out of alphabetical order in the example env file. Move NEXT_PUBLIC_DISCORD_INVITE_URL so it is ordered consistently relative to NEXT_PUBLIC_SITE_URL, keeping the surrounding documentation comments intact and preserving the existing variable names.Source: Linters/SAST tools
src/app/contributors/page.tsx (2)
201-209: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winNew-tab link should announce its behavior to assistive tech.
The new Discord
Linkopens in a new tab (target="_blank") but has no accessible indication of this for screen reader users; the icon alone doesn't convey it. WCAG guidance (technique G200/H83) recommends surfacing this via visible text or a visually-hidden label.♿ Proposed fix
<Link href={DISCORD_INVITE_URL} target="_blank" rel="noopener noreferrer" className="inline-flex items-center gap-2 px-7 py-4 rounded-xl border border-blue-500/30 dark:border-cyan-400/30 bg-white/60 dark:bg-white/5 backdrop-blur-xl hover:scale-105 hover:border-blue-500/50 dark:hover:border-cyan-400/60 transition-all duration-300 font-semibold text-blue-700 dark:text-cyan-300" + aria-label="Join Community (opens in a new tab)" > <MessageCircle className="w-5 h-5" /> Join Community </Link>As per path instructions, review
**/*.tsxfiles for accessibility (aria labels, keyboard navigation).🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/app/contributors/page.tsx` around lines 201 - 209, The Discord Link in the contributors page opens a new tab but does not announce that behavior to assistive tech. Update the Link usage in the contributors page so the accessible name clearly indicates “opens in a new tab,” using the existing Link component and its surrounding content in the contributors page, either by adding visually hidden text or an equivalent accessible label.Source: Path instructions
197-208: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueCTA text is hardcoded rather than pulled from constants.
"Start Contributing"and"Join Community"are inline string literals in the JSX. Per path instructions for*.tsxfiles, prefer sourcing user-facing strings from constants for consistency/reuse across locales.As per path instructions, "
**/*.tsx: ... No hardcoded strings (use constants)".🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/app/contributors/page.tsx` around lines 197 - 208, The CTA labels in the contributors page are hardcoded JSX strings, so move the user-facing text for the Link buttons into shared constants and reference those values in the component. Update the relevant labels in the contributors page JSX (the Link elements around the Start Contributing and Join Community CTAs) to use constants instead of inline literals, keeping the strings centralized for reuse and consistency.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.env.example:
- Around line 25-28: The Discord invite env var entry is out of alphabetical
order in the example env file. Move NEXT_PUBLIC_DISCORD_INVITE_URL so it is
ordered consistently relative to NEXT_PUBLIC_SITE_URL, keeping the surrounding
documentation comments intact and preserving the existing variable names.
In `@src/app/contributors/page.tsx`:
- Around line 201-209: The Discord Link in the contributors page opens a new tab
but does not announce that behavior to assistive tech. Update the Link usage in
the contributors page so the accessible name clearly indicates “opens in a new
tab,” using the existing Link component and its surrounding content in the
contributors page, either by adding visually hidden text or an equivalent
accessible label.
- Around line 197-208: The CTA labels in the contributors page are hardcoded JSX
strings, so move the user-facing text for the Link buttons into shared constants
and reference those values in the component. Update the relevant labels in the
contributors page JSX (the Link elements around the Start Contributing and Join
Community CTAs) to use constants instead of inline literals, keeping the strings
centralized for reuse and consistency.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 65e9adb1-0d51-4f83-bc73-0534cabb124e
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (3)
.env.examplesrc/app/contributors/page.tsxsrc/lib/constants.ts
|
Done. |
|
Hi @knoxiboy — noticed the Vercel preview deployment is showing "Authorization required to deploy" and hasn't run. Could someone on the Vercel team authorize it so the preview can build? |
|
@GeethaBurigalla Resolve merge conflicts and look into ci test failures and try to fix it |
|
CodeAnt AI is running Incremental review |
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
CodeAnt AI Incremental review completed. |
|
Pulled in the main and sorted out the merge conflicts. |
User description
Closes #708
Adds a "Join Community" button next to "Start Contributing" on the Contributors page CTA section, linking to the project's Discord.
NEXT_PUBLIC_DISCORD_INVITE_URL(falls back to a placeholder) so maintainers can update it without a code changeNote: I couldn't find an official Discord invite link anywhere in the repo/README, so I used a placeholder (
https://discord.gg/doubtdesk). Please update the env var with the real invite once available — no code change needed.Screenshots
Summary by CodeRabbit
CodeAnt-AI Description
Add a Discord community button to the Contributors page
What Changed
Impact
✅ Easier access to the community Discord✅ Clearer contributor call to action✅ Consistent button layout on desktop and mobile💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.