From c545b1b92e736fa3d726bd937a1e74f18a7f2d3f Mon Sep 17 00:00:00 2001 From: Sulthan Zaki Date: Thu, 6 Aug 2026 03:34:41 +0700 Subject: [PATCH] chore: address final review must-fix items --- backend/AGENTS.md | 13 +++++++------ backend/internal/web/static/logo.svg | 4 ++-- userscript/AGENTS.md | 4 ++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/backend/AGENTS.md b/backend/AGENTS.md index 1530929..300657b 100644 --- a/backend/AGENTS.md +++ b/backend/AGENTS.md @@ -49,10 +49,10 @@ Guidance for OpenCode (and Claude Code) working under `backend/`. See root `AGEN cooldown instead of retrying every tick, and writes go through `Store.Get` + `Store.Upsert` so new chapter never reorders list. Fetches use `bogdanfinn/tls-client` with Chrome profile as defence in depth - against fingerprint-based blocking; any failure log and skip. kagane sits - behind a Cloudflare JavaScript challenge the TLS client can't clear, so it is - browser-only: fetched over CDP via `BROWSER_WS_URL`, and simply not polled - when that's unset. See + against fingerprint-based blocking; any failure log and skip. kagane and + novelfull sit behind Cloudflare JavaScript challenges the TLS client can't + clear, so they are browser-only: fetched over CDP via `BROWSER_WS_URL`, and + simply not polled when that's unset. See `docs/superpowers/specs/2026-07-26-server-latest-chapter-polling-design.md`. Poller's `Store.Get` + `Store.Upsert` not wrapped in transaction, so userscript `PUT` that commits between the two can get overwritten by @@ -77,5 +77,6 @@ Guidance for OpenCode (and Claude Code) working under `backend/`. See root `AGEN (background latest-chapter poller; defaults on, `1h`/`10m`/`14`/`20s`). `USERSCRIPT_PATH` (file served at `/u/{token}/manga-bookmark.user.js`, default `/userscript/manga-bookmark.user.js`, supplied by bindmount). - `BROWSER_WS_URL` (headless-shell CDP endpoint for kagane; unset disables - browser polling and leaves that site to the userscript alone). + `BROWSER_WS_URL` (headless-shell CDP endpoint for kagane and novelfull; + unset disables browser polling and leaves those sites to the userscript + alone). diff --git a/backend/internal/web/static/logo.svg b/backend/internal/web/static/logo.svg index 8571fba..6034eb4 100644 --- a/backend/internal/web/static/logo.svg +++ b/backend/internal/web/static/logo.svg @@ -1,5 +1,5 @@ - - mangaBookmark + + BookmarkManager diff --git a/userscript/AGENTS.md b/userscript/AGENTS.md index 6428d10..6c9e9c3 100644 --- a/userscript/AGENTS.md +++ b/userscript/AGENTS.md @@ -3,10 +3,10 @@ Guidance for OpenCode (and Claude Code) working under `userscript/`. See root `A ### Userscript structure (single IIFE, `manga-bookmark.user.js`) 1. **Site adapters** — one per host, `detect(location, document)` return page `type` + IDs. Identify type/IDs from **URL regex** (most stable); pull `title`/`cover` from **`og:title`/`og:image` meta tags**, not CSS classes. -2. **API client** — `apiGet/apiPut/apiDelete` with bearer header; `localStorage` key `mangabm:cache` for instant render + offline fallback. +2. **API client** — `apiGet/apiPut/apiDelete` with bearer header; `localStorage` key `bmgr:manga:cache` for instant render + offline fallback. 3. **Progress logic** — auto-upsert `last_chapter` only when `chapterNum >= stored last_chapter_num` (re-reading old chapters must not regress progress; unparseable -> set current). Manual panel override forces any value. 4. **Retry queue** — every write go through `pushBookmark`/`pushDelete`, so - failed mutation park in `localStorage` (`mangabm:queue`) and replayed on + failed mutation park in `localStorage` (`bmgr:manga:queue`) and replayed on next navigation, reconnect, or `refresh()`. Entries are markers (`{key, op, sendStatus, attempts}`), never payloads — body read from cache at send time, so one entry per key give ordering and coalescing for