diff --git a/templates/admin_library.templ b/templates/admin_library.templ
index 2811a1f..2b2203c 100644
--- a/templates/admin_library.templ
+++ b/templates/admin_library.templ
@@ -151,10 +151,18 @@ templ AdminLibrary(user User, libraries []LibraryData, users []User, archivedCou
@Icon("close", "h-5 w-5")
-
+
Are you sure you want to delete ?
- This will remove the library and all its folder mappings. Media files will not be deleted.
+
+
+ Permanently removed, no archive or undo:
+ the library, its folder mappings, and all book records — with their reading progress, highlights, notes, bookmarks, and ratings.
+
+
+ Not touched: media files on disk.
+
+
Cancel
@@ -201,6 +209,15 @@ templ AdminLibrary(user User, libraries []LibraryData, users []User, archivedCou
htmx.process(content);
document.getElementById('folder-browser-modal').classList.remove('hidden');
}
+ // Close the delete-library modal after a successful delete: the
+ // htmx swap already removes the deleted row from the libraries
+ // list, but the modal lives outside the swapped container and
+ // would otherwise stay open.
+ document.getElementById('delete-library-confirm').addEventListener('htmx:afterRequest', function(evt) {
+ if (evt.detail.successful) {
+ document.getElementById('delete-library-modal').classList.add('hidden');
+ }
+ });