From 929a3c8c3cfd60369a3ddb0bbf83442502e4d8cd Mon Sep 17 00:00:00 2001 From: Robert Helewka Date: Thu, 18 Jun 2026 23:03:47 -0400 Subject: [PATCH] fix(library): expose Delete control for Daedalus-managed libraries in UI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The backend already allows admin delete of a workspace-scoped Library via the shared delete_library_cascade (commit 142e967), and the confirm-delete page carries the Daedalus caution. But the detail template was never updated to match: the Delete button stayed hardcoded `disabled` for any library with a workspace_id, and the banner said "Do not delete it manually." So the working route was unreachable from the UI — admins still could not clear an orphaned Library blocking workspace re-registration. Make Delete an unconditional enabled link to library:library-delete (the confirm page already warns), and rewrite the workspace banner to describe the escape hatch (deleting here removes embedded content; Daedalus recreates and re-embeds on the next sync) instead of forbidding it. Template-only change; no view/model/migration changes. Co-Authored-By: Claude Opus 4.8 --- .../library/templates/library/library_detail.html | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/mnemosyne/library/templates/library/library_detail.html b/mnemosyne/library/templates/library/library_detail.html index 2f81567..c9484c1 100644 --- a/mnemosyne/library/templates/library/library_detail.html +++ b/mnemosyne/library/templates/library/library_detail.html @@ -25,14 +25,7 @@
Edit - {% if library.workspace_id %} - - {% else %} Delete - {% endif %}
@@ -43,8 +36,11 @@
This library was created for Daedalus workspace {{ library.workspace_id }}. - Items here are owned by the workspace; deleting the workspace in - Daedalus will remove this library. Do not delete it manually. + Normally you manage it from Daedalus. Deleting it here removes its + embedded content from Mnemosyne, but the source files still live in + Daedalus — it will be recreated and re-embedded on the next sync. + Use Delete to clear an orphaned library that is blocking workspace + re-registration.