Skip to content

Enhancement(reader): apply reading settings to all libraries - #404

Open
JimmyJi0309 wants to merge 1 commit into
van-geaux:mainfrom
JimmyJi0309:feat/global-reader-settings-all-libraries
Open

JimmyJi0309 wants to merge 1 commit into
van-geaux:mainfrom
JimmyJi0309:feat/global-reader-settings-all-libraries

Conversation

@JimmyJi0309

@JimmyJi0309 JimmyJi0309 commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add an Apply to all libraries action to the reader options sheet so users can copy the current reading profile (theme, typography, spacing, margins, alignment, hyphenation, layout mode, and reader behavior) to every library at once.

Behavior

  • Shown for EPUB, PDF, and comic readers at the end of the reading configuration sheet.
  • Opens a confirmation dialog because it replaces the reading settings of every library.
  • Copies the current normalized LibraryReaderPreferences to:
    • every library profile already stored;
    • the current library;
    • a default fallback profile used by libraries that have never been opened.
  • Libraries with an explicit profile continue to take precedence over the default fallback.
  • Shows a localized success toast after saving.
  • The action is optional (onApplyToAllLibraries is nullable) so surfaces that do not support bulk application do not show the control.

Implementation

  • AppPreferences.withReaderPreferencesForAllLibraries(...) writes the normalized profile to all known library keys plus DEFAULT_READER_PROFILE_KEY.
  • AppPreferences.readerPreferencesFor(...) falls back to the default profile for unopened libraries.
  • The EPUB, PDF, and comic readers pass their current preferences through the new callback.
  • New localized strings cover the section label, confirmation dialog, and success message.
  • Unit tests cover copying to known libraries and the fallback, fallback resolution, and explicit profile precedence.

Verification

  • ./gradlew testDebugUnitTest lintDebug assembleDebug assembleDebugAndroidTest — passed
  • JVM: 1,337 tests, 0 failures
  • lint: 0 errors
  • Localization validator: passed
  • No existing per-library profile or reader behavior changes unless the new action is confirmed

Notes

This does not replace the per-library editor in Options → Library; that surface edits one library, while this action broadcasts the current profile. The fallback profile also lets libraries opened later inherit the broadcast settings.

Close #403

- Add an Apply to all libraries action to EPUB, PDF and comic reader options.
- Copy the current reader profile to every known library and to a default
  fallback profile used by libraries that have not been opened yet.
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.

Enhancement: apply reader settings to all libraries at once

1 participant