Repository navigation
feat(reader): auto-scroll shared foundation — ReaderSettings, ReaderViewModel, Settings UI - #588
Conversation
…gs sheet
ReaderViewModel gains onAutoScrollEnabledChanged/onAutoScrollSpeedChanged
(speed clamped 0.5-3.0), and ReaderSettingsSheet gets the toggle row +
speed slider (hidden while off), with new callback params defaulted to
{} so existing call sites keep compiling. Still not wired into any
reader screen (EPUB/Markdown/PDF) — that's #5's per-format follow-ups.
2aaa6fd to
c78527f
Compare
📱 iOS Build Status: PASSED⏭️ iOS Simulator Build & Unit Tests - skipped iOS UI tests run in a separate, informational job and are not reflected above — check "iOS UI Tests (informational)" for those. |
QA verification — PR #588 vs #585Acceptance criteria (from #585)
✗ Gap: the Settings-sheet toggle ships dead in production today
The Auto-scroll row + slider also aren't gated behind any Recommend: wire What I ran
AGENTS.md conventionsTests present for all non-trivial new behaviour (pacing termination conditions, clamping, UI visibility/click), using real fakes rather than relaxed mocks — no violations found. QA verdict: FAIL |
| QA failed its first round — routing back to the dev agent for one automated retry. |
QA found the toggle/slider added in the previous commit were never connected at ReaderSettingsSheet's only production call site, so tapping "Auto-scroll" did nothing — the defaulted no-op callbacks never updated settings.autoScrollEnabled/autoScrollSpeed.
📱 iOS Build Status: PASSED⏭️ iOS Simulator Build & Unit Tests - skipped iOS UI tests run in a separate, informational job and are not reflected above — check "iOS UI Tests (informational)" for those. |
QA verification — PR #588 vs issue #585Scope check: issue #585 asks for the auto-scroll shared foundation only — Acceptance criteria
Test suiteRan the real suite in the foreground (no mocks of the runner): Every test-results XML under
Test quality (not just green)
Gap flagged per AGENTS.md (not blocking this verdict)The PR's 3rd commit ( RegressionsNo regressions found — full Commit hygieneConventional Commits format throughout, one concern per commit, no merge commits, branch is rebased cleanly on current QA verdict: PASS |
Principal review — verdict:
|
Summary
Shared foundation for auto-scroll (#5), split out as #585 after #490 hit its
120-turn cap implementing all three reader formats in one PR. This PR is
scoped to the pacing logic and Settings UI only — wired into no reader
screen. #5's three per-format issues (EPUB/Markdown/PDF) depend on this
landing first.
Closes #585
Approach
AutoScroll.kt(new) — two pacing mechanisms as plain suspend functionswith no format-specific dependencies:
ScrollableState.autoScroll(speed, onFinished)— continuous pixel-levelscroll via
scrollBy, for any format with a realScrollableState.autoAdvancePages(speed, onFinished, advancePage)— timed discrete pageturns, for formats with no continuous scroll API.
onFinished(rather than leaving the toggle silently stale)at end-of-content or when a manual gesture preempts a tick.
ReaderSettings.kt—autoScrollEnabled: Boolean = false,autoScrollSpeed: Float = 1.0f, session-only (same lifecycle asscrollMode/warmth— resets on reopen, no new persistence).ReaderViewModel.kt—onAutoScrollEnabledChanged(Boolean)/onAutoScrollSpeedChanged(Float)(speed clamped to 0.5–3.0).ReaderComponents.kt(ReaderSettingsSheet) — toggle row + speed slider(hidden while off), new callback params defaulted to
{}so existingcall sites keep compiling.
This work is salvaged from #490 (still open as a draft, not closed as
originally assumed when #585 was filed — see note below), rebased onto
current
devrather than cherry-picked, since #490 predates #505'sReaderViewModel/ReaderScreenrestructuring and is in real conflictwith
dev. Only the in-scope pieces (this PR's file list) were carriedover; the wiring into
EpubReaderScreen/MarkdownReaderScreen/PdfReaderScreenin #490 is intentionally left out — that belongs to#5's three per-format follow-ups, not here.
Note on #490's actual state
#585's body says PR #490 is "closed — see its closing comment." At the
time I looked, #490 is still open (draft, unmerged), and issue #5 is
still open with
status:in-progress. The comment referenced there is apipeline-health-check comment about the max-turns crash, not a closing
comment. This doesn't change this PR's scope, but #490 should probably be
closed by a human now that its salvageable content has landed here, to
avoid confusion about which PR is live.
Test plan
autoScroll/autoAdvancePagesterminationconditions (
AutoScrollTest.kt,FakeScrollableState-based —end-of-content, gesture-preemption, non-positive-speed cases)
ReaderViewModeltests for the new callbacks (speed clamping,toggle independence)
(visibility, click behaviour, value display)
./gradlew :feature:reader:testDebugUnitTestrun locally beforemarking ready