Conversation
📝 WalkthroughWalkthroughA new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
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 Tip CodeRabbit can use Trivy to scan for security misconfigurations and secrets in Infrastructure as Code files.Add a .trivyignore file to your project to customize which findings Trivy reports. |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/modules/peers/PeersTable.tsx (1)
463-479:⚠️ Potential issue | 🟠 MajorMissing
group_namesfilter preservation in Pending Approvals handler.The Pending Approvals button handler preserves
has_userbut no longer preserves thegroup_namesfilter. This is inconsistent with the All/Online/Offline handlers which preserve both filters. Clicking "Pending Approvals" will unexpectedly clear any active group filter.🐛 Proposed fix to preserve group_names filter
let hasUserFilter = table .getColumn("has_user") ?.getFilterValue(); + let groupFilters = table + .getColumn("group_names") + ?.getFilterValue(); table.setColumnFilters([ { id: "connected", value: undefined, }, { id: "approval_required", value: current, }, + { + id: "group_names", + value: groupFilters ?? [], + }, { id: "has_user", value: hasUserFilter, }, ]);🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/modules/peers/PeersTable.tsx` around lines 463 - 479, The Pending Approvals handler is preserving has_user but not the group_names filter, causing active group filters to be cleared; capture the current group_names filter (e.g., const groupNamesFilter = table.getColumn("group_names")?.getFilterValue()) in the same way hasUserFilter is captured and include it in the table.setColumnFilters call (add { id: "group_names", value: groupNamesFilter }) so Pending Approvals preserves the group filter like the All/Online/Offline handlers.
🧹 Nitpick comments (1)
src/modules/peers/PeersTable.tsx (1)
336-493: Consider extracting filter update logic to reduce duplication.The All/Online/Offline/Pending Approvals buttons share a common pattern of preserving
group_namesandhas_userfilters while modifyingconnected/approval_required. A helper function could reduce repetition:const updateFilters = ( table: Table<Peer>, connected: boolean | undefined, approvalRequired: boolean | undefined, ) => { const groupFilters = table.getColumn("group_names")?.getFilterValue(); const hasUserFilter = table.getColumn("has_user")?.getFilterValue(); table.setPageIndex(0); table.setColumnFilters([ { id: "connected", value: connected }, { id: "approval_required", value: approvalRequired }, { id: "group_names", value: groupFilters ?? [] }, { id: "has_user", value: hasUserFilter }, ]); resetSelectedRows(); };🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/modules/peers/PeersTable.tsx` around lines 336 - 493, The button click handlers duplicate the same filter-preserving logic; extract a helper (e.g., updateFilters) that accepts the Table<Peer> instance and the desired connected and approval_required values, reads group_names and has_user via table.getColumn(...).getFilterValue(), calls table.setPageIndex(0), calls table.setColumnFilters([...]) with the preserved filters and the passed connected/approval_required, then calls resetSelectedRows(); replace each inline handler in the All/Online/Offline/Pending Approvals ButtonGroup.Button and Button to call this helper with the appropriate connected/approval_required arguments.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@src/modules/peers/PeersTable.tsx`:
- Around line 463-479: The Pending Approvals handler is preserving has_user but
not the group_names filter, causing active group filters to be cleared; capture
the current group_names filter (e.g., const groupNamesFilter =
table.getColumn("group_names")?.getFilterValue()) in the same way hasUserFilter
is captured and include it in the table.setColumnFilters call (add { id:
"group_names", value: groupNamesFilter }) so Pending Approvals preserves the
group filter like the All/Online/Offline handlers.
---
Nitpick comments:
In `@src/modules/peers/PeersTable.tsx`:
- Around line 336-493: The button click handlers duplicate the same
filter-preserving logic; extract a helper (e.g., updateFilters) that accepts the
Table<Peer> instance and the desired connected and approval_required values,
reads group_names and has_user via table.getColumn(...).getFilterValue(), calls
table.setPageIndex(0), calls table.setColumnFilters([...]) with the preserved
filters and the passed connected/approval_required, then calls
resetSelectedRows(); replace each inline handler in the
All/Online/Offline/Pending Approvals ButtonGroup.Button and Button to call this
helper with the appropriate connected/approval_required arguments.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 313c8e18-8182-4046-9115-18903db50f23
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (1)
src/modules/peers/PeersTable.tsx
Screen.Recording.2026-03-20.at.15.27.36.mov
Summary by CodeRabbit
Release Notes