Add option to hide the voice search button (#1423)

## Description

Adds a "Show voice search button" toggle to the search page's view
options dialog, alongside the existing "Combined search results" toggle.
When disabled, the voice search button is hidden from the search row,
taking it out of the D-pad focus path.

The new field `show_voice_search_button` is added to `SearchPreferences`
(default `true`). The serializer applies the default for new installs,
and a new entry in `AppUpgradeHandler` sets it to `true` for users
upgrading from earlier versions so existing behaviour is preserved.

### Related issues

Discussion: https://github.com/damontecres/Wholphin/discussions/1419

### Testing

Tested on an Android TV (1080p) AVD running API 34:

- Toggle on (default): voice search button visible at the top of the
search row.
- Toggle off: button disappears; only the search text field remains.
- Toggle back on: button reappears.
- Upgrade handler verified by spoofing `version.current.name` to an
older value in SharedPreferences and force-restarting the app; after
`needUpgrade()` fired, the toggle was on as expected.

The upgrade-handler entry currently uses `0.6.4-8-g0` (based on current
`main` HEAD); happy to bump this if you'd prefer a different target
version on merge.

## Screenshots

<img width="1920" height="1080" alt="pr1-01-home"
src="https://github.com/user-attachments/assets/0d5cdad0-5547-44f3-b4a5-5d15f71dddc0"
/>
<img width="1920" height="1080" alt="pr1-02-toggled-off"
src="https://github.com/user-attachments/assets/1e574229-0838-487d-b943-83d394a8193d"
/>

## AI or LLM usage

I used Claude to scaffold the proto/serializer/upgrade-handler/dialog
changes, mirroring the existing `combined_search_results` pattern. I
reviewed each diff before committing and tested the toggle manually on
the emulator, including the upgrade-handler simulation.

---------

Co-authored-by: Damontecres <damontecres@gmail.com>
This commit is contained in:
JustinZeus 2026-05-21 21:31:17 +02:00 committed by GitHub
parent 3880e562f6
commit fa914845f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 81 additions and 18 deletions

View file

@ -168,6 +168,7 @@ message ScreensaverPreferences{
message SearchPreferences {
bool combined_search_results = 1;
bool show_voice_search_button = 2;
}
enum DisplayToggle{