Skip to content

Keep other plugin panels open when one plugin is added, removed or updated - #15434

Draft
s3pp3ku wants to merge 1 commit into
omacom:quattrofrom
s3pp3ku:keep-panels-on-plugin-reload
Draft

s3pp3ku wants to merge 1 commit into
omacom:quattrofrom
s3pp3ku:keep-panels-on-plugin-reload

Conversation

@s3pp3ku

@s3pp3ku s3pp3ku commented Oct 14, 2026

Copy link
Copy Markdown

Problem

Adding, removing or updating any plugin closes every open plugin panel.

omarchy-plugin-add, -remove and -update finish with omarchy-shell shell rescanPlugins, and the plugin directory watcher triggers the same reload on any change under ~/.config/omarchy/plugins. reloadPlugins() starts with unloadPanels(), which hides every panel and clears panelEntryModel, so every panel instance is destroyed and rebuilt.

That hurts most in panels whose job is managing plugins: a plugin manager closes itself on every install, uninstall or update it performs, and a settings window loses its page and edits because an unrelated plugin updated.

The recent syncPanelEntries work already stops ordinary plugin changes from rebuilding every panel. This extends the same idea to the reload itself.

Reproduce

  1. Open a plugin panel that keeps state, such as a settings or plugin-manager panel.
  2. Run omarchy plugin remove <another plugin> --yes.
  3. The open panel closes, and reopening it starts from scratch.

Change

  • reloadPlugins(changedIds) takes an optional list of plugin ids. With ids, unloadPanelsFor(ids) tears down only those plugins' panels: it hides them and drops their panelEntryModel rows, loaders, pending payloads and open marks. Every other panel keeps its instance. Without ids it is exactly today's full reload, so rescanPlugins and other callers behave as before.
  • The directory watcher already knows which plugin changed (onLocalPluginChanged(pluginId)). It now collects ids over its 150 ms debounce and passes them on.
  • A reload requested while one is running keeps its scope: ids are merged, and any full request makes the pending reload full.
  • Services and bar widgets still reload in full, as now. Kept panels that read service get their plugin's new instance through rebindPanelServices() after _syncServices(), so they never hold a destroyed one.
  • New shell IPC method reloadPluginsFor "<id> [<id>…]". The add, remove and update scripts call it with the plugins they touched instead of rescanPlugins. It's documented in docs/omarchy-shell.md and agents/skills/shell-dev.md.

What each case does:

  • Removed plugin: its panel is torn down by id, and syncPanelEntries() doesn't re-add it.
  • Added plugin: syncPanelEntries() appends it as today.
  • Updated plugin: its panel is torn down by id, the component cache is cleared as today, and the panel is re-added from fresh code.

Not covered (deliberately small)

  • Bar widgets and services still reload in full.
  • rescanPlugins stays a full reload for callers that can't name what changed.
  • omarchy-plugin-clone still uses rescanPlugins.

Testing

Opened as a draft because it hasn't been run in a live stock shell yet.

  • Applies cleanly to quattro at d679824.
  • bash -n passes on the three scripts.
  • Qt 6 qmllint shows no new errors or warnings in shell/shell.qml. The two GlobalShortcut [required] warnings already exist on quattro.

Checks still to run in a live shell:

  • With panel A open, omarchy plugin remove B --yes leaves A open with its state, and B's panel is gone.
  • With A open, omarchy plugin update B leaves A open, and B's panel loads the new code.
  • With B open, updating B closes it, and it comes back from fresh code.
  • Editing a file in plugin A's directory reloads A and leaves other panels open.
  • omarchy-shell shell rescanPlugins still does a full reload.
  • A kept panel with a service still talks to a live service after another plugin reloads.

…dated

reloadPlugins() starts with unloadPanels(), so installing, removing or
updating any plugin closed every open plugin panel. A plugin manager closed
itself on every change it made, and a settings window lost its place because
an unrelated plugin updated.

reloadPlugins() now takes the ids that changed and tears down only their
panels; everything else keeps its instance and state. With no ids it is the
full reload it was. The directory watcher passes the plugins it saw change,
plugin add/remove/update name theirs through a new reloadPluginsFor IPC call,
and kept panels are handed their plugin's new service after the scan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant