Skip to content

Conversation

@speaker-ender
Copy link
Contributor

@speaker-ender speaker-ender commented Oct 24, 2025

Ticket ENG-1736

Description Of Changes

Fixing the UX interactions for bulk actions to properly handle multi-page selections and bulk deselections.
Adds enabling/disabling of actions for bulk actions based on BE response.

Code Changes

  • Adds a useBulkListSelect to handle selectable list logic where bulk actions are available
  • Adds request hook for getting allowed actions from the BE
  • Adds excluded urns to bulk action requests
  • Updates generated types for BE requests

Steps to Confirm

Multi-select
  1. Go to the new monitor field result screen
  2. Select multiple individual fields
  3. Navigate to a different page
  4. Select another field
  5. Confirm that the correct number of fields are selected
  6. Navigate back to the previous page
  7. Confirm that the number of selected fields is still correct
  8. Confirm that the correct actions are available based on the status of the selected items
  9. Confirm that when actions are selected, that the correct endpoint for multiple resources is called
  10. Change a search filter parameter
  11. Confirm that the selected items are reset
Bulk-Select
  1. Go to the new monitor field result screen
  2. Click the Select All checkbox
  3. Deselect multiple fields
  4. Confirm that the number of fields updates correctly
  5. Navigate to a different page
    6 Deselect another field
  6. Confirm that the correct number of fields are selected
  7. Navigate back to the previous page
  8. Confirm that the number of selected fields is still correct
  9. Open the actions dropdown and confirm that the correct actions are available based on the result of the backend response
  10. Confirm that when actions are selected, that the correct endpoint for bulk actions is called with the correct excluded resource values.

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated
    • Add a db-migration This indicates that a change includes a database migration label to the entry if your change includes a DB migration
    • Add a high-risk This issue suggests changes that have a high-probability of breaking existing code label to the entry if your change includes a high-risk change (i.e. potential for performance impact or unexpected regression) that should be flagged
    • Updates unreleased work already in Changelog, no new entry necessary
  • UX feedback:
    • All UX related changes have been reviewed by a designer
    • No UX review needed
  • Followup issues:
    • Followup issues created
    • No followup issues
  • Database migrations:
    • Ensure that your downrev is up to date with the latest revision on main
    • Ensure that your downgrade() migration is correct and works
      • If a downgrade migration is not possible for this change, please call this out in the PR description!
    • No migrations
  • Documentation:
    • Documentation complete, PR opened in fidesdocs
    • Documentation issue created in fidesdocs
    • If there are any new client scopes created as part of the pull request, remember to update public-facing documentation that references our scope registry
    • No documentation updates required

@vercel
Copy link

vercel bot commented Oct 24, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
fides-plus-nightly Ready Ready Preview Comment Oct 28, 2025 9:42pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
fides-privacy-center Ignored Ignored Oct 28, 2025 9:42pm

@speaker-ender speaker-ender force-pushed the refactor/bulk-action-select branch from 8fa6acc to 24eb283 Compare October 24, 2025 12:20
@speaker-ender speaker-ender force-pushed the refactor/bulk-action-select branch from 24eb283 to 5549871 Compare October 24, 2025 14:29
@speaker-ender speaker-ender force-pushed the refactor/bulk-action-select branch from 5549871 to 39f906d Compare October 24, 2025 14:40
@speaker-ender speaker-ender force-pushed the refactor/bulk-action-select branch from 39f906d to 09cef13 Compare October 24, 2025 16:40
@speaker-ender speaker-ender force-pushed the refactor/bulk-action-select branch from 09cef13 to 922d733 Compare October 27, 2025 19:01
@speaker-ender speaker-ender force-pushed the refactor/bulk-action-select branch from 67b04d6 to 2cb7e0c Compare October 27, 2025 19:47
@speaker-ender speaker-ender marked this pull request as ready for review October 27, 2025 19:59
@speaker-ender speaker-ender requested a review from a team as a code owner October 27, 2025 19:59
@speaker-ender speaker-ender requested review from gilluminate and removed request for a team October 27, 2025 19:59
@speaker-ender speaker-ender force-pushed the refactor/bulk-action-select branch from 2cb7e0c to 8e1d487 Compare October 27, 2025 19:59
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Greptile Summary

Refactors bulk selection UX to properly handle multi-page selections using an inclusive/exclusive mode pattern. When users select "all", the system switches to exclusive mode and tracks only deselected items, enabling bulk actions across all pages with excluded URNs sent to the backend.

Key changes:

  • New useBulkListSelect hook manages selection state with delta tracking for both inclusive (selected items) and exclusive (deselected items) modes
  • Backend integration updated to accept excluded_resource_urns in bulk action requests
  • New getAllowedActions endpoint dynamically determines available actions based on filtered results
  • Selection state properly resets when filters change

Issues found:

  • Mode state not reset in resetListSelect() causes incorrect behavior after clearing selections
  • Missing dependency in useEffect could cause stale closures
  • Inefficient O(n²) array filtering in inverseDelta calculation

Confidence Score: 3/5

  • Refactor has a logical bug in state reset that will cause incorrect selection behavior
  • Core functionality is well-designed with proper backend integration, but the resetListSelect function has a critical bug where it doesn't reset the mode state. This will cause incorrect behavior when users clear all selections and start selecting again - the system could remain in "exclusive" mode when it should be "inclusive", leading to inverted selection logic. The missing useEffect dependency could also cause subtle bugs with stale closures.
  • Pay close attention to useBulkListSelect.ts - the resetListSelect function needs to reset mode state

Important Files Changed

File Analysis

Filename Score Overview
clients/admin-ui/src/features/data-discovery-and-detection/action-center/fields/useBulkListSelect.ts 3/5 New hook for managing bulk list selection with inclusive/exclusive modes. Contains inefficient array filtering logic that could impact performance.
clients/admin-ui/src/features/data-discovery-and-detection/action-center/fields/page.tsx 4/5 Main page refactored to use new bulk selection hook, properly handles multi-page selection with excluded URNs. Mode reset correctly clears only delta state.
clients/admin-ui/src/features/data-discovery-and-detection/action-center/fields/useBulkActions.ts 5/5 Updated to accept excluded URNs parameter for bulk actions. Clean implementation with proper error handling.

8 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

Comment on lines 53 to 56
const resetListSelect = () => {
setDeltaState([]);
};
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: mode state not reset when clearing selections - causes incorrect behavior if user clears all selections then starts selecting again

Suggested change
const resetListSelect = () => {
setDeltaState([]);
};
const resetListSelect = () => {
setDeltaState([]);
setMode("inclusive");
};

Context Used: Rule from dashboard - Prefer readonly mapping objects over logic evaluations and mutable arrays when determining available... (source)

@gilluminate
Copy link
Contributor

Smoke testing in Vercel build seems to be working well. Left a few code improvement comments, but nothing too serious.

wip: lots more

chore: linting

fix: making linter happy

fix: selected field count

refactor: cleaning up some utils

chore: linting and minor bugs

feat: tray action integration

refactor: less action code

chore: adding toasts

refactor: minor updates and fixes

fix: typos

fix: linting

chore: updating utils

chore: fix extra toast messages

fix: add another missing return

refactor: use lodash

refactor: bullk action select

wip: multi select

wip: more wip

wip: continued

wip:more

more wip

chore: more wip

chore: rename file

wip: adding excluded and working towards clean linting

chore: linting fixes and comments

fix: mode escape hatch

wip stuff

chore: linting

refactor: simple bulk select

fix: using correct hook

wip: fixing switch logic

wip: refinements

wip: naming updates

refactor: naming cleanups

chore: linting

chore: remove old hook

wip: adding in dynamic allowed actions

chore: updating types

chore: continued wip

feat: dynamic allowed bulk actions

chore: minor bug

refactor: moving around logic

nit: removing extra space

fix: reset mode

refactor: requested changes

fix: proper labeling
Copy link
Contributor

@gilluminate gilluminate left a comment

Choose a reason for hiding this comment

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

Nice work! looks good

@speaker-ender speaker-ender added this pull request to the merge queue Oct 28, 2025
Merged via the queue into main with commit 1548064 Oct 28, 2025
46 checks passed
@speaker-ender speaker-ender deleted the refactor/bulk-action-select branch October 28, 2025 22:03
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.

3 participants