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

Side panels sometimes open only to a very narrow width #14484

Open
cdamus opened this issue Nov 19, 2024 · 0 comments
Open

Side panels sometimes open only to a very narrow width #14484

cdamus opened this issue Nov 19, 2024 · 0 comments

Comments

@cdamus
Copy link
Contributor

cdamus commented Nov 19, 2024

Bug Description:

At start of the Theia workbench, sometimes the left/right side panels (one or the other or even both) do not restore the width that the user had last set. This even happens during a session when expanding a closed panel. See the screen grab below.

This is related to issue #5822 in that the root cause is probably in the same expansion handling code.

Steps to Reproduce:

In the default example Electron app:

  1. Select the Explorer in the left panel.
  2. Change the width of the left panel to something comfortable for your Explorer content.
  3. Collapse the left panel and expand it again.
  4. See the panel expand to an uncomfortably narrow width. If it expands normally, repeat from 2 until the problem happens. It won't take many attempts.

See the screen grab below for an illustration of the effect. The same can be reproduced in the right side panel.

Additional Information

  • Operating System: macOS 15.1 Sequoia
  • Theia Version: 1.55.0, master branch as of 19 Nov. 2024

The problem seems to me to be in the way that expansion is implemented in the refresh logic of the SidePanelHandler. It seems to rely on a two-step procedure:

  1. Render the panel at a default very narrow width, set the state to "expanding", and request a refresh.
  2. On refresh, restore the width of the panel to the most recent width that the user had set when the panel was last expanded.

The second step above is animatable by setting a duration for the expansion animation, but by default that animation is disabled by a zero duration. With or without animation, I can see the initial narrow rendering of the side panel content followed quickly by (in the normal case) a second rendering at full width.

The issue with this implementation of the expansion is that it seems sometimes to get stuck at step 1 and not actually proceed to step 2, perhaps some kind of race condition. I have not been able to pin-point the root cause. But it is instructive that there seems to be a work-around: in my Theia-based application, I set an animation duration of 50ms (1/20th of a second) in the shell options for both the left and right panels and now this problem does not seem to occur. It would seem that the extra time for the animation lets us always win the race.

CleanShot 2024-11-19 at 10 12 08

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

No branches or pull requests

1 participant