Add issue backlog filtering and sorting#471
Conversation
|
@MFA-G is attempting to deploy a commit to the ritik4ever's projects Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthrough
ChangesIssueBacklog Label Filtering and Sorting
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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.
Actionable comments posted: 1
🤖 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 `@frontend/src/components/IssueBacklog.tsx`:
- Around line 18-29: The component currently uses a single selectedLabel string
and a <select> UI, but the requirement is toggleable label chips supporting
multiple active labels (OR logic) and a Clear filters action; change
selectedLabel to a Set<string> (or string[] state) and update setSelectedLabel
usage to add/remove labels when chips are clicked (toggling membership), replace
the single-select UI with clickable chips generated from labels (the labels
constant) and a "Clear filters" button that resets the set to empty, and update
visibleIssues to filter by checking if an issue's labels intersect the active
label set (issue.labels.some(l => activeSet.has(l))) so any matching label
includes the issue; also update any code referencing selectedLabel (e.g., the
select block around setSelectedLabel) to handle the new collection type.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 23d71f8e-ccbb-4990-986c-626b9c6b6ed4
📒 Files selected for processing (2)
frontend/src/components/IssueBacklog.test.tsxfrontend/src/components/IssueBacklog.tsx
| const [selectedLabel, setSelectedLabel] = useState(""); | ||
| const [sortBy, setSortBy] = useState<SortOption>("points-desc"); | ||
|
|
||
| const labels = useMemo( | ||
| () => Array.from(new Set(issues.flatMap((issue) => issue.labels))).sort(), | ||
| [issues], | ||
| ); | ||
|
|
||
| const visibleIssues = useMemo(() => { | ||
| const filtered = selectedLabel | ||
| ? issues.filter((issue) => issue.labels.includes(selectedLabel)) | ||
| : issues; |
There was a problem hiding this comment.
Required multi-label chip filtering behavior is not implemented.
Line 18/Line 27-29 and Line 72-87 implement a single-label <select> filter, but the requirement calls for toggleable label chips with multiple active labels using OR logic, plus a Clear filters action. This currently misses the linked issue acceptance criteria.
Also applies to: 72-87
🤖 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 `@frontend/src/components/IssueBacklog.tsx` around lines 18 - 29, The component
currently uses a single selectedLabel string and a <select> UI, but the
requirement is toggleable label chips supporting multiple active labels (OR
logic) and a Clear filters action; change selectedLabel to a Set<string> (or
string[] state) and update setSelectedLabel usage to add/remove labels when
chips are clicked (toggling membership), replace the single-select UI with
clickable chips generated from labels (the labels constant) and a "Clear
filters" button that resets the set to empty, and update visibleIssues to filter
by checking if an issue's labels intersect the active label set
(issue.labels.some(l => activeSet.has(l))) so any matching label includes the
issue; also update any code referencing selectedLabel (e.g., the select block
around setSelectedLabel) to handle the new collection type.
Summary
Closes #461
Verification
Summary by CodeRabbit
New Features
Tests