Skip to content

fix(mobile): Library scroll + stale shelves; reader long-press word gate#389

Merged
mrviduus merged 1 commit into
mainfrom
fix/mobile-library-scroll-stale
Jun 23, 2026
Merged

fix(mobile): Library scroll + stale shelves; reader long-press word gate#389
mrviduus merged 1 commit into
mainfrom
fix/mobile-library-scroll-stale

Conversation

@mrviduus

Copy link
Copy Markdown
Owner

Two mobile fixes (PM → architect → engineer → adversarial QA → fix cycle).

Library tab

  • Scroll — the whole body now scrolls (the shelves carousels moved into the FlatList ListHeaderComponent; empty states use a ScrollView; safe-area bottom padding so the last row clears the tab bar + floating "+").
  • Stale shelves — deleted/changed books lingered in "Continue reading"/"Recently added" because a 60s module-level cache wasn't invalidated. Now clearLibraryShelvesCache() bumps a version + notifies subscribers (useSyncExternalStore-style), so the live carousel refetches immediately — not only on refocus. Covers remove-from-library, delete-upload, mark-complete/uncomplete, cancel-upload, and pull-to-refresh.

Reader — long-press word gate

The word action (translation/Explain sheet + auto-TTS) used to fire on a light ≤350ms tap, causing accidental translations and wasted LLM tokens. Now:

  • Fires only on a deliberate ~450ms long-press with <8px drift (haptic on engage).
  • Quick tap on a word is swallowed (0 sheets, 0 LLM calls); quick tap on empty space still toggles the reading bars.
  • touchcancel clears the timer (no ghost WordCard after an interrupted gesture); a drag past 16px after engage releases the selection-suppression window so native multi-word selection still works.
  • Coachmark copy → "Press and hold a word". Mobile-only (injected readerHtml.ts); no web/reader-overlay change.

Verification

  • apps/mobile tsc --noEmit clean; packages/shared vitest 149 green.
  • Adversarial QA pass applied (touchcancel blocker, live-refresh, missed mutation sites, multi-select interference, dead-band all fixed).
  • On-device validation owed (WebView not e2e-drivable): interrupted-gesture (no ghost card), native multi-word selection extend, in-tab delete → carousel updates without leaving the tab, haptic on engage, 450ms feel in scroll mode.

🤖 Generated with Claude Code

Library: whole body scrolls (shelves -> FlatList header + safe-area padding);
deleted/changed books no longer linger in shelves — 60s cache now invalidates
via pub/sub so the live carousel refetches immediately (not only on refocus),
covers remove/delete/complete/cancel + pull-to-refresh.

Reader: word action (translate/Explain + TTS) now fires only on a deliberate
~450ms long-press with <8px drift; quick tap on a word is swallowed (no LLM
spend), quick tap on empty space toggles bars. touchcancel clears the timer;
drag releases native multi-word selection; haptic on engage. Coachmark copy
-> "press and hold".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mrviduus mrviduus merged commit 36ad75a into main Jun 23, 2026
5 checks passed
@mrviduus mrviduus deleted the fix/mobile-library-scroll-stale branch June 23, 2026 02:28
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