Skip to content

feat: reader enhancements, history, tag management, cache controls - #21

Merged
patrick3399 merged 5 commits into
mainfrom
feat/reader-history-tags-cache
Mar 8, 2026
Merged

feat: reader enhancements, history, tag management, cache controls#21
patrick3399 merged 5 commits into
mainfrom
feat/reader-history-tags-cache

Conversation

@patrick3399

Copy link
Copy Markdown
Owner

Summary

  • Reader: scale modes (fit-width/height/original), reading direction (LTR/RTL/TTB), auto-advance timer, status bar, pinch-to-zoom, help overlay with tap zone guide
  • History: standalone browse history page (/history) with full CRUD API + sidebar/mobile nav links
  • Tags: autocomplete search, translation support, blocked/filtered tags with server-side filtering in library + EH search
  • Cache: view Redis cache stats and clear by category from settings page
  • Backend APIs: EH popular, toplists, comments (read-only), saved searches CRUD, blocked tag filtering

Known Gaps (follow-up PR)

  • Browse page: Popular / TopLists / Language filter tabs (backend ready, no UI)
  • Browse page: Saved Searches quick-apply UI (backend ready, no UI)
  • Gallery detail: Comments display section (backend ready, no UI)
  • History recording triggers — api.history.record() never called
  • Subscriptions (訂閱列表) — not implemented
  • Bug: api.ts expects { searches: [] } but backend returns { items: [] } for saved searches

Changed Files

Area Files Lines
Backend models + DB db/models.py, db/init.sql +96
Backend routers eh.py, history.py, library.py, search.py, system.py, tag.py +613
Backend services eh_client.py +85
Frontend Reader hooks.ts, index.tsx, types.ts +983/-111
Frontend pages history/page.tsx, settings/page.tsx, browse/[gid]/[token]/page.tsx +465
Frontend lib api.ts, types.ts, i18n.ts +230
Frontend components TagAutocomplete.tsx, Sidebar.tsx, MobileNav.tsx +198
Frontend hooks useGalleries.ts, useTagTranslations.ts +59

Test Plan

  • Reader: verify scale mode switching (fit-width → fit-height → original)
  • Reader: verify RTL reading direction swaps tap zones and page order
  • Reader: enable auto-advance in settings, confirm timer works
  • Reader: enable status bar in settings, confirm page/time display
  • Reader: pinch-to-zoom on mobile, double-tap reset
  • Reader: tap "?" to see help overlay
  • History: browse a gallery, check /history page shows entry
  • Tags: type in autocomplete field, verify suggestions appear
  • Tags: add blocked tag in settings, verify filtered from search results
  • Cache: view cache stats in settings, clear cache
  • Deploy: docker compose build api worker pwa && docker compose up -d

🤖 Generated with Claude Code

patrick3399 and others added 5 commits March 8, 2026 16:17
CRITICAL:
- Remove token_plain from ApiToken model (no more plaintext in DB)
- Fix Dockerfile chmod 777 → 750 for /app/config
- Add path traversal validation in gallery delete
- Fix symlink bypass in import with os.path.realpath()
- Validate PID cmdline before signaling (race condition fix)

HIGH:
- Reorder download enqueue: ARQ first, then DB insert (atomicity)
- Wrap sync file I/O in asyncio.to_thread() in library delete
- Add pre-backup + --single-transaction to restore script
- Add config permission comments in docker-compose.yml
- Fix login page race condition with AbortController
- Deduplicate 401 redirects with isRedirecting flag
- Add retry logic for reader progress save failures

MEDIUM:
- Add Redis rate limiting (10/min) on external download endpoint
- Atomic file writes for thumbnails and gallery-dl config
- BFS cycle detection for tag implications (was 1-hop only)
- Fix SW caching 401 responses + add offline fallback page
- Add SSR guards for localStorage in browse page
- Await mutate() calls in queue page error handling
- Add disable_symlinks to nginx media locations
- Move nginx cache from /tmp to /var/cache/nginx

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…trols

Reader: scale modes, reading direction (LTR/RTL/TTB), auto-advance timer,
status bar, pinch-to-zoom, help overlay with tap zone guide.

History: standalone browse history page with record/list/delete/clear API.

Tags: autocomplete search, translation support, blocked/filtered tags with
server-side filtering in both library and EH search results.

Cache: view stats and clear Redis cache categories from settings page.

Backend APIs: EH popular, toplists, comments (read-only), saved searches CRUD.

Known gaps (follow-up): browse page Popular/TopLists/Language tabs, saved
search UI, comments display, history recording triggers, subscriptions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- history.py: add COUNT(*) query so frontend pagination works correctly
- search.py: change response key from "items" to "searches" to match frontend type

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reader:
- Fix auto-advance showing loading spinner on cached images (150ms debounce)
- Fix webtoon thumbnail click not scrolling to target page
- Replace TTB with vertical tap mode (top=prev, middle=menu, bottom=next)
- Toolbar: split into 3 rows, add safe-area-inset-top for PWA, X close button

Browse:
- Persist page/tab/favcat/search in URL params for back-navigation
- Save/restore scroll position via sessionStorage
- Floating back button (bottom-right) for mobile ergonomics
- LazyImage with IntersectionObserver for browse thumbnails

Backend:
- Thumb-proxy: add asyncio.Semaphore(4) to limit concurrent CDN requests
- Library: fix _get_blocked_tag_strings to use injected db session
- Tests: add blocked_tags table to SQLite test schema (fixes 6 failures)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…e URL

- Backend: normalize declared cell heights per sprite URL (use max height)
  to fix cover pages (150px) vs normal pages (278px) inconsistency
- Backend: add new regex for 2024+ EH preview HTML format
- Backend: add hath.network CDN to allowed thumb proxy hosts
- Frontend: switch from cover scaling (Math.max) to width-based scaling
  to eliminate black rectangles and cell bleeding artifacts
- Frontend: remove loading="lazy" from thumbnails in overflow containers
- Frontend: fix browse pagination feedback loop (watch urlQ only)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@patrick3399
patrick3399 merged commit 0faae73 into main Mar 8, 2026
2 of 4 checks passed
@patrick3399
patrick3399 deleted the feat/reader-history-tags-cache branch March 8, 2026 11:16
@patrick3399
patrick3399 restored the feat/reader-history-tags-cache branch March 8, 2026 11:16
@patrick3399
patrick3399 deleted the feat/reader-history-tags-cache branch March 9, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant