Skip to content

feat: add AI-powered contributor onboarding chatbot#2459

Open
jainiksha wants to merge 1 commit into
nisshchayarathi:mainfrom
jainiksha:feature/contributor-onboarding-chatbot
Open

feat: add AI-powered contributor onboarding chatbot#2459
jainiksha wants to merge 1 commit into
nisshchayarathi:mainfrom
jainiksha:feature/contributor-onboarding-chatbot

Conversation

@jainiksha

@jainiksha jainiksha commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Description

Added an AI-Powered Contributor Onboarding Chatbot to help new contributors understand repository structure, setup steps, and beginner-friendly contribution areas.

Changes:

  • Added ContributorOnboardingChatbot component.
  • Added AI-style onboarding assistant with interactive responses.
  • Included repository guidance, setup instructions, and contribution suggestions.
  • Integrated the chatbot into Repository Insights.

Related Issue

Closes #2429

Type of Change

  • New feature
  • UI/UX improvement

Testing

  • Verified the feature manually.

Checklist

  • Changes are focused on the linked issue.
  • Reviewed the code before submitting.

Summary by CodeRabbit

@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

@jainiksha is attempting to deploy a commit to the Nisshchaya's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the GSSoC'26 Part of GirlScript Summer of Code 2026 label Jun 22, 2026
@github-actions

Copy link
Copy Markdown

🎉 Thanks for your contribution, @jainiksha!

Your PR has passed our automated GSSoC quality checks. Here's a quick summary:

Check Status
PR description ✅ Provided
PR title ✅ Meaningful
Linked issue ✅ Found
Change size ✅ Looks good (124 lines across 2 file(s))

A maintainer will review your PR soon. Please be patient and available for feedback. 💪

GSSoC'26 automation · Maintainer: @nisshchayarathi

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

An error occurred during the review process. Please try again later.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown

🎉 Thanks for your contribution, @jainiksha!

Your PR has passed our automated GSSoC quality checks. Here's a quick summary:

Check Status
PR description ✅ Provided
PR title ✅ Meaningful
Linked issue ✅ Found
Change size ✅ Looks good (124 lines across 2 file(s))

A maintainer will review your PR soon. Please be patient and available for feedback. 💪

GSSoC'26 automation · Maintainer: @nisshchayarathi

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (2)
src/components/repository/ContributorOnboardingChatbot.tsx (2)

87-110: 🧹 Nitpick | 🔵 Trivial | 💤 Low value

Using array index as key in map.

While acceptable for static data that won't reorder, consider using a stable identifier if the botResponses array might become dynamic in the future.

Alternative approach
 const botResponses = [
   {
+    id: "repository-structure",
     icon: Folder,
     title: "Repository Structure",
     message:
       "Explore the src directory first, understand components, pages, and project architecture.",
   },
   {
+    id: "setup-guide",
     icon: Wrench,
     // ... rest
   },
   {
+    id: "beginner-contributions",
     icon: Code,
     // ... rest
   },
 ];

 // Then in the map:
-{botResponses.map((response, index) => {
+{botResponses.map((response) => {
   const Icon = response.icon;

   return (
     <div
-      key={index}
+      key={response.id}
       className="flex gap-4 rounded-lg border p-4"
     >
🤖 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/components/repository/ContributorOnboardingChatbot.tsx` around lines 87 -
110, The map function iterating over botResponses is using the array index as
the key parameter, which can cause issues if the array becomes dynamic or
reorders. Replace the key={index} with a stable identifier from the response
object itself. If the botResponses items have a unique identifier property such
as id or uuid, use that as the key instead. If no unique identifier exists on
the response objects, consider adding one to ensure proper React reconciliation
of list items during re-renders.

59-75: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Add accessibility attributes to the button.

The button lacks ARIA attributes to convey its dynamic state changes to screen reader users.

♿ Proposed accessibility improvements
         <button
           onClick={askAssistant}
           disabled={isThinking}
+          aria-busy={isThinking}
+          aria-label={isThinking ? "AI is thinking" : "Ask AI Assistant"}
           className="flex items-center gap-2 rounded-lg border px-4 py-2 text-sm font-medium hover:bg-muted transition"
         >
🤖 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/components/repository/ContributorOnboardingChatbot.tsx` around lines 59 -
75, The button element with onClick={askAssistant} is missing ARIA attributes
needed to communicate its dynamic state to screen reader users. Add the
aria-busy attribute set to the isThinking state value to indicate when the
button is in a loading/thinking state, and consider adding an aria-label
attribute to provide a descriptive label that remains consistent for screen
reader users regardless of the visual state changes.
🤖 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.

Inline comments:
In `@src/components/repository/ContributorOnboardingChatbot.tsx`:
- Around line 15-34: The component ContributorOnboardingChatbot is named and
presented as an AI-powered chatbot, but the botResponses array contains only
three static, hardcoded responses with no dynamic question-answering capability.
To resolve this mismatch, either rename the component and update all references
(including UI labels and messaging) to accurately reflect its static nature
(e.g., "ContributorOnboardingGuide" or "GettingStartedHelper"), or integrate an
actual AI service to process user queries dynamically and return
repository-specific responses. Whichever path is chosen, ensure the component
name, messaging, and actual functionality are aligned to match user
expectations.
- Line 7: The Send icon import is declared but not referenced anywhere in the
ContributorOnboardingChatbot component. Remove the Send import statement from
the import declarations to clean up unused dependencies.
- Around line 36-47: The ContributorOnboardingChatbot function component does
not accept any props, particularly a repository object that contains
project-specific information needed to provide contextual help about repository
structure and setup steps. Update the component signature to accept props with a
repository parameter, integrate this repository context into the chatbot logic
and state management, and then update the component usage in
RepositoryInsights.tsx to pass the repository object as a prop when rendering
ContributorOnboardingChatbot.
- Around line 59-75: The button in ContributorOnboardingChatbot.tsx remains
clickable after messages are displayed because the disabled state only checks
isThinking, not showMessages. Update the disabled attribute on the button
element to also include the showMessages state in the condition, so the button
is disabled whenever showMessages is true. This will prevent users from clicking
the button after the assistant has already responded, eliminating the confusing
behavior of a clickable button that does nothing.

In `@src/components/repository/RepositoryInsights.tsx`:
- Around line 278-280: The ContributorOnboardingChatbot component is being
rendered without the repository prop, even though it's available in the parent
RepositoryInsights component, which prevents it from providing
repository-specific onboarding guidance. Pass the repository prop to the
ContributorOnboardingChatbot component in RepositoryInsights.tsx where it is
currently being rendered, and then update the ContributorOnboardingChatbot
component signature in ContributorOnboardingChatbot.tsx to accept and utilize
the repository prop for context-aware functionality.

---

Nitpick comments:
In `@src/components/repository/ContributorOnboardingChatbot.tsx`:
- Around line 87-110: The map function iterating over botResponses is using the
array index as the key parameter, which can cause issues if the array becomes
dynamic or reorders. Replace the key={index} with a stable identifier from the
response object itself. If the botResponses items have a unique identifier
property such as id or uuid, use that as the key instead. If no unique
identifier exists on the response objects, consider adding one to ensure proper
React reconciliation of list items during re-renders.
- Around line 59-75: The button element with onClick={askAssistant} is missing
ARIA attributes needed to communicate its dynamic state to screen reader users.
Add the aria-busy attribute set to the isThinking state value to indicate when
the button is in a loading/thinking state, and consider adding an aria-label
attribute to provide a descriptive label that remains consistent for screen
reader users regardless of the visual state changes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3807d656-d5ce-4702-ba74-c56bb33bf66f

📥 Commits

Reviewing files that changed from the base of the PR and between cd4e69b and cdb29a9.

📒 Files selected for processing (2)
  • src/components/repository/ContributorOnboardingChatbot.tsx
  • src/components/repository/RepositoryInsights.tsx

import {
Bot,
User,
Send,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Remove unused import.

The Send icon is imported but never used in the component.

🧹 Proposed fix
 import {
   Bot,
   User,
-  Send,
   Loader2,
   Sparkles,
   Folder,
   Code,
   Wrench,
 } from "lucide-react";
📝 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.

Suggested change
Send,
import {
Bot,
User,
Loader2,
Sparkles,
Folder,
Code,
Wrench,
} from "lucide-react";
🤖 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/components/repository/ContributorOnboardingChatbot.tsx` at line 7, The
Send icon import is declared but not referenced anywhere in the
ContributorOnboardingChatbot component. Remove the Send import statement from
the import declarations to clean up unused dependencies.

Comment thread src/components/repository/ContributorOnboardingChatbot.tsx
Comment on lines +36 to +47
export default function ContributorOnboardingChatbot() {
const [isThinking, setIsThinking] = useState(false);
const [showMessages, setShowMessages] = useState(false);

const askAssistant = () => {
setIsThinking(true);

setTimeout(() => {
setIsThinking(false);
setShowMessages(true);
}, 1500);
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Component lacks repository context.

The component doesn't accept any props, particularly the repository object that could provide project-specific information (structure, setup instructions, file organization). Without this context, the chatbot cannot fulfill its stated purpose of helping contributors understand "repository structure, setup steps, and beginner-friendly contribution areas" specific to the actual project being viewed.

💡 Suggested signature change
-export default function ContributorOnboardingChatbot() {
+export default function ContributorOnboardingChatbot({
+  repository,
+}: {
+  repository: any; // Use proper Repository type from your codebase
+}) {
   const [isThinking, setIsThinking] = useState(false);
   const [showMessages, setShowMessages] = useState(false);

Then update the usage in RepositoryInsights.tsx:

-      <ContributorOnboardingChatbot />
+      <ContributorOnboardingChatbot repository={repository} />
📝 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.

Suggested change
export default function ContributorOnboardingChatbot() {
const [isThinking, setIsThinking] = useState(false);
const [showMessages, setShowMessages] = useState(false);
const askAssistant = () => {
setIsThinking(true);
setTimeout(() => {
setIsThinking(false);
setShowMessages(true);
}, 1500);
};
export default function ContributorOnboardingChatbot({
repository,
}: {
repository: any; // Use proper Repository type from your codebase
}) {
const [isThinking, setIsThinking] = useState(false);
const [showMessages, setShowMessages] = useState(false);
const askAssistant = () => {
setIsThinking(true);
setTimeout(() => {
setIsThinking(false);
setShowMessages(true);
}, 1500);
};
🤖 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/components/repository/ContributorOnboardingChatbot.tsx` around lines 36 -
47, The ContributorOnboardingChatbot function component does not accept any
props, particularly a repository object that contains project-specific
information needed to provide contextual help about repository structure and
setup steps. Update the component signature to accept props with a repository
parameter, integrate this repository context into the chatbot logic and state
management, and then update the component usage in RepositoryInsights.tsx to
pass the repository object as a prop when rendering
ContributorOnboardingChatbot.

Comment on lines +59 to +75
<button
onClick={askAssistant}
disabled={isThinking}
className="flex items-center gap-2 rounded-lg border px-4 py-2 text-sm font-medium hover:bg-muted transition"
>
{isThinking ? (
<>
<Loader2 className="h-4 w-4 animate-spin" />
Thinking...
</>
) : (
<>
<Sparkles className="h-4 w-4" />
Ask AI Assistant
</>
)}
</button>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Button remains enabled after messages are displayed.

Once showMessages is true, clicking the button again has no effect but provides no visual feedback. The button should either be hidden, permanently disabled, or implement re-trigger functionality with appropriate state reset.

🔧 Proposed fix to disable button after use
         <button
           onClick={askAssistant}
-          disabled={isThinking}
+          disabled={isThinking || showMessages}
           className="flex items-center gap-2 rounded-lg border px-4 py-2 text-sm font-medium hover:bg-muted transition"
         >

Alternatively, if you want to allow re-triggering, reset the state:

   const askAssistant = () => {
+    setShowMessages(false);
     setIsThinking(true);

     setTimeout(() => {
📝 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.

Suggested change
<button
onClick={askAssistant}
disabled={isThinking}
className="flex items-center gap-2 rounded-lg border px-4 py-2 text-sm font-medium hover:bg-muted transition"
>
{isThinking ? (
<>
<Loader2 className="h-4 w-4 animate-spin" />
Thinking...
</>
) : (
<>
<Sparkles className="h-4 w-4" />
Ask AI Assistant
</>
)}
</button>
<button
onClick={askAssistant}
disabled={isThinking || showMessages}
className="flex items-center gap-2 rounded-lg border px-4 py-2 text-sm font-medium hover:bg-muted transition"
>
{isThinking ? (
<>
<Loader2 className="h-4 w-4 animate-spin" />
Thinking...
</>
) : (
<>
<Sparkles className="h-4 w-4" />
Ask AI Assistant
</>
)}
</button>
🤖 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/components/repository/ContributorOnboardingChatbot.tsx` around lines 59 -
75, The button in ContributorOnboardingChatbot.tsx remains clickable after
messages are displayed because the disabled state only checks isThinking, not
showMessages. Update the disabled attribute on the button element to also
include the showMessages state in the condition, so the button is disabled
whenever showMessages is true. This will prevent users from clicking the button
after the assistant has already responded, eliminating the confusing behavior of
a clickable button that does nothing.

Comment on lines +278 to +280
{/* AI Contributor Onboarding Chatbot */}
<ContributorOnboardingChatbot />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Pass repository prop to enable context-aware guidance.

The ContributorOnboardingChatbot component is rendered without receiving the repository prop, even though it's available in the parent component. This prevents the chatbot from providing repository-specific onboarding guidance.

🔗 Proposed fix
       {/* AI Contributor Onboarding Chatbot */}
-      <ContributorOnboardingChatbot />
+      <ContributorOnboardingChatbot repository={repository} />

Note: This requires updating the component signature in ContributorOnboardingChatbot.tsx to accept the repository prop.

📝 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.

Suggested change
{/* AI Contributor Onboarding Chatbot */}
<ContributorOnboardingChatbot />
{/* AI Contributor Onboarding Chatbot */}
<ContributorOnboardingChatbot repository={repository} />
🤖 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/components/repository/RepositoryInsights.tsx` around lines 278 - 280, The
ContributorOnboardingChatbot component is being rendered without the repository
prop, even though it's available in the parent RepositoryInsights component,
which prevents it from providing repository-specific onboarding guidance. Pass
the repository prop to the ContributorOnboardingChatbot component in
RepositoryInsights.tsx where it is currently being rendered, and then update the
ContributorOnboardingChatbot component signature in
ContributorOnboardingChatbot.tsx to accept and utilize the repository prop for
context-aware functionality.

@github-actions

Copy link
Copy Markdown

🎉 Thanks for your contribution, @jainiksha!

Your PR has passed our automated GSSoC quality checks. Here's a quick summary:

Check Status
PR description ✅ Provided
PR title ✅ Meaningful
Linked issue ✅ Found
Change size ✅ Looks good (124 lines across 2 file(s))

A maintainer will review your PR soon. Please be patient and available for feedback. 💪

GSSoC'26 automation · Maintainer: @nisshchayarathi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GSSoC'26 Part of GirlScript Summer of Code 2026

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] AI-Powered Contributor Onboarding Chatbot

1 participant