-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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: Changing font causes visual distortion; more noticeable than what used to happen on the base DP #33374
Conversation
WalkthroughThe recent updates involve optimizations in theming and UI components across several files. The Changes
Assessment against linked issues
The changes in the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
/build-deploy-preview skip-tests=true |
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/9059196673. |
Deploy-Preview-URL: https://ce-33374.dp.appsmith.com |
setFontFamilyClassName(css` | ||
${fontFamilyCss(fontFamily)} | ||
`); | ||
}, [fontFamily]); | ||
}, [typography, fontFamily]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KelvinOm Moved the setting font and typography calculation under one useeffect. Hope it won't mess anything else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't help, since this change won't actually change anything. To be honest, I don't see a way to fix this behavior, because if we change Font Family, browser makes reflow, browser also makes reflow, since we have to apply new font parameters that capsize returned for us. These are two different processes and there is no way to merge them even if we apply all the changes at the same time. So I don't see a way to avoid this. That's how it works.
We could make it more gentle for the user by hiding applications and showing the loader for a while. I.e. through UI/UX approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to apply the changes to font-family immediately instead of waiting for the capsize calculations? Also the visual jiggle seems to be from re-calculations of inner-spacing scale happening in the second pass rather than anything typographic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to apply the changes to font-family immediately instead of waiting for the capsize calculations?
It won't change this. We can apply it before, immediately, or after.
Here is an example if we apply font-family with a delay(100 ms).
https://github.com/appsmithorg/appsmith/assets/11555074/8d533e35-ea8f-4bd6-9e59-b9bd283e2b38
Also the visual jiggle seems to be from re-calculations of inner-spacing scale happening in the second pass rather than anything typographic.
This is in particular due to the fact that we change the font size, line height and compensators (margins).
Closing this PR as it does not solve the issue. |
Fixes #33331