-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Make interactive window and native editor take their fontSize and fontFamily from the settings in VS Code. #7746
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
Conversation
their fontSize and fontFamily from the settings in VS Code. We get them in nativeEditor.tsx and in interactivePanel.tsx to apply them as styles, but we also need to send them as props to eventually assign them in the monaco editor.
Codecov Report
@@ Coverage Diff @@
## master #7746 +/- ##
==========================================
- Coverage 58.81% 58.43% -0.38%
==========================================
Files 496 496
Lines 22115 22158 +43
Branches 3558 3565 +7
==========================================
- Hits 13006 12948 -58
- Misses 8297 8392 +95
- Partials 812 818 +6
Continue to review full report at Codecov.
|
We now get the VS Code styles from the state of the component, instead of computing a style from an element.
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.
🕐
interactivePanel, and put it in the mainStateController
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.
I believe the react context would be a better and cleaner fit.
Tomorrow if there's another similar piece of data we'd need to modify a lot again (hypotheticaly - font color - bad example, but you get the idea)
Using a context, we don't have to modify a lot of places just to pass this information (this is contextual and doesn't change) all the way down.
react and change their fonts when the user changes them in VS Code, instead of having to reload.
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.
two separate props to make it easier to maintain. React Context was not used to avoid making the reuse of components more difficult.
@DonJayamanne I ended up not using React Context, but I addressed your comment by passing an object as a prop instead of an individual value. Commit b7f514a makes that change. |
…tFamily from the settings in VS Code. (#7746) * Make interactive window and native editor take their fontSize and fontFamily from the settings in VS Code. We get them in nativeEditor.tsx and in interactivePanel.tsx to apply them as styles, but we also need to send them as props to eventually assign them in the monaco editor. * Moved style from react code to common.css We now get the VS Code styles from the state of the component, instead of computing a style from an element. * Removed getting the font from nativeEditor and interactivePanel, and put it in the mainStateController * Made the interactiveWindow and the nativeEditor react and change their fonts when the user changes them in VS Code, instead of having to reload. * Changed the font props to be an object instead of two separate props to make it easier to maintain. React Context was not used to avoid making the reuse of components more difficult. * Removed some unnecesary passing around of the font prop * removed unnecesary comments * fixed a failing test
We get them in nativeEditor.tsx and in interactivePanel.tsx
to apply them as styles, but we also need to send them
as props to eventually assign them in the monaco editor.
For #7624
package-lock.json
has been regenerated by runningnpm install
(if dependencies have changed)