Skip to content

Conversation

@rebeccaalpert
Copy link
Member

The Monaco code editor injects styles and JavaScript tags into the header. Usually, in React, this is fine. In Astro, with transitions, this breaks down. I tried manually adding these and it broke Monaco. Instead, forcing a reload and trying to fix dark mode seemed like a better way to go.

@rebeccaalpert rebeccaalpert linked an issue May 30, 2025 that may be closed by this pull request
@rebeccaalpert rebeccaalpert force-pushed the codeeditor branch 2 times, most recently from 173b6f9 to e917448 Compare May 30, 2025 20:51
Copy link
Contributor

@wise-king-sullyman wise-king-sullyman left a comment

Choose a reason for hiding this comment

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

Editor wonkyness does seem fixed, but the flash in dark theme still seems pretty rough.

I'm not opposed to us merging this if we make a followup to address the flash further at some point though.

The Monaco code editor injects styles and JavaScript tags into the header. Usually, in React, this is fine. In Astro, with transitions, this breaks down. I tried manually adding these and it broke Monaco. Instead, forcing a reload and trying to fix dark mode seemed like a better way to go.
Copy link
Collaborator

@kmcfaul kmcfaul left a comment

Choose a reason for hiding this comment

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

I'm fine with this being an interim solution at least, I think the code editor losing styles is more of a blocker than the flash.

I'm still puzzled why it's somehow losing the injected styles when the rendered elements should have the client:load directive (so it should be waiting to render client side anyways). Maybe there's some caching setting we're missing somewhere.

@rebeccaalpert
Copy link
Member Author

Here's that follow-on: #96

@wise-king-sullyman wise-king-sullyman merged commit 4bffd11 into patternfly:main Jun 17, 2025
1 check passed
@github-actions
Copy link

🎉 This PR is included in version 1.9.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Live editor gets wonky after navigating to a different page

3 participants