Commit Graph

21 Commits

Author SHA1 Message Date
S Heckler bc12143015 fix(auth): recover from expired edge auth proxy sessions (#1557)
* fix(auth): recover from expired edge auth proxy sessions

The service worker answered every page load from the precached app shell, so once an edge auth
proxy's session cookie (e.g. Cloudflare Access, OAuth2 Proxy) expired, the proxy never saw the
navigation and could not redirect to its login page. The app loaded from cache, its API calls were
redirected cross-origin and failed, and it fell back to its own login screen with no way out short
of clearing site data.

Serve navigations network-first and fall back to the precached shell only when offline.
vite-plugin-pwa defaults navigateFallback to index.html, which would register a cache-only route
ahead of this one, so disable it explicitly. Cache only 200 responses so a proxy's redirect is never
stored as the page.

Request API redirects manually so a proxy redirect is detected directly and triggers a full reload,
which the proxy can then send to its login page. Cap these reloads to one per 15 seconds so a reload
answered from cache again surfaces an error instead of looping.

Fixes #642

* fix(auth): harden edge auth proxy recovery against loops and cache growth

Force manual redirects after caller options so no request can opt back into following a proxy
redirect. Skip the reload when session storage is unavailable, since the loop guard cannot work
without it. Drop the navigation network timeout so a slow proxy redirect is never replaced by the
cached page, and cap the app shell cache, which stores one entry per visited URL.

Ref #642

* test(auth): isolate useLoginOptions module state between tests

The composable keeps its cached options, error, and in-flight request at module level, so they
carried over between tests in the file. Reset the module and import it fresh for each test so a
future test cannot pass or fail depending on what ran before it.

Ref #642

* fix(auth): let edge proxy handle sign-in navigations

Keep the offline shell under a distinct precache URL so Workbox cannot serve
root navigations before the proxy sees them. Route public auth requests through
the redirect-aware fetch path so expired edge sessions open reauthentication.

Ref #642

* fix(auth): keep offline shell off root URLs

Prevent Workbox from mapping root query variants to the precached offline shell so expired proxy sessions reach the network.

---------

Co-authored-by: neon <18559658+neonsolstice@users.noreply.github.com>
2026-09-26 08:55:42 -06:00
neon e28bd67fa3 feat(cover): give books with both media separate ebook and audiobook covers
Keep one cover slot per medium and show the one each surface needs: the
library's shape for the face, square art on audio screens, the ebook slot
for Kobo and OPDS. Legacy covers convert on upgrade or on first read, and a
write that names no slot keeps working for released iOS builds. Also read
the dev client origin from one constant.
2026-09-23 19:55:25 +00:00
neon 4b86ff73cf build: move local development off port 3000
Run the dev API on 6262 and Vite on 6263 with strictPort; production
defaults stay on 3000. Define the dev client origin once and read the
typed appConfig instead of repeating its fallback in every gateway.
2026-09-23 18:18:51 +00:00
neon e0d3d42150 feat: add read-aloud and media playback support
Add EPUB narration, shared media controls, and native device session integration.

Apply the generated migrations and update all first-party clients alongside the server.

BREAKING CHANGE: introduce incompatible database and API contracts for media playback
2026-09-19 02:27:05 +00:00
neon 0d9527c048 build(deps): upgrade chokidar, pinia, and jsdom majors and drop unused deps
Move chokidar to 5, pinia to 4, and jsdom to 30 with a matching
@types/jsdom, and align packages/types on TypeScript 6 with the other
workspaces.

chokidar 5 is ESM-only while the server compiles to CommonJS. Node's
require(ESM) support covers this, verified against a live watcher and a
nest watch build rather than the mocked unit tests.

Remove @fastify/formbody and @tanstack/vue-table, neither of which had a
single caller, along with the stale @tanstack/vue-table entry in the Vite
optimizeDeps list.

Hold TypeScript at 6. typescript-eslint refuses to install alongside 7 and
vue-tsc cannot drive the native checker until the stable compiler API
lands in 7.1.

Ignore pnpm-lock.yaml in prettier so lint-staged stops rewriting it out of
pnpm's native style, which was inflating every lockfile diff to roughly
19k lines.
2026-08-16 03:52:20 +00:00
neon 25bc7a21d4 perf(dashboard): optimize random book lookups and scroller batching
Add index on books table for random dashboard scroller queries, batch dashboard scroller requests, instrument pg pool logging, and cover dashboard scroller batching in e2e tests.
2026-08-05 21:48:23 +00:00
neon 92ade7dbba i18n(client): migrate plural messages to ICU MessageFormat
Replace pipe-delimited Vue I18n plural messages with ICU MessageFormat syntax across all locale catalogs and Vue components. Configure custom message formatting and validation to enforce ICU syntax and argument parity.

Closes #792
2026-07-27 01:28:52 +00:00
Dennis van der Stelt 31bda18c9a feat(i18n): add multi-language support with Dutch translation (#500)
* feat(i18n): add vue-i18n foundation with language switcher and Dutch locale

Introduce multi-language support for the client using vue-i18n and
@intlify/unplugin-vue-i18n. Locale is detected from a stored preference
or the browser language and persisted client-first, with optional server
sync riding the existing theme-sync mechanism (new locale category on the
generic user_preferences store, no migration needed).

Adds a language selector in Appearance > Behavior settings and seeds
en/nl message catalogs. Extraction of existing hardcoded strings follows
in subsequent commits.

* feat(i18n): add full en/nl message catalogs and test/build wiring

Populate the English and Dutch message catalogs (~4300 keys) covering the
whole UI, register a vitest setup that installs vue-i18n globally so
component tests resolve real messages, and allow inline HTML in messages
(strictMessage/escapeHtml off) for notes rendered via v-html / <i18n-t>.

* feat(i18n): localize settings and book UI strings

Replace hardcoded strings with t() calls across the settings and book
feature areas (including book detail, table, metadata edit, reading log,
highlights). Label collections captured at setup are wrapped in computed()
so they react to locale changes.

* feat(i18n): localize remaining feature UI strings

Replace hardcoded strings with t() across reader, email, library, tools,
migration, dashboard, auth, hardcover, author, series, book-dock,
book-metadata-fetch, annotations, admin, statistics, collection,
smart-scope, audit, whats-new, achievements, notifications, custom-icons,
scanner and metadata-score. Reactive label maps use computed().

* feat(i18n): localize shared components and view wrappers

Replace hardcoded strings with t() across shared components (app header,
sidebar, view header, pickers, selection bar) and top-level views.

* feat(i18n): localize settings tab bars and browser page titles

Make settings tab labels reactive via t() in the consuming components and
slim the *-tabs.ts helpers to ids/order/permission only. Route the browser
page titles in the router through the app i18n instance so document.title
follows the active locale. Adds settings.<area>.tabs.* and titles.* keys.

* feat(i18n): localize KOReader hash-linking and reader sidebar pin

Localize the strings from the KOReader manual hash-linking feature and the
reader sidebar pin/close controls that were merged from main during the
rebase, adding the corresponding en/nl keys.

* feat(i18n): localize upstream features merged during rebase onto main

Add en/nl catalog keys for the new upstream functionality pulled in by the
rebase (Kobo activity log, KOReader dismiss/remove-device and hash-link
modal, default library access, upload-size settings) and update a few
existing keys whose wording changed upstream (dynamic upload-size hints,
write-and-rename phrasing).

* feat(i18n): switch language picker to a dropdown

Replace the segmented language buttons with a native select, which scales
better as more locales are added.

* feat(i18n): add German and Slovenian translations

Register de and sl in the supported locales and ship full de.json and
sl.json catalogs (4616 keys each, structural parity with en.json).

* fix(client): harden locale switching and translation coverage

Keep locale catalogs structurally aligned, localize rebased UI changes, and use locale-aware formatting. Move language selection into the header, persist authenticated preferences, and prevent stale locale loads from winning.

---------

Co-authored-by: neon <18559658+neonsolstice@users.noreply.github.com>
2026-07-12 15:07:29 -06:00
neon 870abecb01 feat(reader): polish the PDF reading experience
Make long PDF reading sessions easier to navigate across desktop and mobile. Keep document loading recoverable when EmbedPDF initializes or tears down out of order, without enabling document-editing capabilities.
2026-07-11 15:29:34 +00:00
neon 0b11583f7d fix(reader): support dynamic token-fetcher for foliate PWA caching
Implement a custom callable fetcher function in the Foliate integration that
stringifies to the current auth token. This ensures backward compatibility
for older service-worker cached versions of the Foliate library expecting a
string token, while allowing newer/uncached versions to perform authenticated
requests correctly. Additionally, exclude Foliate assets from PWA precaching
to prevent stale cache bugs on Firefox.

Closes #575
2026-07-07 16:41:20 +00:00
neon 873f890d20 fix(client): respect device orientation lock in pwa
The `orientation: 'any'` setting in the manifest forces the PWA to rotate even if the device is locked. Removing it restores native behavior.

Closes #309
2026-06-13 16:50:13 +00:00
neon c4f9b289f6 fix(client): disable pwa service worker in dev 2026-05-14 23:48:20 -06:00
neon 22ac06ecd7 feat(client): add PWA support with installability and cover caching
Add vite-plugin-pwa with Workbox in generateSW mode. Includes a web app
manifest (standalone display, shortcuts for Dashboard/Libraries/Settings),
iOS meta tags, and a service worker that pre-caches the app shell and uses
CacheFirst for book cover and thumbnail endpoints (max 200 entries, 30-day TTL).

Add useInstallPrompt composable that captures the beforeinstallprompt event
and exposes isInstallable/installApp. Wire an install button into SidebarFooter
that appears only when the browser signals the app is installable.

Generate PWA icons (64, 192, 512, maskable-512, apple-touch-icon-180) from a
new pwa-icon-source.svg using @vite-pwa/assets-generator with minimal2023Preset.
Add dev-dist to .gitignore to exclude the dev-mode SW output.
2026-05-12 20:53:21 +00:00
neon f79f810c8c fix: mobile UI bugs - overlay touch, sticky header, keyboard sheet, viewport height, reader timeout 2026-05-12 19:30:18 +00:00
neon 31b3460658 feat(kobo): restore read-status thresholds, remove two-way progress sync, fix LAN dev sync, and add fallback fraction positioning for epub/cbz/pdf readers 2026-05-11 21:23:11 +00:00
neon 4e93e20bbb feat(books): add table view, metadata export, and filter builder 2026-05-01 23:59:37 -06:00
neon cfc3672a6c refactor: rename book-bucket to book-dock and lens to smart-scope 2026-04-20 22:57:27 -06:00
neon 1dd6381325 feat(metadata): introduce provider architecture for book metadata 2026-02-19 01:55:40 -06:00
neon 73d66b75e3 feat(scanner): add live scan progress via WebSocket and auto-scan 2026-01-19 16:48:11 -06:00
neon 244d38afe8 feat(reader): add settings system with per-book delta and defaults 2026-01-16 02:00:38 -06:00
neon b4ee0cb90c feat(metadata): add cover extraction for epub, mobi, cbz, and pdf 2025-12-22 14:37:28 -06:00