eclipse-theia / generator-theia-extension

A Yeoman generator for extensions to the Theia IDE
Other
55 stars 40 forks source link

Template widget must handle focus #146

Closed JonasHelming closed 2 years ago

JonasHelming commented 2 years ago

fixed #145

Signed-off-by: Jonas Helming jhelming@eclipsesource.com

JonasHelming commented 2 years ago

Make sense, but without the fix, I get an error that the widgets was not activated. The first video is the template as is, the second with my fix. I believe this is a regression anyways, because I never experienced this issue in the template before and I use it quite frequently.

withoutfix withfix

vince-fugnitto commented 2 years ago

@JonasHelming it does not seem to happen to me at least without the fix, I don't see any code at the moment that uses the activate request for the widget.

https://user-images.githubusercontent.com/40359487/167223985-e1ca2438-fdf2-4a3a-94c1-019cf90ba72d.mov

I did a fresh build, and am using the latest version of the generator. If you can reproduce with a fresh generation can you provide steps as to how you reproduced the warning.

JonasHelming commented 2 years ago

I am also on the latest version I just:

@jfaltermeier Could you please restest this as well?

jfaltermeier commented 2 years ago

I am also on the latest version I just:

  • generated the widget extension
  • Start the browser app
  • open the template widget (view => name of the widget)
  • focus another view (e.g. the explorer)
  • focus the template widget by clicking on the tab (either the icon in the site bar on the left stack or the tab when in the main stack, both leads to the same result
  • observe the warning the the server console

@jfaltermeier Could you please restest this as well?

With those steps I can reproduce the issue when switching back to the view from the Explorer by clicking on the view's icon in the left tab bar. However when (re-)opening the view from the menu I did not get the warning (because the command uses activate: false I guess)

I've applied the proposed changes to the generated template view and this fixes the issue.

Should we maybe change the command to use activate: true as well?