You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, we’ve encountered an issue with Lumino due to a change introduced in #607. Specifically, this check in the MenuBar prevents our menus from activating:
// An empty menu cannot be activeif(value>-1&&this._menus[value].items.length===0){value=-1;}
As a result, Theia’s dynamic menus are never activated and therefore never displayed.
Workarounds
We’ve explored a few workarounds:
Patching Lumino locally via patch-package to remove the check, but this requires maintenance with every new Lumino release.
Subclassing MenuBar and overriding the activeIndex setter to bypass the check, but this requires duplicating the setter code and working around type checks on private fields.
Both approaches feel brittle and suboptimal for long-term maintenance.
Proposed Solution?
Would you be open to changes that make the MenuBar more flexible for downstream adopters like us? If so, we’d appreciate your input on the best way forward. Some potential approaches:
Removing the check entirely if it’s not critical for some other use cases
Making private fields protected in MenuBar to allow subclassing without type workarounds.
Moving the check into a separate method that subclasses can override.
Alternatively, if you have suggestions for a better way to implement dynamic menus in Theia that align more closely with Lumino's current design, I’d be very interested to hear your thoughts.
Thanks for all your work on Lumino—it’s a fantastic library, and we look forward to using it in Theia!
The text was updated successfully, but these errors were encountered:
Hi! I'm working on migrating to Lumino in Theia. We’ve previously relied on PhosphorJS, and decided to transition to Lumino.
Problem
We implemented a DynamicMenuWidget whose core functionality involves dynamically calculating its menu items just before being shown. This worked in PhosphorJS
However, we’ve encountered an issue with Lumino due to a change introduced in #607. Specifically, this check in the MenuBar prevents our menus from activating:
As a result, Theia’s dynamic menus are never activated and therefore never displayed.
Workarounds
We’ve explored a few workarounds:
patch-package
to remove the check, but this requires maintenance with every new Lumino release.activeIndex
setter to bypass the check, but this requires duplicating the setter code and working around type checks on private fields.Both approaches feel brittle and suboptimal for long-term maintenance.
Proposed Solution?
Would you be open to changes that make the
MenuBar
more flexible for downstream adopters like us? If so, we’d appreciate your input on the best way forward. Some potential approaches:MenuBar
to allow subclassing without type workarounds.Alternatively, if you have suggestions for a better way to implement dynamic menus in Theia that align more closely with Lumino's current design, I’d be very interested to hear your thoughts.
Thanks for all your work on Lumino—it’s a fantastic library, and we look forward to using it in Theia!
The text was updated successfully, but these errors were encountered: