* The issue occurred because when moving to another fragment, the `ReaderScreen` remained in the backstack and was not fully destroyed along with its data. Additionally, we were storing the `SearchItem` and `FIND_IN_PAGE` query in variables to perform these actions after restoring tabs. As a result, when reopening the `ReaderScreen`, the tabs were restored, and these variables retained their values, triggering the related actions again.
* To fix this, we have cleared these variables when the fragment is destroyed, as keeping them is unnecessary when the user navigates away from the reader screen.
* The getExternalFilesDirs method only returns the USB path for devices running Android 9 (API 28) and below.
* On Android 10 (API 29) and above, this method returns null when accessing external storage like USB sticks.
* To work around this limitation, we previously appended the /mnt/media_rw/ path manually. While this worked in most cases, it was unreliable across different devices, as the mounted path could vary.
* To ensure accurate retrieval of external storage paths, we have switched to the StorageService API.
* This API, introduced in Android 11 (API 30), directly provides the actual mount paths for all external storage devices, including SD cards, USB sticks, and external hard drives.
* For Android 9 and below, getExternalFilesDirs continues to work as expected, so we use it where applicable.
* This improvement ensures that USB and SD card paths are retrieved correctly on modern Android devices.
* Added debugging logs to capture errors when opening a file in the reader.
* These logs will help us diagnose issues when users share a diagnostic report.
* Displaying a proper error message with the full ZIM path when there is an issue opening the ZIM file or if the selected file is not a valid ZIM file.
* Refactored `CopyMoveFileHandlerTest` to align with this change.
* Updated the documentation to help translators understand this update.
* To resolve the lint error, all string files have been updated. These files will be automatically updated in the latest TranslateWiki PR.
* Preserved search query across lifecycle changes to restore it when the fragment becomes visible again.
* Previously, when the device went to sleep, `viewLifecycleOwner` closed the search view due to lifecycle events, resetting the search.
* Now, the query is stored in `ViewModel` (which is lifecycle-aware) and restored when the online library screen is reopened.
* Search is reset only when the user explicitly clears it.
* Resolved the issue where the main page of the ZIM file was not loading when a note was opened from the notes screen, when a different ZIM file was set in the reader. Now, when opening notes, the application correctly sets the corresponding ZIM file in the reader, ensuring the main page is displayed as expected.
* Improved restoration of web view history after opening a searched article.
* Refactored `restoreViewStateOnValidJSON` and `restoreViewStateOnInvalidJSON` methods to save and retrieve web view history from the Room database.
* Added detailed comments to methods for better understanding, including guidance for developers to check subclass implementations before making modifications.
* Fixed the `static analysis` errors.
* Moved shortcut creation to `lifecycleScope` with `Dispatchers.IO` to free up the main thread.
* This ensures the UI remains responsive while shortcuts are being created.