From 4ceb1cbc0384f7ca39514c85db2cdb272996213e Mon Sep 17 00:00:00 2001 From: Owen Date: Mon, 17 Aug 2026 15:24:32 -0500 Subject: [PATCH] Replace on-screen action buttons with right-click context menus The tree and main panels now behave like a native file manager: right click (or the keyboard Menu key) on a folder, asset, breadcrumb crumb, or empty tree/panel background brings up the relevant actions instead of a row of always-visible buttons. - New generic showContextMenu() in app.js with per-target-kind menu builders (folder/asset/tree background/panel background), gated by admin role the same way the old buttons were. - Removed: the "..." tree-row action button, and the New Folder/Add Asset/Rename/Delete/Edit/Move/Duplicate/Import/Export buttons from the inventory toolbar and every panel. Expand All/Collapse All shrank to two icon-only buttons next to the search box; everything else creation- or mutation-related is right-click only. - Replaced the per-asset embedded "Move" modal with one shared #moveAssetModal populated via a new GET /app/folders/options endpoint, since move can now be triggered from any asset row, not just its own detail view. - Breadcrumb crumbs (including the current folder) and folder/asset table rows are now valid right-click targets too, not just tree rows. --- internal/web/folderoptions.go | 6 +- internal/web/handlers_folders.go | 11 + internal/web/handlers_inventory.go | 11 +- internal/web/router.go | 1 + web/static/css/app.css | 36 +-- web/static/js/app.js | 292 ++++++++++++++++------ web/templates/pages/inventory.html | 14 +- web/templates/partials/breadcrumb.html | 2 +- web/templates/partials/modals.html | 22 ++ web/templates/partials/panel_asset.html | 56 +---- web/templates/partials/panel_folder.html | 21 +- web/templates/partials/panel_root.html | 15 +- web/templates/partials/tree_children.html | 5 - 13 files changed, 299 insertions(+), 193 deletions(-) diff --git a/internal/web/folderoptions.go b/internal/web/folderoptions.go index b24e25a..e6eb243 100644 --- a/internal/web/folderoptions.go +++ b/internal/web/folderoptions.go @@ -5,9 +5,9 @@ import "context" // FolderOption is a flattened, indented folder choice for + + -
- - - {{if .User.IsAdmin}} - - {{end}} -
+
Right-click the tree to add, rename, or delete.
+ + +