Skip to content

Conversation

@tsmaeder
Copy link
Member

What it does

Monaco editors don't work correctly when they are hidden by setting display: none. This PR unsets the editor model from the editor when it is hidden and restores it when the editor is revealed again.

Fixes #14880

How to test

Test the scenario from the related issue. Have an eye out for an missing state in the editor or focus issues. This needs to be tested on Linux to make sure the issue is fixed as it did not happen on Windows.

Follow-ups

Breaking changes

  • This PR introduces breaking changes and requires careful review. If yes, the breaking changes section in the changelog has been updated.

Attribution

Contributed on behalf of STMicroelectronics

Review checklist

Reminder for reviewers

Fixes eclipse-theia#14880

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>
@tsmaeder tsmaeder requested review from msujew and sdirix February 12, 2025 17:42
Signed-off-by: Thomas Mäder <[email protected]>
@tsmaeder
Copy link
Member Author

@sdirix @msujew would be great if I could get some timely love for this one as it's the last one scheduled for the IDE patch release.

Copy link
Member

@sdirix sdirix left a comment

Choose a reason for hiding this comment

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

This workaround fixes the main issue on my machine. However it seems to introduce other behavior changes.

See this video for changes between the latest Theia IDE and the Electron Example of this branch:

OpeningEditorsRegression.mp4

The current Theia IDE behavior is already not that great:

  • The editors are opened on the correct line on first click, however the top overlay swallows the selected text. Still the editors are "almost" correct
  • On second click the correct line is shown centered in the UI

On this branch:

  • More often than not, the editor just opens on the last line of the file which is bad behavior
  • The second click then works fine, centering the line in the UI

As this breaks just clicking on file results for me in the IDE, I would not recommend merging in this state. In both cases it would be better if the selected line would immediately be centered, just like on the second click.

Copy link
Member

@sdirix sdirix left a comment

Choose a reason for hiding this comment

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

Edit: I tested the latest master and there the same last-line issue appears. So it's not a regression of this branch, but something else on master.

As the main issue is fixed, I'll approve

Edit2: Maybe it's a me issue 🤷, I went back several Theia versions on master and still encounter this issue when running the example apps.

Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

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

I can confirm that this works as expected and does not introduce any regressions (I specifically checked the notebook integration as well, which simply behaves as usual).

@tsmaeder tsmaeder merged commit 72ca8ed into eclipse-theia:master Feb 14, 2025
11 checks passed
@github-actions github-actions bot added this to the 1.59.0 milestone Feb 14, 2025
@sdirix
Copy link
Member

sdirix commented Feb 14, 2025

We somehow overlooked a massive regression to the chat view: The input grows infinitely.

InfiniteGrow

@sdirix sdirix mentioned this pull request Feb 14, 2025
tsmaeder added a commit that referenced this pull request Feb 17, 2025
Clear model from editor when the editor is hidden

Fixes #14880

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>
pisv added a commit to 1C-Company/theia that referenced this pull request Apr 13, 2025
Reverts the fix in eclipse-theia#14909 because of significant regressions.
pisv added a commit to pisv/theia that referenced this pull request Apr 22, 2025
Reverts the fix in eclipse-theia#14909 because of significant regressions.
laemmleint pushed a commit to mvtecsoftware/theia that referenced this pull request Aug 18, 2025
Clear model from editor when the editor is hidden

Fixes eclipse-theia#14880

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Symbols in Monaco stop to be recognized and cannot be navigated to

3 participants