Skip to content

Conversation

purnimagarg1
Copy link
Collaborator

Linear ticket:
https://linear.app/acryl-data/issue/CH-599/fix-opening-of-a-modal-of-a-module-after-redirecting-with-an-opened

Description:

This PR creates a generic ModalContext and hook useGetModalLinkProps to get link props that determine that a link be opened in a new tab if it's inside a modal.
This is used in Asset Collection modal on the homepage. It can be used at any other place by wrapping the modal contents with this ModalContext.

@github-actions github-actions bot added the product PR or Issue related to the DataHub UI/UX label Aug 12, 2025
@datahub-cyborg datahub-cyborg bot added the needs-review Label for PRs that need review from a maintainer. label Aug 12, 2025
Copy link

alwaysmeticulous bot commented Aug 12, 2025

✅ Meticulous spotted 0 visual differences across 1458 screens tested: view results.

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

Expected differences? Click here. Last updated for commit 5399412. This comment will update as new commits are pushed.

Copy link

codecov bot commented Aug 12, 2025

Bundle Report

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

Detailed changes
Bundle name Size Change
datahub-react-web-esm 28.49MB 9.8kB (0.03%) ⬆️

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 9.8kB 18.84MB 0.05%

Files in assets/index-*.js:

  • ./src/app/sharedV2/modals/useGetModalLinkProps.ts → Total Size: 284 bytes

  • ./src/app/homeV3/module/components/EntityItem.tsx → Total Size: 1.18kB

  • ./src/alchemy-components/components/Modal/Modal.tsx → Total Size: 2.63kB

  • ./src/app/sharedV2/modals/ModalContext.ts → Total Size: 145 bytes

  • ./src/app/shared/useEmbeddedProfileLinkProps.tsx → Total Size: 494 bytes

  • ./src/app/searchV2/autoCompleteV2/AutoCompleteEntityItem.tsx → Total Size: 4.69kB

Copy link

codecov bot commented Aug 12, 2025

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!

Copy link
Collaborator

@chriscollins3456 chriscollins3456 left a comment

Choose a reason for hiding this comment

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

i think this is nice, but we could even add it to our component library potentially!

if there are issues with that then we can go forward with this for now and add it to more places later

<ModuleDetailsForm form={form} formValues={{ name: currentName }} />
<AssetsSection selectedAssetUrns={selectedAssetUrns} setSelectedAssetUrns={setSelectedAssetUrns} />
</ModalContent>
<ModalContext.Provider value={{ isInsideModal: true }}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

even better, let's just move this to our Modal component we have in our component library so then we know we'll have this context in every modal! what do you think?

@datahub-cyborg datahub-cyborg bot 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 Aug 20, 2025
@datahub-cyborg datahub-cyborg bot 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 Aug 21, 2025
Copy link
Collaborator

@chriscollins3456 chriscollins3456 left a comment

Choose a reason for hiding this comment

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

cool!

@chriscollins3456 chriscollins3456 merged commit 8202977 into master Aug 26, 2025
40 of 41 checks passed
@chriscollins3456 chriscollins3456 deleted the pg--ch-599-open-modal-links-in-new-tab branch August 26, 2025 21:49
@datahub-cyborg datahub-cyborg bot added pending-submitter-merge and removed needs-review Label for PRs that need review from a maintainer. labels Aug 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending-submitter-merge product PR or Issue related to the DataHub UI/UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants