Skip to content

SA-308: add inline Search button to search bar#912

Open
gbolahan507 wants to merge 1 commit into
mainfrom
sa-308-search-button
Open

SA-308: add inline Search button to search bar#912
gbolahan507 wants to merge 1 commit into
mainfrom
sa-308-search-button

Conversation

@gbolahan507

Copy link
Copy Markdown
Collaborator

Summary

  • Adds a visible "Search" TextButton inside the search bar, between the text input and the ✕ clear button, as an alternative way to start a search (per SA-308).
  • Both the new button and the existing keyboard Enter / IME search action call the same triggerSearch() lambda, so behaviour is identical and the existing flow is preserved.
  • Button only appears when the query is non-empty (matches the mockup; avoids triggering empty searches).

Changes

  • components/MainSearchBar.kt — extracted shared triggerSearch lambda; added TextButton in the search header row.
  • res/values/strings.xml — new string search_button_label for the button label.

Test plan

  • Debug APK installed on device, app launches.
  • Open the search overlay; with text typed, "Search" button appears next to ✕ and triggers search.
  • Keyboard Enter / magnifying glass still triggers search (unchanged code path via the same lambda).
  • TalkBack reads the button label correctly.
  • Verify against both light and dark themes.

@davecraig

Copy link
Copy Markdown
Contributor

I guess I'm not wholly convinced by the UI which is not your fault, as that's what was in the ticket from the user. I can't figure out how to get to the Search button when using Talkback - you can't actually swipe to get there when the keyboard is displayed and the only way I can close the keyboard is to hit Search. The only way to get Search is to find it with your finger ('explore' with Talkback on). I'm wondering if iPhone works differently with Search? I'd like to see some other examples of a Search button like this.

Having said all that, I wouldn't have known this if we didn't have the code to try, so it's useful effort.

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.

2 participants