[loggi-749] Move stats reorder into customize modal & fix SortableJS crash #108
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bead ID:
loggi-749Type: bug
Priority: P2
Status: closed
Close reason: Removed drag handles from stats grid cards. Moved chart reordering into the customize modal using SortableJS on the modal list. Each chart row now has a drag grip + visibility toggle. Reset to Defaults restores both visibility and order. Fixed the SortableJS crash (no multi-word classes passed). Kept SortableJS CDN script for modal use.
Problem
Bug
initSortable()instats.jspasses multi-word Tailwind classes to SortableJS options (chosenClass: "ring-2 ring-primary/40 rounded-2xl"). SortableJS internally usesclassList.add(), which throwsDOMException: DOMTokenList.add: The token can not contain whitespace. This completely breaks drag-and-drop reordering.UX
Drag handles on individual stat cards clutter the main grid and are easy to accidentally trigger on mobile. The customize modal already handles chart visibility — reordering belongs there too.
What to do
DRAG_HANDLE_HTMLusage in card builders and theinitSortable()call on the main grid.<label>elements, the whitespace class bug doesn't apply (use single-token classes or avoid custom classes).localStorageorder key (loggi-plot-order-{entryId}), just wire it to the modal list instead of the grid.<script>tag fromentry.htmlif no longer needed on the grid (it will still be needed for the modal list).Files
app/static/js/stats.js— removeinitSortable()on grid, removeDRAG_HANDLE_HTML, add sortable list toopenPlotCustomize()app/templates/entry.html— keep SortableJS CDN script (still needed for modal)Acceptance criteria
Dependencies:
loggi-2ze