Skip to content

Add Backup & restore, harden whole-page scan, rewrite README and docs - #31

Merged
smnexstudio merged 1 commit into
mainfrom
feature/readme-backup-scan-fixes
Nov 18, 2026
Merged

smnexstudio merged 1 commit into
mainfrom
feature/readme-backup-scan-fixes

Conversation

@smnexstudio

Copy link
Copy Markdown
Owner

What this changes

Adds Backup & Restore to Settings, allowing users to export and restore sites, glossaries, pronouns, series notes and translation notes through a validated JSON backup. Restore safely merges existing data in a single Room transaction without deleting anything or including API keys or other settings.

Includes fixes to the whole-page scanning workflow, following #29 (feature originally contributed by @marufmoinuddin), a complete README rewrite, and documentation updates verified against the current implementation.

Backup & Restore

  • Uses Android Storage Access Framework (CreateDocument / OpenDocument), requiring no storage permissions.
  • Validates backup files before confirmation (4 MB limit, format, version and record counts).
  • Merges data transactionally, updating matching sites, glossary terms and notes while preserving unrelated records.
  • Validates site URLs through WebUrl.https and enforces existing text-length limits.
  • Excludes API keys and all other application settings.

Whole-page scan fixes

  • Cancelling a scan returns to the original reading position; touching the page preserves the current position.
  • MissingKey, QuotaExceeded and PackMissing terminate scanning immediately.
  • Transient failures retry twice with 2s and 4s delays.
  • Advances stops only after actual scroll progress and detects lazy-loaded content at the bottom.
  • Hides the scan menu option until a reader configuration is available.

Documentation

  • Rewrote README
  • Rewrote , Audited and corrected ARCHITECTURE, FLOW, DETECTION_AND_OCR, MEMORY_USAGE, TESTING and TRANSLATION_QUALITY against the codebase.
  • Added the missing core:pipeline section to TESTING.md.
  • Updated PRIVACY.md and documentation test counts.

Localization

  • All new UI strings are included in all 16 supported languages..

How it was checked

Automated tests

  • ./gradlew testDebugUnitTest :core:model:test
  • 879 tests passed.
  • New tests:
    • AppBackupTest – 9 tests
    • SettingsBackupTest – 5 tests
    • PageScanPlanTest – 17 tests

Additional checks

  • No API keys, URLs or page text added to logs.
  • No database schema changes.
  • Debug APK built successfully.

Checklist

  • The base branch is main, and the branch is up to date with it.
  • New test classes are listed in docs/TESTING.md.
  • New behaviour has unit tests.
  • New text is included in all 16 language files.
  • No rendering or database schema changes requiring version bumps.
  • No keys, page URLs or page text in logs; no machine paths in the repository.
  • Manual phone check: create a backup, delete a site, and restore it.

@github-actions

Copy link
Copy Markdown

✅ Unit tests: PASS

879 of 879 passed · line coverage 59.2% (logic 68.1%, Compose UI 46.0%) · branch coverage 43.8%

Full HTML report (expected vs actual for every test) · Workflow run

Module Tests Passed Failed Skipped Lines Logic UI Branches
app 21 21 0 0 13.7% 5.1% 19.9% 14.3%
core/data 100 100 0 0 86.0% 86.0% – 63.4%
core/engine 151 151 0 0 78.3% 78.3% – 64.2%
core/model 73 73 0 0 92.0% 92.0% – 47.8%
core/ocr 45 45 0 0 45.8% 45.8% – 41.4%
core/pipeline 27 27 0 0 69.5% 69.5% – 47.3%
core/render 62 62 0 0 85.9% 85.9% – 67.8%
core/ui 18 18 0 0 42.2% 73.9% 39.1% 38.9%
feature/browser 67 67 0 0 19.7% 27.2% 0.0% 19.3%
feature/library 16 16 0 0 89.4% 100.0% 88.2% 68.2%
feature/settings 58 58 0 0 83.0% 77.1% 84.7% 55.6%
feature/studio 241 241 0 0 50.6% 68.0% 35.9% 36.6%

JVM unit tests (testDebugUnitTest, :core:model:test). Instrumented tests need a device and are not run in CI. Compose UI = files declaring @Composable functions; the rest, view models included, is logic.
Commit 7daa5cc.

@smnexstudio
smnexstudio merged commit bbbcb6b into main Nov 18, 2026
2 checks passed
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