NewPipe icon indicating copy to clipboard operation
NewPipe copied to clipboard

Keep Main Fragment until user's input when searching in settings

Open VougJo23 opened this issue 6 months ago • 0 comments

Display fragment based on search text

What is it?

  • [x] Bugfix (user facing)
  • [ ] Feature (user facing)
  • [ ] Codebase improvement (dev facing)
  • [ ] Meta improvement to the project (dev facing)

Description of the changes in your PR

  • settings_preferencesearch_fragment.xml: when displaying "No Results", make screen non-clickable
  • SettingsActivity.java: Create function showMainSettingsFragment() to display main fragment without adding it to a stack Dynamically switches between PreferenceSearchFragment and MainSettingsFragment depending on the input text. Disposes of searchDisposable safely in onDestroy() to avoid memory leaks.
  • SettingsActivityTest.java: targeted tests for the new search logic by isolating SettingsActivity behavior from a full Android runtime.
  • PreferenceSearcher.java: remove checking for empty text as it is handled in the changes above

Before/After Screenshots/Screen Record

  • Before: https://github.com/user-attachments/assets/9fae3c09-f182-440f-a25e-435873475c3d
  • After: https://github.com/user-attachments/assets/1dee24a3-e29e-4fef-8c6f-495c727abe87

Fixes the following issue(s)

  • Fixes #12190

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration on this wiki page.

Due diligence

VougJo23 avatar Jun 08 '25 12:06 VougJo23