feat: Dynamic plugin load/unload and hide/unhide#166
Merged
Conversation
✅ Version Already UpdatedThis PR includes a manual version update to No automatic version bump needed. |
🤖 Version Auto-BumpedThe version has been automatically incremented to This commit was added to your PR branch. When you merge this PR, the new version will be included. If you want a different version, update |
CarsonDavis
reviewed
Jul 6, 2026
| * Tracks tools whose DOM container exists but whose make() has not been called | ||
| * (either startUnloaded at init, or unloaded via unloadPlugin API) | ||
| */ | ||
| const deferredTools = new Map() |
CarsonDavis
approved these changes
Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Builds on the floating-panels foundation to add a full dynamic plugin lifecycle API.
ToolControllerModern_with deferred loading (startUnloadedconfig), a reversetoolId → targetIdlookup map, hidden-state tracking, and explicitloadPlugin/unloadPluginmethods so plugins can be mounted and dismounted at runtime without a full page reloadshowPlugin,hidePlugin,loadPlugin,unloadPlugin,isPluginLoaded,isPluginHidden,showPanel, andhidePanelonmmgisAPIso external callers and other plugins can control visibility and lifecycle programmaticallyTest plan
startUnloaded: trueon a plugin; confirm it is registered as deferred andisPluginLoadedreturnsfalsemmgisAPI.loadPlugin(id)and confirm the plugin mounts andisPluginLoadedreturnstruemmgisAPI.unloadPlugin(id)and confirmdestroy()is called andisPluginLoadedreturnsfalsemmgisAPI.hidePlugin(id)/showPlugin(id)and confirm the DOM element gains/loses theplugin-hiddenclass andisPluginHiddenreflects the statemmgisAPI.hidePanel(id)/showPanel(id)on a float panel and confirm collapse/expand toggles correctlydestroyAllToolsclears the deferred registry along with all loaded toolsnpm testand confirm no regressionsNote: The Title Tool's actionButtonLink config is an easy way to test these features. Swapping its event type lets you trigger core events for showing/hiding and loading/unloading plugins