From b1de0da5125345c710204b1e1ffe585624c60ef1 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Wed, 7 Oct 2026 19:51:59 -0400 Subject: [PATCH] feat(web): dashboard All Libraries view saves the global scope MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The All Libraries entry in the library switcher could render the cross-library dashboard but rejected its own settings: the modal refused to open without a library ('Select a specific library...') and a save sent library_id: '' (server 400). The server now stores a global scope (separate table; null/absent library_id, empty string still 400), so: - openDashboardSettings allows the All view and fetches prefs without the library param (reads the global row; previously a loose NULL OR-clause matched an arbitrary library's row). - saveDashboardSettings sends library_id: null from All Libraries. - The settings modal gains a scope label (#dashboard-scope-label) showing which library — or All Libraries — a save will customize (user requirement: always know the scope). Verified end-to-end in headless Chromium: reorder on All Libraries → save (null) → reload → modal re-opens with the persisted order and the All Libraries scope label; per-library save lands in its own row without touching global (SQL-checked). --- templates/dashboard.templ | 1 + templates/dashboard_templ.go | 16 ++++++++-------- web/src/dashboard.ts | 31 ++++++++++++++++++++----------- 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/templates/dashboard.templ b/templates/dashboard.templ index 4f967f22..7d261b6d 100644 --- a/templates/dashboard.templ +++ b/templates/dashboard.templ @@ -172,6 +172,7 @@ templ DashboardSettingsModal(sections []handlers.SectionData, hiddenCollections

Customize Dashboard

Drag to reorder, toggle to show or hide.

+