Skip to content

feat(vault): per-user reading settings for the vault-native reader - #176

Merged
libravault-xyz merged 2 commits into
devfrom
feature/vault-phase7-reader-settings
Aug 15, 2026
Merged

libravault-xyz merged 2 commits into
devfrom
feature/vault-phase7-reader-settings

Conversation

@libravault-xyz

Copy link
Copy Markdown
Collaborator

VaultEpubReaderScreen's class doc used to call out "no per-user ReaderSettings hot-reload" as the one remaining gap versus feature:reader's EpubNavigatorView — this closes it.

What's new

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 — confirmed ReaderSettings itself isn't persisted anywhere either). Two deliberate differences:

  • 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 forward.

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 the 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 there) even though only theme is offered-but-inert for PDF, 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. Branch built directly on top of #175 (bookmarks/highlights), which has already merged — no rebase needed.

🤖 Generated with Claude Code

libravault-xyz and others added 2 commits August 15, 2026 14:58
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>
@github-actions

Copy link
Copy Markdown
Contributor

📱 iOS Build Status: FAILED

❌ iOS Simulator Build & Unit Tests - cancelled
✅ Android Core Modules - success

iOS UI tests run in a separate, informational job and are not reflected above — check "iOS UI Tests (informational)" for those.

View run details

@github-actions

Copy link
Copy Markdown
Contributor

📱 iOS Build Status: PASSED

✅ iOS Simulator Build & Unit Tests - success
✅ Android Core Modules - success

iOS UI tests run in a separate, informational job and are not reflected above — check "iOS UI Tests (informational)" for those.

View run details

@libravault-xyz
libravault-xyz merged commit d0a88ad into dev Aug 15, 2026
6 checks passed
@libravault-xyz
libravault-xyz deleted the feature/vault-phase7-reader-settings branch August 15, 2026 15:20
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