Skip to content

refactor(ui): migrate entity sidebar from antd/MUI to Alchemy components CAT-1544#16635

Merged
annadoesdesign merged 13 commits into
masterfrom
refactor/entity-sidebar-alchemy-migration
Mar 20, 2026
Merged

refactor(ui): migrate entity sidebar from antd/MUI to Alchemy components CAT-1544#16635
annadoesdesign merged 13 commits into
masterfrom
refactor/entity-sidebar-alchemy-migration

Conversation

@annadoesdesign

@annadoesdesign annadoesdesign commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

Before:
Screenshot 2026-03-20 at 9 32 18 AM
Screenshot 2026-03-20 at 9 32 27 AM
Screenshot 2026-03-20 at 9 32 24 AM
Screenshot 2026-03-20 at 9 32 20 AM

After:
Screenshot 2026-03-20 at 9 28 56 AM
Screenshot 2026-03-20 at 9 28 53 AM
Screenshot 2026-03-20 at 9 28 14 AM
Screenshot 2026-03-20 at 9 28 08 AM
Screenshot 2026-03-20 at 9 28 04 AM
Screenshot 2026-03-20 at 9 28 01 AM

Screenshot 2026-03-17 at 9 25 23 AM Screenshot 2026-03-17 at 9 32 54 AM Screenshot 2026-03-17 at 9 26 10 AM Screenshot 2026-03-17 at 9 25 56 AM Screenshot 2026-03-17 at 9 25 38 AM Screenshot 2026-03-17 at 9 25 32 AM Screenshot 2026-03-17 at 9 54 39 AM Screenshot 2026-03-17 at 9 54 48 AM

Summary

  • Replace all antd and MUI components in the entity profile sidebar with Alchemy components and Phosphor icons, removing sidebar dependency on Ant Design's Collapse, Typography, and Material-UI icons
  • Migrate all colors to semantic theme tokens (theme.colors.*), eliminating hardcoded hex values, REDESIGN_COLORS, ANTD_GRAY, and direct colors.gray[X] imports across 47 frontend files
  • Standardize sidebar layout with consistent 20px horizontal padding, 8px vertical section padding, edge-to-edge dividers, and right-aligned collapse carets
  • Fix 3 Cypress tests that relied on removed antd class selectors (.ant-collapse-header-text, AddRoundedIcon) by updating to stable data-testid selectors

What changed

Area Before After
Collapsible sections antd Collapse / Collapse.Panel Custom useState-driven collapsible
Section action icons MUI AddRoundedIcon, DraftsOutlinedIcon, EditOutlinedIcon Phosphor icons via Alchemy Icon component
Section headers antd Typography.Text styled.span with semantic tokens
Colors REDESIGN_COLORS, ANTD_GRAY, colors.gray[X], hardcoded hex theme.colors.* semantic tokens
Status pills Custom styled spans Alchemy Pill (filled variant)
Link/show-more buttons Custom styled components Alchemy Button (text/link variants)
Navigation buttons styled(Link) wrapping Button Button + useHistory
Owner avatars ExpandedOwner component AvatarPillWithLinkAndHover + AvatarStackWithHover

Deferred to follow-up PRs

  • Modals: SidebarApplicationSection uses antd Modal.confirm (Alchemy Modal itself wraps antd internally)
  • Tabs: EntitySidebarTabs uses antd Tabs (no Alchemy equivalent yet)
  • Shared components used across the app: DomainLink, ApplicationLink, DataProductLink, EntityPreviewTag (antd Tag)
  • User/Group sidebar changes (stashed separately)
  • Code block component for Logic section (needs SaaS component ported)

Test plan

  • yarn prettier --write src — all files formatted
  • yarn lint (ESLint + format-check + type-check) — zero errors
  • Unit tests: SidebarLogicSection.test.tsx — 5/5 passed
  • Unit tests: EntityProfile.test.tsx — 4 passed, 1 skipped (pre-existing)
  • Unit tests: OwnerUtils.test.ts — 21/21 passed
  • Cypress test audit: verified all data-testid and id selectors still present
  • Fixed 3 broken Cypress tests (v2_siblings.js, v2_glossary.js, dataset_helper.js)
  • Two additional exhaustive passes confirming no other Cypress tests affected
  • Visual review of all sidebar sections in browser

Made with Cursor

Replace all Ant Design (Collapse, Typography) and Material-UI (AddRoundedIcon,
DraftsOutlinedIcon, EditOutlinedIcon) components in the entity profile sidebar
with Alchemy components (Button, Icon, Pill, Tooltip) and Phosphor icons.

Key changes:
- Replace antd Collapse with custom useState-driven collapsible sections
- Replace MUI icons with Phosphor icons via Alchemy Icon component
- Replace antd Typography.Text with styled.span
- Migrate all hardcoded colors, REDESIGN_COLORS, ANTD_GRAY, and
  colors.gray[X] imports to semantic theme tokens (theme.colors.*)
- Replace styled(Link) wrapping Button anti-pattern with Button + useHistory
- Use Alchemy Pill (filled variant) for status indicators
- Use Alchemy Button (text/link variants) for show-more and link actions
- Standardize sidebar section padding (20px horizontal, 8px vertical)
- Make section dividers edge-to-edge
- Move collapse caret to right side of section headers
- Update Cypress tests to use data-testid selectors instead of removed
  antd class selectors (.ant-collapse-header-text, AddRoundedIcon)

50 files changed, net reduction of ~150 lines.
All unit tests, ESLint, Prettier, and type-check pass.

Made-with: Cursor
@github-actions github-actions Bot added product PR or Issue related to the DataHub UI/UX smoke_test Contains changes related to smoke tests labels Mar 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Linear: CAT-1557

@alwaysmeticulous

alwaysmeticulous Bot commented Mar 17, 2026

Copy link
Copy Markdown

✅ Meticulous spotted visual differences in 168 of 1736 screens tested, but all differences have already been approved: view differences detected.

Meticulous evaluated ~9 hours of user flows against your PR.

Last updated for commit ac57391. This comment will update as new commits are pushed.

@codecov

codecov Bot commented Mar 17, 2026

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 3.07kB (0.01%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
datahub-react-web-esm 22.97MB 3.07kB (0.01%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: datahub-react-web-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index-*.js 3.07kB 12.81MB 0.02%

Files in assets/index-*.js:

  • ./src/app/entityV2/shared/containers/profile/sidebar/SectionActionButton.tsx → Total Size: 1.41kB

  • ./src/app/entityV2/shared/containers/profile/sidebar/Query/SidebarQueryOperationsSection.tsx → Total Size: 3.53kB

  • ./src/app/entityV2/shared/containers/profile/sidebar/Dataset/Header/SidebarDatasetHeaderSection.tsx → Total Size: 3.64kB

  • ./src/app/entityV2/shared/containers/profile/sidebar/EntitySidebarTabs.tsx → Total Size: 8.77kB

  • ./src/app/entityV2/shared/containers/profile/sidebar/AboutSection/SidebarAboutSection.tsx → Total Size: 2.57kB

  • ./src/app/entityV2/shared/containers/profile/sidebar/ExploreLineageAction.tsx → Total Size: 930 bytes

  • ./src/app/entityV2/domain/summary/DataProductsSection.tsx → Total Size: 2.4kB

  • ./src/app/entityV2/shared/containers/profile/sidebar/Ownership/sidebar/OwnershipTypeSection.tsx → Total Size: 1.54kB

  • ./src/app/entityV2/shared/containers/profile/sidebar/Ownership/sidebar/SidebarOwnerSection.tsx → Total Size: 3.31kB

  • ./src/app/entityV2/shared/containers/profile/sidebar/EntityProfileSidebar.tsx → Total Size: 4.75kB

  • ./src/alchemy-components/components/Avatar/AvatarPillWithLinkAndHover.tsx → Total Size: 777 bytes

  • ./src/app/entityV2/shared/containers/profile/sidebar/Applications/SidebarApplicationSection.tsx → Total Size: 3.36kB

  • ./src/app/entityV2/shared/containers/profile/sidebar/SidebarEntityHeader.tsx → Total Size: 2.62kB

  • ./src/app/entityV2/shared/containers/profile/sidebar/Container/SidebarContentsSection.tsx → Total Size: 1.95kB

  • ./src/app/entityV2/shared/containers/profile/sidebar/Dataset/View/SidebarViewDefinitionSection.tsx → Total Size: 1.39kB

  • ./src/app/entityV2/shared/containers/profile/sidebar/EmptySectionText.tsx → Total Size: 303 bytes

  • ./src/app/entityV2/shared/containers/profile/sidebar/LinkButton.tsx → Total Size: 441 bytes

  • ./src/app/entityV2/shared/containers/profile/sidebar/Lineage/SidebarLineageSection.tsx → Total Size: 4.85kB

  • ./src/app/entityV2/shared/containers/profile/sidebar/AboutSection/DescriptionSection.tsx → Total Size: 571 bytes

  • ./src/app/entityV2/shared/containers/profile/sidebar/EntitySidebar.tsx → Total Size: 1.54kB

  • ./src/app/entityV2/shared/containers/profile/sidebar/AboutSection/LinksSection.tsx → Total Size: 745 bytes

  • ./src/app/entityV2/shared/containers/profile/sidebar/Domain/SidebarEntitiesSection.tsx → Total Size: 2.31kB

  • ./src/app/entityV2/shared/containers/profile/sidebar/Domain/SidebarDomainSection.tsx → Total Size: 3.21kB

  • ./src/app/entityV2/shared/SidebarStyledComponents.tsx → Total Size: 7.2kB

  • ./src/app/entityV2/group/GroupProfileInfoCard.tsx → Total Size: 2.79kB

  • ./src/app/entityV2/shared/containers/profile/sidebar/Chart/Header/SidebarChartHeaderSection.tsx → Total Size: 2.43kB

  • ./src/app/entityV2/shared/containers/profile/sidebar/Dashboard/Header/SidebarDashboardHeaderSection.tsx → Total Size: 2.5kB

  • ./src/app/entityV2/shared/containers/profile/sidebar/SidebarCollapsibleHeader.tsx → Total Size: 2.11kB

  • ./src/app/entityV2/shared/containers/profile/sidebar/DataProduct/DataProductSection.tsx → Total Size: 4.99kB

  • ./src/app/entityV2/shared/containers/profile/sidebar/AboutSection/SourceRefSection.tsx → Total Size: 794 bytes

@codecov

codecov Bot commented Mar 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@maggiehays maggiehays added the needs-review Label for PRs that need review from a maintainer. label Mar 17, 2026
@annadoesdesign annadoesdesign changed the title refactor(ui): migrate entity sidebar from antd/MUI to Alchemy components refactor(ui): migrate entity sidebar from antd/MUI to Alchemy components CAT-1544 Mar 17, 2026
…ebar-alchemy-migration

Made-with: Cursor

# Conflicts:
#	datahub-web-react/src/app/entityV2/shared/containers/profile/sidebar/EntitySidebarTabs.tsx
#	datahub-web-react/src/app/entityV2/shared/containers/profile/sidebar/SidebarSection.tsx
Align with tree-shaking changes from #16338 — Icon component now
accepts React.ComponentType instead of string names with source prop.

Made-with: Cursor
if (user.type) return user.type;
return user.__typename === 'CorpGroup' ? EntityType.CorpGroup : EntityType.CorpUser;
}

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.

I appreciate that checking the private __typename as backup is defensive coding but I believe it's unnecessary as .type should be guaranteed to exist.

So just this should work:

 function resolveActorEntityType(actor: CorpUser | CorpGroup): EntityType {
    return actor.type;
}

const relativeTime = moment(time);
if (relativeTime.isAfter(moment().subtract(1, 'week'))) {
return `${REDESIGN_COLORS.GREEN_NORMAL}`;
return 'green';

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.

Shouldn't these be tokens too?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These are Alchemy Pill component color variant names ('green', 'yellow', 'red'), not CSS color values — they get passed to <Pill color={pillColor} /> in SyncedOrShared.tsx. So no token needed here.

overflow: hidden;
`}
`;

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.

line-clamp is now supported pretty much anywhere so I would add it (you can still keep -webkit prefix if you want since it's harmless).

const ClampedText = styled.div<{ $expanded: boolean }>`
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    line-clamp: ${({ $expanded }) => ($expanded ? 'unset' : VISIBLE_LINES)};
    -webkit-line-clamp: ${({ $expanded }) => ($expanded ? 'unset' : VISIBLE_LINES)};
`;

setIsClamped(el.scrollHeight > LINE_HEIGHT * VISIBLE_LINES + 2);
}
}, [about, isAboutEditable]);

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.

This magic pixel calculation seems a bit fragile and might break if font size or line height changes. How about something like

useEffect(() => {
    const el = textRef.current;
    if (el) {
        setIsClamped(el.scrollHeight > el.clientHeight);
    }
}, [about, isAboutEditable]);

@maggiehays maggiehays added pending-submitter-response Issue/request has been reviewed but requires a response from the submitter and removed needs-review Label for PRs that need review from a maintainer. labels Mar 18, 2026
@chriscollins3456

chriscollins3456 commented Mar 19, 2026

Copy link
Copy Markdown
Collaborator

should we have the collapse carets on the right side like this? it used to be on the left and i think that's what we usually do and when it's not next to the section name we've heard confusion from folks before.

and then you should be able to click on the name of the section in order to expand/collapse the section as well

Resolve conflicts in SidebarStyledComponents.tsx and NotesSection.tsx
from avatar-pills PR merge. Keep Phosphor icons over MUI, adopt master's
semantic token updates. Replace AvatarPillWithLinkAndHover with
ExpandedOwner in OwnershipTypeSection for proper remove-owner support.

Made-with: Cursor
- Simplify resolveEntityType to just return user.type (no __typename fallback)
- Add unprefixed line-clamp alongside -webkit-line-clamp in AboutSidebarSection
- Replace magic pixel calculation with scrollHeight > clientHeight for clamped text detection

Made-with: Cursor
@maggiehays maggiehays added needs-review Label for PRs that need review from a maintainer. and removed pending-submitter-response Issue/request has been reviewed but requires a response from the submitter labels Mar 19, 2026
annadoesdesign and others added 2 commits March 19, 2026 14:52
…gration

- Add data-testid to GroupProfileInfoCard and AboutSidebarSection for
  edit buttons that lost their MUI-generated testids after Phosphor migration
- Update v2_managing_groups.js selectors to use new explicit data-testids
- Fix v2_nested_domains.js race condition: wait for sidebar to render
  after cy.reload() before DatasetHelper.assignTag interacts with it
- Remove dead setIsThemeV2Enabled calls in createGroup command and
  dataset_ownership.js (command was removed in v1 UI cleanup)

Made-with: Cursor
Resolve conflicts keeping alchemy migration changes:
- SidebarStyledComponents: keep SideBarSubSection, SubscriptionContainer,
  and styled.div OwnershipContainer
- StatusSection: keep custom DeprecatedHeader over antd StyledCollapse
- styledComponents: keep InstanceIcon and StyledLabel

Made-with: Cursor
After the sidebar migration from styled.div to alchemy Button, the
add-tags-button renders as <button disabled> while entity privileges
load. React ignores onClick on disabled buttons even with Cypress's
force:true, so the tag modal never opens. Add .should("not.be.disabled")
to wait for privileges to load before clicking.

Made-with: Cursor
- SidebarEntityHeader: remove redundant margin-left, use 8px gap,
  only render PlatformHeaderIcons when platform exists, use 16px
  LR padding with logo and 20px without
- OwnershipTypeSection: replace margin-right with gap on parent,
  remove margin-top, bump type label to 12px, 4px gap between
  title and pills, 4px gap between pills
- SidebarOwnerSection: add 8px gap between ownership type groups

Made-with: Cursor
…line styles

- Remove unused StyledLabel, InstanceIcon, ContentText from styledComponents
- Consolidate ContentText into LabelText in SyncedOrShared
- Remove unnecessary $collapsible prop from StatusSection
- Add flex-wrap to OwnershipContainer for wrapping owned entities
- Use AvatarPillWithLinkAndHover for Groups sidebar section
- Remove empty AddLinksWrapper from LinksSection
- Replace inline textDecoration styles with StyledAnchor in LinkButton
  and SourceRefSection

Made-with: Cursor
@annadoesdesign annadoesdesign enabled auto-merge (squash) March 20, 2026 18:24
@annadoesdesign annadoesdesign merged commit 3cc3cf6 into master Mar 20, 2026
66 of 67 checks passed
@annadoesdesign annadoesdesign deleted the refactor/entity-sidebar-alchemy-migration branch March 20, 2026 19:00
david-leifker pushed a commit that referenced this pull request May 27, 2026
…Alchemy components CAT-1544 (#16635)

Conflicts resolved by Claude AI.

Merged from commit 3cc3cf6
Original author: Anna Everhart <149417426+annadoesdesign@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-review Label for PRs that need review from a maintainer. product PR or Issue related to the DataHub UI/UX smoke_test Contains changes related to smoke tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants