Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Wrap older modals in theme class [WEB-1824] #8432

Merged
merged 2 commits into from
Nov 16, 2023
Merged

fix: Wrap older modals in theme class [WEB-1824] #8432

merged 2 commits into from
Nov 16, 2023

Conversation

mapmeld
Copy link
Contributor

@mapmeld mapmeld commented Nov 16, 2023

Description

Applies system/light/dark theme to hyperparameter, notebook, or any old-style modal still inside src/hooks/useModal

Test Plan

Switch to dark mode.
In a single-trial experiment, open the Hyperparameter tab, then click the Hyperparameter Search button
The background should be solid, and the title font-family should come from a CSS variable

Checklist

  • Changes have been manually QA'd
  • User-facing API changes need the "User-facing API Change" label.
  • Release notes should be added as a separate file under docs/release-notes/.
    See Release Note for details.
  • Licenses should be included for new code which was copied and/or modified from any external code.

Copy link

netlify bot commented Nov 16, 2023

Deploy Preview for determined-ui ready!

Name Link
🔨 Latest commit 8d95aeb
🔍 Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/655641c37ea7f700081b5fcb
😎 Deploy Preview https://deploy-preview-8432--determined-ui.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mapmeld mapmeld added the to-cherry-pick Pull requests that need to be cherry-picked into the current release label Nov 16, 2023
Copy link
Contributor

@julian-determined-ai julian-determined-ai left a comment

Choose a reason for hiding this comment

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

Could you also update the GalleryModal?

@johnkim-det
Copy link
Contributor

johnkim-det commented Nov 16, 2023

This fixes the Hyperparameter Search modal, but it actually looks like the "Use in Notebook" modal doesn't use the determined useModal hook, it just imports and uses the antd Modal directly. And there may be several modals where we do this.

So I think we need to apply the theme class to any direct imports of antd Modals, or use the useModal hook in those places, or replace them with hew Modals.

@johnkim-det
Copy link
Contributor

I think we want to think about the long-term solution, but probably the simplest fix for release is to just import useTheme and apply themeClass to all of these:

Screen Shot 2023-11-16 at 11 14 27 AM

@mapmeld
Copy link
Contributor Author

mapmeld commented Nov 16, 2023

@johnkim-det I think we had the same idea to search - the latest commit extends this to other uses of Antd Modal except for the Omnibar help (because it's not a function component and can't call useTheme...)

Copy link
Contributor

@johnkim-det johnkim-det left a comment

Choose a reason for hiding this comment

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

LGTM

@mapmeld mapmeld merged commit bf07e61 into main Nov 16, 2023
69 of 80 checks passed
@mapmeld mapmeld deleted the darkmodal branch November 16, 2023 16:30
dai-release bot pushed a commit that referenced this pull request Nov 16, 2023
antd.Modal in all but one known cases

(cherry picked from commit bf07e61)
@ClaireNeveu
Copy link
Contributor

@mapmeld Can you make a ticket to migrate these?

@mapmeld
Copy link
Contributor Author

mapmeld commented Nov 16, 2023

@ClaireNeveu ok I made 3 tickets, because some are more complex than others

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed to-cherry-pick Pull requests that need to be cherry-picked into the current release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants