Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: FIND_IN_PAGE feature only works with first tab page. #4201

Merged
merged 5 commits into from
Feb 1, 2025

Conversation

MohitMaliFtechiz
Copy link
Collaborator

@MohitMaliFtechiz MohitMaliFtechiz commented Jan 30, 2025

Fixes #4200

  • The previously loaded article was not loading in custom apps when switching to another fragment and then returning to the reader screen. Instead, the home page of the ZIM file was loading. A fix has been implemented to resolve this issue.
  • Added test cases for custom apps to cover this scenario and prevent future errors.
  • Refactored some deprecated methods used in test cases.
  • Improved the logic for handling search-related operations to ensure they are performed after tabs are fully restored.
  • Previously, the search observation was initiated before the tabs were restored, causing the FIND_IN_PAGE feature to only work in the first tab. This happened because the webView list was empty at the time of observation.
  • With the ZIM file opening and tab restoration now moved to background threads, the search observation logic has been moved to after the tabs are restored. This ensures that all webViews are properly initialized before observing search actions.
  • This approach is more robust and aligns with the correct lifecycle of tab restoration and search functionality.
  • Fixed: The SearchFragmentTestForCustomApp was failing sometimes. See https://github.com/kiwix/kiwix-android/actions/runs/13069386299/job/36467529496
screen-20250131-141856.mp4

@MohitMaliFtechiz MohitMaliFtechiz marked this pull request as draft January 30, 2025 12:00
Copy link

codecov bot commented Jan 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.87%. Comparing base (a6a3843) to head (a9364d5).
Report is 10 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #4201      +/-   ##
============================================
- Coverage     56.90%   56.87%   -0.04%     
+ Complexity     1541     1540       -1     
============================================
  Files           313      313              
  Lines         13513    13515       +2     
  Branches       1695     1695              
============================================
- Hits           7690     7687       -3     
- Misses         4654     4659       +5     
  Partials       1169     1169              

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

@MohitMaliFtechiz MohitMaliFtechiz marked this pull request as ready for review January 31, 2025 10:11
* The previously loaded article was not loading in custom apps when switching to another fragment and then returning to the reader screen. Instead, the home page of the ZIM file was loading. A fix has been implemented to resolve this issue.
…uture errors.

* Refactored some deprecated methods used in test cases.
* Improved the logic for handling search-related operations to ensure they are performed after tabs are fully restored.
* Previously, the search observation was initiated before the tabs were restored, causing the `FIND_IN_PAGE` feature to only work in the first tab. This happened because the webView list was empty at the time of observation.
* With the ZIM file opening and tab restoration now moved to background threads, the search observation logic has been moved to after the tabs are restored. This ensures that all webViews are properly initialized before observing search actions.
* This approach is more robust and aligns with the correct lifecycle of tab restoration and search functionality.
@kelson42 kelson42 merged commit 6e3ceac into main Feb 1, 2025
28 of 29 checks passed
@kelson42 kelson42 deleted the Fixes#4200 branch February 1, 2025 11:09
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.

FIND_IN_PAGE feature only works with first tab page.
3 participants