fix(plugins): refresh workbench tabs after install and rollback

This commit is contained in:
U1 authored and GitHub committed 2026-09-18 21:31:38 +08:00
1 parent f033e50ef5
commit 6be8d5544e
6 files changed
+159 -5

No files matched your search

@@ -11,6 +11,7 @@ export function useTauriEvents(deps: {
openAiConfigDeepLink: (url: string) => Promise<void>;
openPluginInstallDeepLink: (url: string) => Promise<void>;
closeActiveSurface: () => void;
refreshPluginWorkbenches: (pluginId: string) => void;
}) {
const connectionStore = useConnectionStore();
const queryStore = useQueryStore();
@@ -168,6 +169,13 @@ export function useTauriEvents(deps: {
listen("dbx-close-active-tab", () => {
deps.closeActiveSurface();
}).then((unlisten) => unlistenHandles.push(unlisten));
// A plugin was installed/rolled back from its already-replaced runtime:
// open workbench tabs still render the previous UI bundle until they
// reload, so hand them the new identity to pick up.
listen<{ pluginId: string; version: string }>("plugin-runtime-replaced", (event) => {
if (event.payload?.pluginId) deps.refreshPluginWorkbenches(event.payload.pluginId);
}).then((unlisten) => unlistenHandles.push(unlisten));
})
.catch(() => {});
}