Skip to content

feat: Dynamic plugin load/unload and hide/unhide#166

Merged
CarsonDavis merged 11 commits into
developmentfrom
feat/dynamic-panel-mounting
Jul 6, 2026
Merged

feat: Dynamic plugin load/unload and hide/unhide#166
CarsonDavis merged 11 commits into
developmentfrom
feat/dynamic-panel-mounting

Conversation

@sandesh-sp

@sandesh-sp sandesh-sp commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Builds on the floating-panels foundation to add a full dynamic plugin lifecycle API.

  • Dynamic plugin load/unload: Extends ToolControllerModern_ with deferred loading (startUnloaded config), a reverse toolId → targetId lookup map, hidden-state tracking, and explicit loadPlugin / unloadPlugin methods so plugins can be mounted and dismounted at runtime without a full page reload
  • Public mmgisAPI surface: Exposes showPlugin, hidePlugin, loadPlugin, unloadPlugin, isPluginLoaded, isPluginHidden, showPanel, and hidePanel on mmgisAPI so external callers and other plugins can control visibility and lifecycle programmatically
  • actionButtonLink events: Enhances action button link handling to fire both core events and plugin-scoped events, enabling cross-plugin communication via button actions

Test plan

  • Set startUnloaded: true on a plugin; confirm it is registered as deferred and isPluginLoaded returns false
  • Call mmgisAPI.loadPlugin(id) and confirm the plugin mounts and isPluginLoaded returns true
  • Call mmgisAPI.unloadPlugin(id) and confirm destroy() is called and isPluginLoaded returns false
  • Call mmgisAPI.hidePlugin(id) / showPlugin(id) and confirm the DOM element gains/loses the plugin-hidden class and isPluginHidden reflects the state
  • Call mmgisAPI.hidePanel(id) / showPanel(id) on a float panel and confirm collapse/expand toggles correctly
  • Verify destroyAllTools clears the deferred registry along with all loaded tools
  • Confirm existing non-float panel layouts are unaffected
  • Run npm test and confirm no regressions

Note: 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

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown

✅ Version Already Updated

This PR includes a manual version update to 4.2.12-20260702

No automatic version bump needed.

@sandesh-sp sandesh-sp changed the base branch from development to feat/floating-panels June 29, 2026 18:26
@sandesh-sp sandesh-sp changed the title feat: Floating panels and dynamic plugin lifecycle API feat: Dynamic plugin load/unload and hide/unhide Jun 30, 2026
@sandesh-sp sandesh-sp changed the base branch from feat/floating-panels to development July 1, 2026 20:02
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

🤖 Version Auto-Bumped

The version has been automatically incremented to 4.2.12-20260702

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 package.json manually and push to this PR.

* 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()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we change to unloaded?

@CarsonDavis CarsonDavis merged commit f8bc531 into development Jul 6, 2026
4 checks passed
@CarsonDavis CarsonDavis deleted the feat/dynamic-panel-mounting branch July 6, 2026 17: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

Successfully merging this pull request may close these issues.

2 participants