Collapsible locations tree, sorting mode, and drag selection fix

The Locations page now shows only top-level locations by default; rows
with children get a caret that reveals sub-locations inline, indented
under their parent in the same table style.

Rearranging is gated behind a new "Sorting mode" toggle next to "Show
removed locations": when enabled, rows can be dragged onto another
location (or a drop strip to move to top level). The same toggle
appears on container array pages and gates drawer drag-to-swap. The
state persists across reloads so it survives post-move refreshes.

Dragging no longer selects text: drawer trays and draggable cards get
user-select: none, the drawer drag suppresses selection globally for
its duration, and mousedown on a tray prevents native selection.

Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
lucioandClaude Fable 5 committed 2026-06-10 22:47:08 -07:00
1 parent fa78bb02d4
commit 20c982755a
9 files changed
+273 -19

No files matched your search

@@ -30,11 +30,17 @@
<div class="folder-controls" style="margin-top: 1rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;">
{{if .IsAuthenticated}}
<div style="display: flex; gap: 0.5rem; align-items: center;">
<div style="display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap;">
<label class="checkbox-container" style="display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; font-weight: 500; color: var(--color-text-muted); cursor: pointer;">
<input type="checkbox" id="toggle-removed-checkbox" {{if .ShowRemoved}}checked{{end}} onchange="toggleShowRemoved(this)" style="accent-color: var(--color-brand-primary); cursor: pointer;">
{{T "folder.show_removed"}}
</label>
{{if .DrawerGrid}}
<label class="checkbox-container" style="display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; font-weight: 500; color: var(--color-text-muted); cursor: pointer;">
<input type="checkbox" class="sorting-mode-toggle" onchange="toggleSortingMode(this)" style="accent-color: var(--color-brand-primary); cursor: pointer;">
{{T "locations.sorting_mode"}}
</label>
{{end}}
</div>
{{end}}