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

Empty hidden editors #14909

Merged
merged 3 commits into from
Feb 14, 2025
Merged

Conversation

tsmaeder
Copy link
Contributor

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
Contributor 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

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