Skip to content

ENG-180: Migrate Chakra UI Menu components to Ant Design Dropdown/Popover#7681

Merged
gilluminate merged 12 commits intomainfrom
gill/ENG-180/migrate-popup-menu-to-ant-dropdown
Mar 18, 2026
Merged

ENG-180: Migrate Chakra UI Menu components to Ant Design Dropdown/Popover#7681
gilluminate merged 12 commits intomainfrom
gill/ENG-180/migrate-popup-menu-to-ant-dropdown

Conversation

@gilluminate
Copy link
Contributor

@gilluminate gilluminate commented Mar 17, 2026

Ticket ENG-180

Description Of Changes

Migrate all Chakra UI Menu/MenuButton/MenuList/MenuItem usage in admin-ui to Ant Design Dropdown (for action menus) and Popover (for custom content dropdowns like search/filter panels). This is part of the ongoing Chakra-to-Ant migration effort.

Key changes:

  • Create CustomDropdown wrapper in fidesui that defaults trigger to ["click"] (Ant defaults to hover)
  • Simple action menus use Dropdown with menu={{ items }} pattern
  • Complex content dropdowns (searchable lists, checkbox trees) use Popover with controlled open/onOpenChange state
  • Dead code removed: VendorSelect.tsx (278 lines, superseded by VendorSelector.tsx), ToggleDictSuggestions.tsx (84 lines, unused)
  • Unused fidesui components removed: ColumnDropdown, DataCategoryDropdown (admin-ui has its own copies)
  • Cypress tests updated to use selectAntDropdownOption and simplified selectors (no more [role="menuitem"])

30 files changed, +450 / -1135 lines (net -685 lines)

Code Changes

  • clients/fidesui/src/hoc/CustomDropdown.tsx - New wrapper defaulting Ant Dropdown trigger to click
  • clients/fidesui/src/index.ts - Export CustomDropdown as Dropdown, remove unused component exports
  • clients/fidesui/src/components/chakra-base/column-dropdown/ - Deleted (unused)
  • clients/fidesui/src/components/chakra-base/data-category-dropdown/ - Deleted (unused)
  • clients/fidesui/src/components/chakra-base/systems-checkbox-table/SystemsCheckboxTable.tsx - Inline ColumnMetadata type
  • clients/admin-ui/src/features/data-catalog/staged-resources/CatalogResourceOverflowMenu.tsx - Menu to Dropdown
  • clients/admin-ui/src/features/data-catalog/systems/SystemActionCell.tsx - Menu to Dropdown
  • clients/admin-ui/src/features/data-catalog/datasets/useCatalogDatasetColumns.tsx - Menu to Dropdown
  • clients/admin-ui/src/features/system/VendorSelector.tsx - CompassButton Menu to Dropdown
  • clients/admin-ui/src/features/system/VendorSelect.tsx - Deleted (dead code)
  • clients/admin-ui/src/features/system/dictionary-form/ToggleDictSuggestions.tsx - Deleted (unused)
  • clients/admin-ui/src/features/common/custom-reports/CustomReportTemplates.tsx - Chakra icon to Carbon icon
  • clients/admin-ui/src/features/datamap/reporting/DatamapReportTable.tsx - Group-by menu and More menu to Dropdown
  • clients/admin-ui/src/features/datastore-connections/DeleteConnectionModal.tsx - Remove dead MenuItem code path
  • clients/admin-ui/src/features/datastore-connections/DisableConnectionModal.tsx - Remove dead MenuItem code path
  • clients/admin-ui/src/features/dataset/DataCategoryDropdown.tsx - Menu to Popover
  • clients/admin-ui/src/features/common/ColumnDropdown.tsx - Menu to Popover
  • clients/admin-ui/src/features/datastore-connections/system_portal_config/ConnectionListDropdown.tsx - Menu to Popover
  • clients/admin-ui/cypress/e2e/data-catalog.cy.ts - Update selectors for Dropdown
  • clients/admin-ui/cypress/e2e/datamap-report.cy.ts - Update selectors for Dropdown
  • clients/admin-ui/cypress/e2e/system-integrations.cy.ts - Update selectors for Popover
  • clients/admin-ui/cypress/e2e/system-integrations-plus.cy.ts - Update selectors for Popover
  • clients/admin-ui/cypress/support/ant-support.ts - Add getAntDropdownOverlay helper

Steps to Confirm

  1. Navigate to Data Map > Report. Verify "Group by" dropdown opens on click, shows check icon next to selected option, and switches grouping. Verify "More" menu opens and "Edit columns"/"Rename columns" work.
  2. Navigate to Data Inventory > Systems. Click a system row's overflow menu (three dots). Verify "View details" opens the detail drawer.
  3. Navigate to a system's Integrations tab. Verify the connection type dropdown opens, search works, and selecting an integration populates the form.
  4. Navigate to a system's Integrations tab with an existing integration. Verify the "Data categories" dropdown opens with checkbox tree, Clear/Done buttons work.
  5. Navigate to Data Map > Report. Click "More" > "Edit columns". Verify the column dropdown opens with checkboxes, Clear/Done buttons work.

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:
    • No migrations
  • Documentation:
    • No documentation updates required

@vercel
Copy link
Contributor

vercel bot commented Mar 17, 2026

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

Project Deployment Actions Updated (UTC)
fides-plus-nightly Ready Ready Preview, Comment Mar 18, 2026 3:57pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
fides-privacy-center Ignored Ignored Mar 18, 2026 3:57pm

Request Review

@gilluminate gilluminate marked this pull request as ready for review March 17, 2026 20:33
@gilluminate gilluminate requested a review from a team as a code owner March 17, 2026 20:33
@gilluminate gilluminate requested review from jpople and removed request for a team March 17, 2026 20:33
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 17, 2026

Greptile Summary

This PR completes the migration of all Chakra UI Menu/MenuButton/MenuList/MenuItem usages in admin-ui to Ant Design Dropdown (for simple action menus) and Popover (for complex content dropdowns like search panels and checkbox trees). It also removes dead code — VendorSelect.tsx, ToggleDictSuggestions.tsx, and the fidesui ColumnDropdown/DataCategoryDropdown chakra-base components — resulting in a net removal of ~685 lines.

Note: This PR changes 32 files, which exceeds the project policy of a maximum of 15 files per PR (rule 32b2f192). The large footprint is understandable given the breadth of the Chakra-to-Ant migration, but it may warrant splitting in future migration PRs.

Key changes and issues found:

  • autoFocus regression in ConnectionListDropdown — Ant Design Popover lazy-renders content on first open and keeps it mounted afterward. The autoFocus attribute on the search Input will only trigger on the very first open; on subsequent reopens users must manually click the search field. Using afterOpenChange to programmatically focus the inputRef would restore the previous behavior.
  • Hardcoded hex color in ConnectionListDropdown!text-[#2b2e35] bypasses the theme token system; a theme alias or existing color token should be used.
  • Box with display="flex" in ColumnDropdown and DataCategoryDropdown — These should use the Flex component per the project's semantic-HTML convention (rule ecc7d51f).
  • Unused data-testid span in DatamapReportTable — The <span data-testid="edit-columns-btn"> wrapper around the "Edit columns" label is leftover now that all tests use selectAntDropdownOption; it's inconsistent with the plain-string "Rename columns" label.
  • Dead code removal (VendorSelect.tsx, ToggleDictSuggestions.tsx) and simplification of DeleteConnectionModal/DisableConnectionModal props is clean and well-executed.
  • Cypress test updates correctly replace [role="menuitem"] selectors with selectAntDropdownOption and the new dropdown-item-{identifier} test IDs.

Confidence Score: 3/5

  • Mostly safe to merge, but the autoFocus regression in ConnectionListDropdown degrades UX on subsequent opens of the integration search dropdown.
  • The migration is logically consistent and the dead code removal is clean. The main concern is a genuine usability regression in ConnectionListDropdown where the search input won't auto-focus after the first open due to Ant Design Popover's keep-mounted behavior. There is also a hardcoded hex color and some minor semantic HTML inconsistencies. The PR exceeds the 15-file policy limit at 32 files changed.
  • clients/admin-ui/src/features/datastore-connections/system_portal_config/ConnectionListDropdown.tsx (autoFocus regression + hardcoded color)

Important Files Changed

Filename Overview
clients/fidesui/src/hoc/CustomDropdown.tsx New wrapper component that defaults Ant Design Dropdown trigger to ["click"]; clean and straightforward.
clients/fidesui/src/index.ts Replaces direct Ant Dropdown export with CustomDropdown as Dropdown and removes unused ColumnDropdown/DataCategoryDropdown exports.
clients/admin-ui/src/features/datastore-connections/system_portal_config/ConnectionListDropdown.tsx Migrated from Chakra Menu to Ant Design Popover; has hardcoded hex color and an autoFocus regression where the search input won't auto-focus on subsequent reopens due to Popover not remounting content.
clients/admin-ui/src/features/common/ColumnDropdown.tsx Migrated from Chakra Menu to Ant Design Popover with controlled open state; minor div-as-flex-container usage.
clients/admin-ui/src/features/dataset/DataCategoryDropdown.tsx Migrated from Chakra Menu to Ant Design Popover with controlled open state; minor div-as-flex-container usage.
clients/admin-ui/src/features/datamap/reporting/DatamapReportTable.tsx Group-by and More menus migrated to Dropdown with check icon pattern for selected state; edit-columns-btn data-testid is kept inside a span label wrapper which is now unused by tests.
clients/admin-ui/src/features/datastore-connections/DeleteConnectionModal.tsx Removed showMenu prop and MenuItem rendering path; always renders the Delete button and always navigates on deletion, consistent with the only remaining call site in IntegrationBox.
clients/admin-ui/src/features/datastore-connections/DisableConnectionModal.tsx Removed isSwitch prop and MenuItem code path; now always renders the Switch UI, consistent with the only remaining call site which previously passed isSwitch={true}.
clients/admin-ui/src/features/system/VendorSelector.tsx CompassButton migrated from Chakra Menu/IconButton to Ant Design Dropdown/Button; clean migration.
clients/admin-ui/src/features/data-catalog/staged-resources/CatalogResourceOverflowMenu.tsx Migrated from Chakra Menu to Ant Design Dropdown; items built conditionally with useMemo; clean.
clients/admin-ui/cypress/e2e/datamap-report.cy.ts Test selectors updated from Chakra menu data-testids to selectAntDropdownOption helper; consistent updates throughout.
clients/admin-ui/cypress/support/stubs.ts URL intercept for minimal datasets changed from exact match to glob pattern (?*minimal=true) to accommodate query-string parameter ordering differences.

Comments Outside Diff (1)

  1. clients/admin-ui/src/features/datamap/reporting/DatamapReportTable.tsx, line 854-857 (link)

    P2 Unnecessary span wrapper in Dropdown label

    The Cypress tests that referenced the edit-columns-btn test-ID have been updated to use selectAntDropdownOption, making the <span data-testid="edit-columns-btn"> wrapper dead markup. It also creates an inconsistency with the "Rename columns" item which uses a plain string label. Consider simplifying the label to a plain "Edit columns" string to match the other items in this Dropdown.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Last reviewed commit: 5232499

import type { DropdownProps } from "antd/lib";
import { Dropdown as AntDropdown } from "antd/lib";

const CustomDropdownBase = ({
Copy link
Contributor

Choose a reason for hiding this comment

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

May want to add a generic story for a new HOC.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's already a Dropdown.stories.tsx in components/navigation/ that imports Dropdown from the fidesui barrel export, which now points to CustomDropdown. So the existing story already covers this HOC.

gilluminate and others added 12 commits March 18, 2026 09:50
Replace Chakra Menu usage with Ant Design Dropdown in catalog overflow
menus (datasets, staged resources, systems) and VendorSelector compass
button. Introduce CustomDropdown wrapper in fidesui that re-exports Ant
Dropdown with custom content support. Remove unused VendorSelect.tsx and
ToggleDictSuggestions.tsx.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Migrate group-by and more-options Chakra Menu components to Ant Dropdown
in DatamapReportTable. Also update Phase 1 dropdown items and Cypress
tests to use selectAntDropdownOption instead of data-testid spans.

- Replace Chakra Menu imports with Dropdown, CheckOutlined, Icons
- Group-by menu: items array with CheckOutlined visibility toggle
- More menu: items array with bottomRight placement
- Add getAntDropdownOverlay Cypress command for portal overlays
- Update all Cypress tests to use selectAntDropdownOption
- Remove unnecessary data-testid spans from dropdown item labels
- Swap ChakraChevronDownIcon to Icons.ChevronDown in CustomReportTemplates

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
DeleteConnectionModal and DisableConnectionModal had unused MenuItem
branches that no consumer exercised. Remove them along with the
showMenu and isSwitch props.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace Chakra Menu with Ant Popover for DataCategoryDropdown,
ColumnDropdown, and ConnectionListDropdown. Update Cypress tests
to remove [role="menuitem"] selectors that no longer apply.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
These Chakra-based components in fidesui were superseded by the
admin-ui versions migrated to Ant Design in the previous commit.
Inline the ColumnMetadata type into SystemsCheckboxTable to fix
the broken import from the deleted column-dropdown directory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace autoFocus with afterOpenChange on the Popover to
programmatically focus the search input on every open, not
just the first (Ant Design keeps popover content mounted after
first open, so autoFocus only fires once).

Also remove unused className overrides on the trigger Button.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tal_config/ConnectionListDropdown.tsx

Co-authored-by: Karolis Krulis <karolis@ethyca.com>
Copy link
Contributor

@kruulik kruulik left a comment

Choose a reason for hiding this comment

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

Looks good!

@gilluminate gilluminate added this pull request to the merge queue Mar 18, 2026
Merged via the queue into main with commit abc4d13 Mar 18, 2026
48 of 49 checks passed
@gilluminate gilluminate deleted the gill/ENG-180/migrate-popup-menu-to-ant-dropdown branch March 18, 2026 16:12
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