Skip to content

refactor(ui): migrate Settings > Home Page posts from Ant Design to Alchemy components CAT-1562#16640

Merged
annadoesdesign merged 7 commits into
masterfrom
refactor/settings-posts-antd-to-alchemy
Mar 19, 2026
Merged

refactor(ui): migrate Settings > Home Page posts from Ant Design to Alchemy components CAT-1562#16640
annadoesdesign merged 7 commits into
masterfrom
refactor/settings-posts-antd-to-alchemy

Conversation

@annadoesdesign

@annadoesdesign annadoesdesign commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

Before:
Screenshot 2026-03-18 at 11 48 17 AM
Screenshot 2026-03-18 at 11 48 32 AM
Screenshot 2026-03-18 at 11 48 27 AM
Screenshot 2026-03-18 at 11 48 23 AM

After:
Screenshot 2026-03-17 at 5 21 39 PM
Screenshot 2026-03-17 at 5 21 43 PM
Screenshot 2026-03-17 at 5 21 45 PM

Summary

Migrates the Settings > Home Page posts management page (/settings/posts) and the AnnouncementCard component from Ant Design to DataHub's Alchemy component library.

Changes

Settings Posts Page (7 files):

  • Replaced Ant Design Button, Empty, Pagination, Table, Dropdown, Menu, Form, Input, Radio, Typography, message with Alchemy equivalents (Button, EmptyState, Pagination, Table, Menu, Input, TabButtons, toast, Modal)
  • "Create new post" button moved next to PageTitle header (consistent with other settingsV2 pages)
  • Type column uses colored Pill badges (blue for Link, violet for Announcement)
  • Three-dot menu uses Phosphor DotsThreeVertical icon with Alchemy Menu
  • Table uses tableLayout: fixed for proper column width enforcement
  • Markdown/HTML stripped from description column display
  • All colors use semantic theme tokens

AnnouncementCard (1 file):

  • Replaced custom card composition with Alchemy Alert component (variant="brand")

Alert Component (2 files):

  • Title text size changed to 14px (md)
  • align-items: flex-start for multi-line content
  • 12px gap between icon and text
  • Consistent 16px right padding
  • Explicit color inheritance for variant text

Bug Fixes (included in migration):

  • Fixed description being wiped when editing a post (lazy useState initializer)
  • Fixed Enter key in Editor triggering form submission (removed useEnterKeyListener)

Cypress Test (1 file):

  • Updated selectors: aria-label="more"data-testid="dropdown-menu-item"
  • Updated content type toggle: labelbutton element selector
  • Input data-testidinputTestId prop for native <input> targeting

Checklist

  • The PR conforms to DataHub's Contributing Guideline
  • Tests for the changes have been added/updated
  • No breaking changes

Test plan

  • Cypress test v2_homePagePost.js passes with updated selectors
  • Manual verification of create, edit, delete flows for announcements and links
  • Verified announcement card renders correctly on home page with brand Alert
  • yarn prettier and yarn lint pass cleanly

Made with Cursor

…lchemy components

Replace all Ant Design components (Button, Empty, Pagination, Table, Dropdown,
Menu, Form, Input, Radio, Typography, message) with Alchemy equivalents (Button,
EmptyState, Pagination, Table, Menu, Input, TabButtons, toast, Modal, Alert).

Key changes:
- Settings posts page: full Alchemy migration with Phosphor icons, semantic
  color tokens, pill-style type badges, and fixed-layout table
- AnnouncementCard: replaced custom card with Alchemy Alert (brand variant)
- Alert component: 14px title text, flex-start alignment, 12px icon gap,
  consistent padding, explicit color inheritance for variant text
- CreatePostModal: useState lazy initializer to fix description wipe on edit,
  removed useEnterKeyListener to fix Enter key submitting from Editor
- Cypress test: updated selectors for Alchemy Button (dropdown-menu-item),
  TabButtons (button vs label), and Input (inputTestId for native targeting)

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 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Linear: CAT-1561

@annadoesdesign annadoesdesign changed the title refactor(ui): migrate Settings > Home Page posts from Ant Design to Alchemy components refactor(ui): migrate Settings > Home Page posts from Ant Design to Alchemy components CAT-1562 Mar 18, 2026
@alwaysmeticulous

alwaysmeticulous Bot commented Mar 18, 2026

Copy link
Copy Markdown

🔴 Meticulous spotted visual differences in 66 of 1624 screens tested: view and approve differences detected.

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

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

@codecov

codecov Bot commented Mar 18, 2026

Copy link
Copy Markdown

Bundle Report

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

Detailed changes
Bundle name Size Change
datahub-react-web-esm 23.78MB 1.1kB (0.0%) ⬆️

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 1.1kB 13.61MB 0.01%

Files in assets/index-*.js:

  • ./src/alchemy-components/components/Alert/components.ts → Total Size: 1.51kB

  • ./src/app/settingsV2/posts/CreatePostForm.tsx → Total Size: 2.61kB

  • ./src/alchemy-components/components/Alert/Alert.tsx → Total Size: 1.62kB

  • ./src/app/settingsV2/posts/PostsListColumns.tsx → Total Size: 249 bytes

  • ./src/app/settingsV2/posts/CreatePostModal.tsx → Total Size: 3.5kB

  • ./src/app/settingsV2/posts/PostsList.tsx → Total Size: 4.56kB

  • ./src/app/homeV3/announcements/AnnouncementCard.tsx → Total Size: 789 bytes

  • ./src/app/settingsV2/posts/constants.ts → Total Size: 113 bytes

  • ./src/app/settingsV2/posts/ManagePosts.tsx → Total Size: 1.44kB

  • ./src/app/settingsV2/posts/PostItemMenu.tsx → Total Size: 1.61kB

@codecov

codecov Bot commented Mar 18, 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!

Resolve AnnouncementCard.tsx conflict keeping Alert migration.
Replace string icon names with Phosphor component refs in
ManagePosts, PostItemMenu, and PostsList.

Made-with: Cursor
</>
)}
</Form>
</div>

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.

Are we no longer wrapping the form in <form> tag?

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.

Good catch! The Ant Design <Form> was dropped during the migration since we moved state management to React useState, but that also lost the semantic <form> tag. Fixed in 218486f — the wrapper is now <form onSubmit={(e) => e.preventDefault()}> so we keep form landmark semantics for accessibility without interfering with the modal's button-driven submission.

annadoesdesign and others added 2 commits March 18, 2026 11:53
Replace <div> wrapper with <form onSubmit={preventDefault}> to preserve
form landmark semantics for screen readers after Ant Design migration.

Made-with: Cursor
dataIndex: '',
key: 'description',
render: (record: PostEntry) => PostColumn(record.description || ''),
render: (record) => <OverflowText text={stripMarkdown(record.description || '')} />,

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.

Do we actually want to strip or render markdown? If render then we could use CompactMarkdownViewer + hideShowMore. If we want to strip markdown we should do that properly (since remove-markdown is already installed) e.g.

import removeMd from '@tommoor/remove-markdown';

render: (record) => (
    <OverflowText text={removeMd(record.description || '')} />
),

<Pill
label={POST_TYPE_TO_DISPLAY_TEXT[record.contentType]}
variant="filled"
color={record.contentType === PostContentType.Link ? 'blue' : 'violet'}

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.

Does this color need to be tokenized?

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 already tokenized — 'blue' and 'violet' are ColorOptions values from the Alchemy theme config (ColorValues enum in alchemy-components/theme/config/types.ts). The Pill component maps them to themed colors internally via PillContainer, so no raw hex values here.

@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
Replace hand-rolled stripMarkdown regex with the already-installed
@tommoor/remove-markdown library for more robust markdown stripping
in the posts description column.

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 annadoesdesign merged commit e20033b into master Mar 19, 2026
43 of 44 checks passed
@annadoesdesign annadoesdesign deleted the refactor/settings-posts-antd-to-alchemy branch March 19, 2026 15:22
david-leifker pushed a commit that referenced this pull request May 27, 2026
…Ant Design to Alchemy components CAT-1562 (#16640)

Conflicts resolved by Claude AI.

Merged from commit e20033b
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.

3 participants