feat(sacred-valley): drag-to-reorder with server-persisted layout

Adds HTML5 drag-to-reorder for .sv-card elements in Sacred Valley. The
pure moveId helper is unit-tested. Drop calls PUT /api/dashboard/layout
to persist the new card_order; DOM reflects the new order immediately.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
root
2026-06-02 22:39:57 +10:00
parent 01177a2cbd
commit e368ea41d8
4 changed files with 53 additions and 1 deletions

View File

@@ -63,6 +63,7 @@ function promptForToken() {
export const api = {
get: (p) => call('GET', p),
post: (p, body) => call('POST', p, body ?? {}),
put: (p, body) => call('PUT', p, body ?? {}),
patch: (p, body) => call('PATCH', p, body ?? {}),
del: (p) => call('DELETE', p),
setToken: (v) => localStorage.setItem(TOKEN_KEY, v),