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

frontend: EditorDialog: Remove unneeded Monaco override #2752

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

skoeva
Copy link
Contributor

@skoeva skoeva commented Jan 16, 2025

This change addresses a regression where a local MonacoEnvironment override caused conflicts with Monaco-based components like DiffEditor. The Monaco override logic in EditorDialog is now removed to restore the default environment.

Fixes: #2693

Testing

  • Perform the steps outlined in the issue
  • Ensure that the colors are applied as intended

image

@skoeva skoeva added the frontend Issues related to the frontend label Jan 16, 2025
@skoeva skoeva self-assigned this Jan 16, 2025
@skoeva skoeva linked an issue Jan 16, 2025 that may be closed by this pull request
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jan 16, 2025
Copy link
Collaborator

@illume illume left a comment

Choose a reason for hiding this comment

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

👍 thanks

@illume illume added bug Something isn't working regression Bugs for things that used to work in previous releases. labels Jan 17, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 17, 2025
@sniok
Copy link
Contributor

sniok commented Jan 17, 2025

The original issue only mentions DiffEditor from '@monaco-editor/react' package. How does showing Editor Dialog impacts rendering the DiffEditor? They seem to be separate

@skoeva
Copy link
Contributor Author

skoeva commented Jan 17, 2025

@sniok I went through the commit history and narrowed down the issue to that. I think it has to do with Monaco not loading properly if the editor isn't rendered, but feel free to test

@sniok
Copy link
Contributor

sniok commented Jan 17, 2025

@skoeva The example codesandbox in the original issue renders a DiffEditor by itself without any additional logic. Which means that there's something in EditorDialog that breaks monaco editor for the rest of the app unless EditorDialog is being rendered. If that's true then if we just merge this without understanding underlying cause we might encounter some additional problems with this later or in other spots. I think it's important to understand what is causing the issue in the first place.

Of course this shouldn't stop us from reverting the regression, I just want to have understanding of why this is happening

@skoeva
Copy link
Contributor Author

skoeva commented Jan 17, 2025

@sniok I suppose it's related to the MonacoEnvironment override, I don't see any specific reason to be redefining it here. I believe the default environment should be fine: I commented it out and it also fixed the issue. Let me know if I'm missing something though

@skoeva skoeva changed the title frontend: EditorDialog: Render dialog unconditionally frontend: EditorDialog: Remove unneeded Monaco override Jan 17, 2025
This change addresses a regression where a local MonacoEnvironment
override caused conflicts with Monaco-based components like DiffEditor.
The Monaco override logic in EditorDialog is now removed to restore the
default environment.

Fixes: #2693

Signed-off-by: Evangelos Skopelitis <[email protected]>

change
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working frontend Issues related to the frontend lgtm This PR has been approved by a maintainer regression Bugs for things that used to work in previous releases. size:S This PR changes 10-29 lines, ignoring generated files.
Projects
Development

Successfully merging this pull request may close these issues.

Monaco DiffEditor does not apply coloring to changed text
3 participants