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.
This commit is contained in:
Owen
2026-08-17 15:24:32 -05:00
parent 218687a1ee
commit 4ceb1cbc03
13 changed files with 299 additions and 193 deletions
+4 -10
View File
@@ -2,19 +2,13 @@
<div class="inventory-shell d-flex">
<aside id="tree-pane" class="tree-pane border-end d-flex flex-column">
<div class="p-2 border-bottom">
<div class="input-group input-group-sm mb-2">
<div class="input-group input-group-sm">
<span class="input-group-text"><i class="bi bi-search"></i></span>
<input type="search" id="tree-search" class="form-control" placeholder="Search inventory&hellip;">
<button class="btn btn-outline-secondary" id="btn-expand-all" title="Expand all folders"><i class="bi bi-arrows-expand"></i></button>
<button class="btn btn-outline-secondary" id="btn-collapse-all" title="Collapse all folders"><i class="bi bi-arrows-collapse"></i></button>
</div>
<div class="d-flex gap-1 flex-wrap">
<button class="btn btn-sm btn-outline-secondary" id="btn-expand-all" title="Expand all folders"><i class="bi bi-arrows-expand"></i> Expand</button>
<button class="btn btn-sm btn-outline-secondary" id="btn-collapse-all" title="Collapse all folders"><i class="bi bi-arrows-collapse"></i> Collapse</button>
{{if .User.IsAdmin}}
<button class="btn btn-sm btn-primary ms-auto" id="btn-new-root-folder" data-parent-id="" title="New top-level folder">
<i class="bi bi-folder-plus"></i>
</button>
{{end}}
</div>
<div class="form-text">Right-click the tree to add, rename, or delete.</div>
</div>
<div class="tree-scroll flex-fill overflow-auto">
<ul class="tree list-unstyled mb-0" id="tree-root">