Skip to content

Add option to hide the voice search button#1423

Merged
damontecres merged 7 commits into
damontecres:mainfrom
JustinZeus:fea/voice-search-toggle
May 21, 2026
Merged

Add option to hide the voice search button#1423
damontecres merged 7 commits into
damontecres:mainfrom
JustinZeus:fea/voice-search-toggle

Conversation

@JustinZeus

@JustinZeus JustinZeus commented May 21, 2026

Copy link
Copy Markdown
Contributor

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: #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

pr1-01-home pr1-02-toggled-off

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.

JustinZeus and others added 2 commits May 21, 2026 13:01
Adds a toggle to SearchPreferences (`show_voice_search_button`,
default true) and a new entry in the search page's view options
dialog. When disabled, the voice search button is hidden from
the search row.

For existing users, an entry in AppUpgradeHandler sets the value
to true so the button stays visible after upgrade.

@damontecres damontecres left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! Left a couple minor comments

Comment thread app/src/main/java/com/github/damontecres/wholphin/ui/main/SearchPage.kt Outdated
Comment thread app/src/main/res/values/strings.xml Outdated
@damontecres damontecres added the user interface Related to the user interface label May 21, 2026
JustinZeus and others added 3 commits May 21, 2026 20:06
Switch the voice search button toggle to AnimatedVisibility with a
horizontal expand/shrink from the start, matching the pattern used
elsewhere (NavDrawer now-playing). Rename show_voice_search_button_on/off
to visible_ui/hidden_ui so the labels can be reused by other toggles.
@JustinZeus

Copy link
Copy Markdown
Contributor Author

Thanks for the suggestions. Is this what you had in mind? @damontecres

@damontecres damontecres left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I pushed a tweak to the animation.

There's also a focus problem, but it'll require some rewriting, so I'll do it in a follow up PR Edit: actually it was a lot easier than I expected, so I pushed the fix

@JustinZeus

JustinZeus commented May 21, 2026

Copy link
Copy Markdown
Contributor Author

Thanks! I'm new to Kotlin and Android development. This project has amazed me in it's quality and prompted me to switch from Plex to Jellyfin. I'm a tech lead by day (web dev, CI/CD), so I felt obligated to do my part and try to help out. Thanks for the patience and acceptance.

@damontecres

Copy link
Copy Markdown
Owner

I'm glad you like it! And super happy you're making it even better!

Since you're new to kotlin & android, let me elaborate on the changes I made.

First, I just think the fade and shrinking towards End looks better.

Second, moving the padding to the individual row elements instead using the Row's spacedBy means when the voice button disappears, the Row doesn't abruptly have to drop the spacing between the elements. Instead the padding shrinks/expands with the button!

Finally, the focus issue happened when opening the search page if you have the voice button hidden, focus might jump to the nav drawer. This is because initially the button is always shown (the initial value was true) and then it's updated, so it focused on the button which then disappears so the focus is lost. Instead, it can use the initial value from the userPreferences (which will be up to date) passed in and collect any further changes to that.

Hopefully all that makes sense

@damontecres damontecres merged commit fa91484 into damontecres:main May 21, 2026
2 checks passed
@JustinZeus

Copy link
Copy Markdown
Contributor Author

Thanks for the explanations! Funny how quickly you managed to find and fix a bug like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

user interface Related to the user interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants