diff --git a/apps/desktop/src/components/plugins/PluginContributionsPanel.vue b/apps/desktop/src/components/plugins/PluginContributionsPanel.vue index c7f34e1ea8..9a5f7df240 100644 --- a/apps/desktop/src/components/plugins/PluginContributionsPanel.vue +++ b/apps/desktop/src/components/plugins/PluginContributionsPanel.vue @@ -15,6 +15,7 @@ import { useToast } from "@/composables/useToast"; import PluginShortcutSettings from "./PluginShortcutSettings.vue"; import PluginIcon from "@/components/plugins/PluginIcon.vue"; import PluginAiAccessSection from "@/components/plugins/PluginAiAccessSection.vue"; +import PluginGraphicsEngineSection from "@/components/plugins/PluginGraphicsEngineSection.vue"; import * as api from "@/lib/backend/api"; import { clearPluginIconCache } from "@/lib/plugins/pluginIconResolver"; import { loadPinnedPluginIds, savePinnedPluginIds, sortPluginsPinnedFirst } from "@/lib/plugins/pluginPinning"; @@ -43,6 +44,7 @@ import { formatBytes } from "@/lib/database/serverMetrics"; import type { PluginCenterFocus } from "@/lib/plugins/pluginCenterNavigation"; import { useConnectionStore } from "@/stores/connectionStore"; import { useQueryStore } from "@/stores/queryStore"; +import { useSettingsStore } from "@/stores/settingsStore"; import type { InstalledPlugin, PluginInstallResult, PluginRepository, PluginRepositoryCatalogResult, PluginTrustedKey } from "@/types/database"; import { useI18n } from "vue-i18n"; import { safeLocalStorageGet, safeLocalStorageSet } from "@/lib/backend/safeStorage"; @@ -84,6 +86,15 @@ const { t, locale: appLocale } = useI18n(); const { toast } = useToast(); const connectionStore = useConnectionStore(); const queryStore = useQueryStore(); +const settingsStore = useSettingsStore(); + +// A reinstall must start without consent: drop any graphics-engine (unsafe-eval) grant +// when the plugin is uninstalled, mirroring the backend's forget_plugin_permissions. +function forgetGraphicsEngineGrant(pluginId: string) { + const granted = settingsStore.editorSettings.pluginGraphicsEngineIds; + if (!granted.includes(pluginId)) return; + settingsStore.updateEditorSettings({ pluginGraphicsEngineIds: granted.filter((id) => id !== pluginId) }); +} const activeSection = ref<"marketplace" | "installed" | "settings">("marketplace"); const installedPlugins = ref([]); const trustedKeys = ref([]); @@ -653,6 +664,7 @@ async function runBatchUninstall() { (definition) => definition.plugin.manifest.name, async (definition) => { await api.uninstallPlugin(definition.plugin.manifest.id); + forgetGraphicsEngineGrant(definition.plugin.manifest.id); }, (definition) => definition.plugin.manifest.id, ); @@ -1034,6 +1046,7 @@ async function uninstallSelectedPlugin() { operating.value = true; try { applyInstalledPlugins(await api.uninstallPlugin(definition.plugin.manifest.id)); + forgetGraphicsEngineGrant(definition.plugin.manifest.id); retireBatchFailure(definition.plugin.manifest.id); notifyComponentUpdatesChanged(); window.dispatchEvent(new CustomEvent("dbx:plugins-changed")); @@ -1569,6 +1582,8 @@ onBeforeUnmount(() => { + +