Skip to content

Add bulk deletion for Access Control groups - #752

Merged
TechHutTV merged 4 commits into
mainfrom
feat/groups-bulk-delete
Aug 27, 2026
Merged

Add bulk deletion for Access Control groups#752
TechHutTV merged 4 commits into
mainfrom
feat/groups-bulk-delete

Conversation

@TechHutTV

@TechHutTV TechHutTV commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Description

Adds page-scoped group selection and bulk deletion to the Access Control Groups page, following the existing Peers page interaction pattern.

Screenshot 2026-08-10 at 9 00 38 PM

Changes

  • Add row checkboxes and current-page select-all behavior.
  • Restrict selection to groups that can be deleted and explain disabled rows.
  • Add a confirmation dialog, deletion notifications, and partial-failure handling.
  • Refresh group data and clear selection after batch operations.
  • Clear selected groups when search or table filters change.
  • Extend the shared table and multi-select popup for row eligibility and custom icons.
  • Improve fallback row ID handling for records without string IDs.

Issue ticket number and link

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

Summary by CodeRabbit

  • New Features

    • Added multi-select group deletion with confirmation and success or partial-failure notifications.
    • Added group-row selection with permission and usage-based safeguards.
    • Added configurable row selection and selection reset behavior to data tables.
    • Added support for custom icons in multi-select popups.
  • Bug Fixes

    • Improved handling of missing or invalid row identifiers.
    • Clarified why groups cannot be deleted, including the required “All” group.
    • Improved indeterminate checkbox visuals.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ca790671-4233-4327-b7c1-f4733b6e98e1

📥 Commits

Reviewing files that changed from the base of the PR and between c459763 and c46ceb0.

📒 Files selected for processing (1)
  • src/components/Checkbox.tsx

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The PR adds safe row-ID handling and configurable row selection to DataTable. It adds deletion-state helpers, selectable group rows, indeterminate checkbox rendering, and a confirmation popup for concurrent multi-group deletion.

Changes

Group deletion and table selection

Layer / File(s) Summary
Table selection foundation
src/components/table/DataTable.tsx
DataTable now uses fallback row IDs, supports boolean or predicate-based row selection, and can clear selection after filter changes.
Group deletion rules
src/interfaces/Group.ts, src/modules/groups/useGroupsUsage.tsx
Shared helpers identify group usage and return deletion-disabled reasons for protected, integration, or used groups.
Group table selection
src/modules/groups/table/GroupsTable.tsx, src/components/Checkbox.tsx
The group table adds permission-aware row selection, disabled-selection tooltips, selection cleanup, indeterminate checkbox rendering, and filter reset handling.
Multi-group deletion
src/modules/groups/GroupsMultiSelect.tsx, src/components/table/DataTableMultiSelectPopup.tsx
The deletion popup confirms and performs concurrent group deletion, refreshes group data, reports complete or partial failures, and accepts a custom icon.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: ⚪ Minimal · up to c46ce

The PR adds page-scoped group selection and bulk deletion with confirmation, notifications, partial-failure handling, and selection reset behavior; no actionable merge-blocking risk remains beyond normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant GroupsTable
  participant GroupsMultiSelect
  participant GroupDeletionAPI
  participant GroupDataCache
  GroupsTable->>GroupsMultiSelect: submit selected deletable groups
  GroupsMultiSelect->>GroupsMultiSelect: confirm destructive action
  GroupsMultiSelect->>GroupDeletionAPI: delete groups concurrently
  GroupDeletionAPI-->>GroupsMultiSelect: return deletion results
  GroupsMultiSelect->>GroupDataCache: refresh group data
  GroupsMultiSelect-->>GroupsTable: report result and clear selection
Loading

Poem

A rabbit selects rows in a neat little line,
Then clears them before deletes intertwine.
Groups vanish together, results come in view,
Protected ones stay where they grew.
“All” keeps its place, safe and sound—
While fresh table IDs hop around.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 5 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: bulk deletion for Access Control groups.
Description check ✅ Passed The description explains the feature, lists the main changes, includes an image, and selects that documentation is not needed. The issue ticket link is empty, and the documentation exemption has no ex…
Full details: Description check

Explanation

The description explains the feature, lists the main changes, includes an image, and selects that documentation is not needed. The issue ticket link is empty, and the documentation exemption has no explanation, but the description is otherwise mostly complete.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
⚔️ Resolve merge conflicts 💡
  • Resolve merge conflict in branch feat/groups-bulk-delete
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/groups-bulk-delete

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.

@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: 2

🧹 Nitpick comments (1)
src/modules/groups/GroupsMultiSelect.tsx (1)

47-55: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Consider limiting deletion concurrency.

Promise.allSettled starts one DELETE request per selected group at the same time. Selection persists across pages, so the batch can grow large. A large batch sends many parallel requests to the API and can trigger rate limiting. A small concurrency pool, for example 5 requests at a time, keeps the batch predictable while preserving the per-group result order that results.forEach depends on.

🤖 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/modules/groups/GroupsMultiSelect.tsx` around lines 47 - 55, Limit the
DELETE requests initiated by the Promise.allSettled flow in GroupsMultiSelect to
a small concurrency pool, such as five active requests at a time, while
preserving the original groupsToDelete order in the resulting per-group statuses
so the existing results.forEach handling remains correct.
🤖 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/modules/groups/table/GroupsTable.tsx`:
- Around line 417-421: Update the columnVisibility.select value in GroupsTable
to explicitly coerce permission.groups.delete to a boolean, matching the
existing handling near the table configuration and ensuring undefined
permissions hide the selection column.
- Around line 50-59: Update the page-selection checkbox in the GroupsTable
header to pass an indeterminate state when table.getIsSomePageRowsSelected() is
true, and ensure Checkbox renders a distinct non-check indicator for that state
instead of <Check />. Preserve getIsAllPageRowsSelected() for the checked state
and the existing selectable-row disabled logic.

---

Nitpick comments:
In `@src/modules/groups/GroupsMultiSelect.tsx`:
- Around line 47-55: Limit the DELETE requests initiated by the
Promise.allSettled flow in GroupsMultiSelect to a small concurrency pool, such
as five active requests at a time, while preserving the original groupsToDelete
order in the resulting per-group statuses so the existing results.forEach
handling remains correct.
🪄 Autofix

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: 268cd5ab-633f-43e5-83e5-f710bd5af2ff

📥 Commits

Reviewing files that changed from the base of the PR and between 0caf754 and 55b9744.

📒 Files selected for processing (6)
  • src/components/table/DataTable.tsx
  • src/components/table/DataTableMultiSelectPopup.tsx
  • src/interfaces/Group.ts
  • src/modules/groups/GroupsMultiSelect.tsx
  • src/modules/groups/table/GroupsTable.tsx
  • src/modules/groups/useGroupsUsage.tsx

Comment thread src/modules/groups/table/GroupsTable.tsx
Comment thread src/modules/groups/table/GroupsTable.tsx
Comment thread src/components/table/DataTable.tsx
Comment thread src/components/Checkbox.tsx
@TechHutTV
TechHutTV force-pushed the feat/groups-bulk-delete branch from d3c0841 to b78a95b Compare August 27, 2026 14:02
@TechHutTV
TechHutTV requested a review from heisbrot August 27, 2026 14:22
@TechHutTV
TechHutTV merged commit 4f905a4 into main Aug 27, 2026
9 checks passed
@TechHutTV
TechHutTV deleted the feat/groups-bulk-delete branch August 27, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants