Implement language selection and filter repositories #142#180
Conversation
Added a language selection button group and updated repository mapping to use filtered repositories.### Description This PR introduces a language filtering feature to the `ProfileView` component, allowing visitors to easily sort through a developer's repositories by their primary programming language. ### Changes Made - **State Management:** Added `useState` to track the `selectedLang` (defaults to `"All"`). - **Dynamic Tabs:** Extracted unique languages dynamically from the provided `repos` array to generate the filter tabs. - **UI Implementation:** Built a responsive, styled button group for the language tabs, utilizing the existing `LANG_COLORS` mapping for visual dot indicators. - **Repository Filtering:** Updated the main repository grid to map over `filteredRepos` instead of the raw `repos` array, updating instantaneously when a new language tab is clicked. ### Related Issue Resolves #[Insert Issue Number Here]
📝 WalkthroughWalkthrough
ChangesLanguage Filter for Popular Repositories
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related issues
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/profile/ProfileView.tsx`:
- Around line 339-372: The language filter buttons in the ProfileView component
are missing accessibility attributes for assistive technologies. Add the
aria-pressed attribute to the button element that maps through
availableLanguages, and set its value to a boolean expression that evaluates to
true when selectedLang equals the current lang being rendered, and false
otherwise. This will expose the selected state to screen readers so users can
identify which language filter is currently active.
- Around line 341-343: The button element in the language filter controls lacks
an explicit type attribute, which defaults to "submit" behavior and could
trigger accidental form submissions if nested in a form. Add `type="button"` to
the button element that contains the onClick handler for setSelectedLang to
explicitly prevent form submission behavior and ensure it only functions as a
clickable language filter control.
🪄 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: ASSERTIVE
Plan: Pro Plus
Run ID: b54e1d37-4d52-451b-8008-9f3c75cc3149
📒 Files selected for processing (1)
src/components/profile/ProfileView.tsx
|
@mspandey once again same build issue |
|
Hi @PRODHOSH! I have fixed the build issue by importing React, resolved all of the CodeRabbit accessibility comments, and updated the PR description. It should be good for another review! |
|
Hi, thanks @mspandey and the pr template we follow here is the below one pls check any doubts, ask in discord #34 |

Resolves #142
Description
Implemented language selection and repository filtering for the user profile page.
Changes Made:
ProfileView.tsx.aria-pressedandtype="button") and resolved React scope build warnings.