Skip to content

Conversation

@speaker-ender
Copy link
Contributor

Ticket []

Description Of Changes

Reverting to old logic for classification logic.
Relying on indicator status for remove action.

Code Changes

  • Tree node disabled action is no longer async and can be determined via node props

Steps to Confirm

  1. Go to a monitor tree view screen
  2. Confirm that the logic to classify an element in the tree is reverted to it's old behavior
  3. Confirm that only tree elements marked for removal can be 'removed'

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 Dec 3, 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 Dec 3, 2025 10:26pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
fides-privacy-center Ignored Ignored Dec 3, 2025 10:26pm

Copy link
Contributor

@adamsachs adamsachs left a comment

Choose a reason for hiding this comment

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

tested and looks good to me. we know there are some UX gaps that are still lingering, but i think this is the better approach for now, until we can revisit this a bit more holistically.

all non-database resources in the tree can be classified (and the BE handles classifying the right things), and only 'removal' tree elements can be removed 👍

},
});
disabled: (node) => {
/** Logic for this should exist on the BE */
Copy link
Contributor

Choose a reason for hiding this comment

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

nice, good to callout here that there's a gap lingering, and we're just papering over it...

@speaker-ender speaker-ender marked this pull request as ready for review December 3, 2025 21:17
@speaker-ender speaker-ender requested a review from a team as a code owner December 3, 2025 21:17
@speaker-ender speaker-ender requested review from gilluminate and removed request for a team December 3, 2025 21:17
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 3, 2025

Greptile Overview

Greptile Summary

Reverts tree node action availability from async API-based checks to synchronous local property checks.

  • MonitorTreeDataTitle.tsx: Removed async onOpenChange handler and availableActions state; disabled is now called synchronously from node props
  • page.tsx: Replaced allowedTreeActionsTrigger API calls with local logic checking node.status and node.classifyable properties
  • types.d.ts: Updated TreeNodeAction.disabled from optional async function to required synchronous function
  • useFieldActions.tsx: Added condition to skip tree refresh for PROMOTE_REMOVALS action (with note that cache invalidation should handle this)

Confidence Score: 4/5

  • This PR is safe to merge with low risk - it simplifies the action availability logic by removing async API calls in favor of local property checks.
  • The changes are focused on simplifying the action availability determination from async API calls to synchronous local checks. The logic is straightforward and the comment acknowledges this as a deliberate revert to older behavior. Minor code duplication exists but doesn't affect correctness.
  • No files require special attention.

Important Files Changed

File Analysis

Filename Score Overview
clients/admin-ui/src/features/data-discovery-and-detection/action-center/fields/MonitorTreeDataTitle.tsx 5/5 Removed async action availability logic; now uses synchronous disabled(node) from props. Clean simplification with no issues.
clients/admin-ui/src/features/data-discovery-and-detection/action-center/fields/page.tsx 4/5 Reverted from async API-based action availability check to synchronous local check using node properties (status/classifyable). Removed unused allowedTreeActionsTrigger hook.
clients/admin-ui/src/features/data-discovery-and-detection/action-center/fields/types.d.ts 5/5 Changed disabled property from optional async function to required synchronous function. Type correctly reflects the new implementation.
clients/admin-ui/src/features/data-discovery-and-detection/action-center/fields/useFieldActions.tsx 4/5 Added condition to skip tree refresh for PROMOTE_REMOVALS action. Comment indicates cache invalidation should handle this instead.

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.

4 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines +300 to +287
disabled: (node) => {
/** Logic for this should exist on the BE */
if (
(action === FieldActionType.PROMOTE_REMOVALS &&
node.status ===
TreeResourceChangeIndicator.REMOVAL) ||
(action === FieldActionType.CLASSIFY &&
node.classifyable)
) {
return false;
}

return !result.data?.allowed_actions.includes(action);
return true;
Copy link
Contributor

Choose a reason for hiding this comment

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

style: The synchronous disabled logic is duplicated in two places: here (for RESOURCE_ACTIONS in MonitorTree) and the identical block starting at line 300. Consider extracting this into a shared helper function to reduce duplication and ensure consistency.

@speaker-ender speaker-ender force-pushed the refactor/tree-actionability branch from f79e6fe to 8e2e3b1 Compare December 3, 2025 21:40
@speaker-ender speaker-ender added this pull request to the merge queue Dec 3, 2025
Merged via the queue into main with commit a0cc71d Dec 3, 2025
47 checks passed
@speaker-ender speaker-ender deleted the refactor/tree-actionability branch December 3, 2025 22:47
jjdaurora pushed a commit that referenced this pull request Dec 5, 2025
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.

4 participants