WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@MohitMaliFtechiz
Copy link
Collaborator

@MohitMaliFtechiz MohitMaliFtechiz commented Dec 4, 2025

Fixes #4515

Parent PR #4514.

Continuing from #4514

  • Migrated the BackToTop functionality to use dataStore.
  • Migrated the OpenInNewTab functionality to use dataStore.
  • Migrated the ExternalLinkPopup functionality to use dataStore.
  • Refactored the ExternalLinkOpenerTest according to dataStore.
  • Migrated the PrefWifiOnly functionality to use dataStore.
  • Migrated the Theme functionality to use dataStore.
  • Refactored the ThemeConfigTest.
  • Refactored the UI test cases to use KiwixDataStore instead of SharedPreferences.
  • Added SharedPreferenceToDatastoreMigratorTest to properly verify the migration process.

* Created the `KiwixDataStore` and `SharedPreferenceToDatastoreMigrator` classes to handle the migration of existing `SharedPreferences` data to `DataStore`.
* Migrated the currently opened ZIM file and the currently opened tab to `DataStore`.
* Migrated the `TextZoom` value to `DataStore` (the zoom level configured by the user for reading ZIM files).
* Added `DataStore` dependency in our project.
…erences`.

* Migrated the `BackToTop` functionality to use dataStore.
* Migrated the `OpenInNewTab` functionality to use dataStore.
* Migrated the `ExternalLinkPopup` functionality to use dataStore.
* Refactored the `ExternalLinkOpenerTest` according to dataStore.
* Migrated the `PrefWifiOnly` functionality to use dataStore.
@MohitMaliFtechiz MohitMaliFtechiz marked this pull request as draft December 4, 2025 11:35
@codecov
Copy link

codecov bot commented Dec 4, 2025

Codecov Report

❌ Patch coverage is 63.75546% with 83 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.79%. Comparing base (0b14cf6) to head (6fbce77).

Files with missing lines Patch % Lines
...estination/library/online/OnlineLibraryFragment.kt 20.83% 15 Missing and 4 partials ⚠️
...kiwixmobile/core/utils/datastore/KiwixDataStore.kt 64.70% 11 Missing and 7 partials ⚠️
...kiwixmobile/core/main/reader/CoreReaderFragment.kt 29.41% 3 Missing and 9 partials ⚠️
...kiwix/kiwixmobile/core/utils/ExternalLinkOpener.kt 10.00% 9 Missing ⚠️
...rg/kiwix/kiwixmobile/core/main/CoreMainActivity.kt 0.00% 6 Missing ⚠️
.../kiwixmobile/core/settings/CoreSettingsFragment.kt 20.00% 2 Missing and 2 partials ⚠️
...wix/kiwixmobile/core/settings/SettingsPresenter.kt 42.85% 4 Missing ⚠️
.../kiwixmobile/core/extensions/FragmentExtensions.kt 50.00% 1 Missing and 2 partials ⚠️
...obile/core/settings/viewmodel/SettingsViewModel.kt 93.33% 3 Missing ⚠️
...loader/downloadManager/DownloadManagerRequester.kt 60.00% 0 Missing and 2 partials ⚠️
... and 3 more

❌ Your patch check has failed because the patch coverage (63.75%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #4516      +/-   ##
============================================
- Coverage     58.96%   58.79%   -0.17%     
- Complexity     1520     1527       +7     
============================================
  Files           324      327       +3     
  Lines         17500    17627     +127     
  Branches       2179     2185       +6     
============================================
+ Hits          10318    10364      +46     
- Misses         5757     5834      +77     
- Partials       1425     1429       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

* Refactored the `ThemeConfigTest`.
…edPreferences`.

* Added `SharedPreferenceToDatastoreMigratorTest` to properly verify the migration process.
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.

Migrate the Settings screen to use DataStore instead of SharedPreferences.

3 participants