Repository navigation
feat(vault): per-user reading settings for the vault-native reader - #176
Merged
Merged
Conversation
VaultEpubReaderScreen's class doc used to say "no per-user ReaderSettings hot-reload" was the one remaining gap versus feature:reader's EpubNavigatorView — this closes it. New VaultReaderSettings (theme/fontSize/fontFamily/lineSpacing), a private duplicate of feature:reader's ReaderSettings with the same defaults and session-only behavior (nothing persisted; resets every time the reader screen opens, exactly matching the regular reader). Two differences, both deliberate: - No scrollMode field: the vault PDF reader has only one rendering mode (continuous scroll, from Phase 5b) — no second paginated implementation exists to switch to, so a scroll-mode control would toggle nothing. Building that second mode is out of scope here. - No marginScale: ReaderSettings declares one but never wires it to any UI control — not a gap worth carrying over. VaultReaderViewModel gains a `settings` StateFlow plus onThemeChanged/onFontSizeChanged (clamped 0.8–2.0)/onFontFamilyChanged/ onLineSpacingChanged (clamped 1.0–2.5) — same shape as ReaderViewModel's own settings block. VaultEpubReaderScreen applies settings at initial fragment creation and hot-reloads on change via navigator.submitPreferences(...), same LaunchedEffect(settings, navigator) pattern (and same reasoning for why it's keyed on both) as feature:reader's EpubNavigatorView. New VaultReaderSettingsSheet: same shape as feature:reader's ReaderSettingsSheet over VaultReaderSettings, minus the scroll-mode row. Wired into VaultReaderScreen's top bar for both formats — PDF still gets the settings icon (matching the regular reader, which also shows it for PDF) even though only theme is inert-but-offered there, same as upstream's existing behavior for real PDFs. Tests: - feature:vault — VaultReaderViewModelTest gained 5 cases (defaults, each onXChanged updates only its own field, both clamp ranges). New VaultReaderSettingsSheetUiTest (Robolectric/Compose) covers showFontControls gating and the current theme rendering selected. Full jvm-tests.yml task set + lint run clean locally. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…odel, SECURITY.md, parity table Small follow-up to #175/#176/this PR's own work — the encrypted vault manifest asset rows in docs/threat-model.md and SECURITY.md still only listed "highlights" among vault manifest contents, not "bookmarks" (added in #175). Also updated docs/ios-android-feature-parity.md's Encrypted Vaults row to reflect the now-fuller Android vault reader feature set, and linked the two follow-up issues (#177 audio bookmarks, #178 paginated vault PDF mode) filed for the scope reductions made along the way. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
📱 iOS Build Status: FAILED❌ iOS Simulator Build & Unit Tests - cancelled iOS UI tests run in a separate, informational job and are not reflected above — check "iOS UI Tests (informational)" for those. |
Contributor
📱 iOS Build Status: PASSED✅ iOS Simulator Build & Unit Tests - success iOS UI tests run in a separate, informational job and are not reflected above — check "iOS UI Tests (informational)" for those. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
VaultEpubReaderScreen's class doc used to call out "no per-userReaderSettingshot-reload" as the one remaining gap versusfeature:reader'sEpubNavigatorView— this closes it.What's new
New
VaultReaderSettings(theme/fontSize/fontFamily/lineSpacing) — a private duplicate offeature:reader'sReaderSettingswith the same defaults and session-only behavior (nothing persisted; resets every time the reader screen opens, exactly matching the regular reader — confirmedReaderSettingsitself isn't persisted anywhere either). Two deliberate differences:scrollModefield: the vault PDF reader has only one rendering mode (continuous scroll, from Phase 5b) — no second paginated implementation exists to switch to, so a scroll-mode control would toggle nothing. Building that second mode is out of scope here.marginScale:ReaderSettingsdeclares one but never wires it to any UI control — not a gap worth carrying forward.VaultReaderViewModelgains asettingsStateFlowplusonThemeChanged/onFontSizeChanged(clamped 0.8–2.0)/onFontFamilyChanged/onLineSpacingChanged(clamped 1.0–2.5) — same shape asReaderViewModel's own settings block.VaultEpubReaderScreenapplies settings at initial fragment creation and hot-reloads on change vianavigator.submitPreferences(...), sameLaunchedEffect(settings, navigator)pattern (and the same reasoning for why it's keyed on both) asfeature:reader'sEpubNavigatorView.New
VaultReaderSettingsSheet: same shape asfeature:reader'sReaderSettingsSheetoverVaultReaderSettings, minus the scroll-mode row. Wired intoVaultReaderScreen's top bar for both formats — PDF still gets the settings icon (matching the regular reader, which also shows it there) even though only theme is offered-but-inert for PDF, same as upstream's existing behavior for real PDFs.Tests
feature:vault—VaultReaderViewModelTestgained 5 cases (defaults, eachonXChangedupdates only its own field, both clamp ranges). NewVaultReaderSettingsSheetUiTest(Robolectric/Compose) coversshowFontControlsgating and the current theme rendering selected.Full
jvm-tests.ymltask set +lintrun clean locally. Branch built directly on top of #175 (bookmarks/highlights), which has already merged — no rebase needed.🤖 Generated with Claude Code