How can a Theia command dynamically update its UI? #15450
Unanswered
Mark7790
asked this question in
Improvements
Replies: 1 comment
-
Hey @Mark7790, as mentioned in my last comment on the other issue #15428 (reply in thread), please create a feature request for this. In there, adopters and contributors can discuss different ways of accomplishing this. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
See discussion 15428.
For example, regarding the command's isEnabled, our current requirement is that when the mouse hovers over the menu, and a message returned by an interface arrives, the menu's enabled/disabled state is determined based on the message's return value.
Using the unregister-and-reregister approach, even if the mouse stays hovered and the command is reregistered, the UI won't update dynamically—only clicking again will reflect the latest value. However, I don’t want that. I want the menu state to update in real time via asynchronous means while the mouse remains hovered over it.
The above is the same requirement as mine, and it also wants this kind of result. There are quite a few needs like this in Theia. May I ask how to achieve this? What methods are available to make it work like this: when the mouse stays on the menu, it asynchronously updates the isEnable of the menu commands in real time through an interface to enable or disable the menu?
my need is similar to the one mentioned below. That is, the mouse is always hovering over the menu. For example, its isEnabled is true (enabled). There is an external timer that dynamically changes this value to false (disabled). The premise is that the mouse is always hovering over the menu. This is the question I asked: Is it possible to asynchronously update the UI of the menu command? Because currently it is synchronous, and the menu can only be interacted with after it is clicked and the menu is closed, then it can be clicked again. But my requirement is to keep it open and continuously hover. It seems that there is no way to achieve this. So, should this be achieved only with styles, or is there another way to implement this functionality?
Beta Was this translation helpful? Give feedback.
All reactions