feat(plugin): uninstall + clean upgrade/reinstall of external plugins

Add an Uninstall button on installed external plugin cards that deletes
the package folder (effective next restart — the library stays resident
for the session). Reinstalling or upgrading via the marketplace now
clears any stale native library with a different name before writing the
new one, so the loader always picks the freshly installed binary.

Part of the #100 extensibility epic (phase 2).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-06-17 15:57:44 +03:00
commit 157412419e
5 changed files with 49 additions and 0 deletions

View file

@ -5699,6 +5699,24 @@ impl OpenCADStudio {
self.marketplace_status = format!("Install failed: {e}");
Task::none()
}
Message::PluginUninstall(id) => {
#[cfg(not(target_arch = "wasm32"))]
{
match crate::plugin::external::uninstall(&id) {
Ok(()) => {
self.marketplace_status =
format!("Uninstalled '{id}'. Restart to unload it.");
self.external_plugins = crate::plugin::external::discover();
}
Err(e) => {
self.marketplace_status = format!("Uninstall failed: {e}");
}
}
}
#[cfg(target_arch = "wasm32")]
let _ = id;
Task::none()
}
Message::PointStyleSetMode(mode) => {
self.set_point_mode_bits(!0, mode);
Task::none()