From 1a07635605da64b2efb2b612cf8d977f0bf7e2e2 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Mon, 17 Aug 2026 14:28:09 -0400 Subject: [PATCH] feat(reader): confirm bookmark creation with a success toast MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 🏷️ bookmark button (and the 'b' shortcut) saved silently — an accidental click gave no reaction at all. addBookmark() now shows a short success toast ('Bookmark added — ') using the existing toast system, which the reader bundle hadn't been importing. Importing it also activates the shared fetch interceptor, so failed reader API calls (incl. bookmark saves) surface error toasts instead of being swallowed. --- web/src/reader/reader.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/web/src/reader/reader.ts b/web/src/reader/reader.ts index e4bd301..223b700 100644 --- a/web/src/reader/reader.ts +++ b/web/src/reader/reader.ts @@ -4,6 +4,7 @@ import { Overlayer } from "@bookhoard/foliate-js/overlayer.js"; import { Alpine } from "../alpine"; import { loadSettings, saveSettings } from "./settings-manager"; import { getToken } from "../storage"; +import { showToast } from "../toast"; import { extractPdfPages, searchPdfPages, @@ -1959,9 +1960,16 @@ document.addEventListener("alpine:init", () => { }), }, ); - if (resp.ok) await this.refreshBookmarks(); + if (resp.ok) { + await this.refreshBookmarks(); + showToast( + `Bookmark added — ${this.progressText || "current position"}`, + "success", + 2500, + ); + } } catch (_e) { - /* ignore bookmark errors for now */ + /* network failures surface via the toast fetch interceptor */ } }, async deleteBookmark(id: string) {