Skip to content

Focus search input on navigation reselection - #3071

Open
coyaSONG wants to merge 6 commits into
recloudstream:masterfrom
coyaSONG:fix/search-nav-reselection-focus
Open

Focus search input on navigation reselection#3071
coyaSONG wants to merge 6 commits into
recloudstream:masterfrom
coyaSONG:fix/search-nav-reselection-focus

Conversation

@coyaSONG

@coyaSONG coyaSONG commented Jul 15, 2026

Copy link
Copy Markdown

Summary

  • focus the search input when the already-selected Search navigation item is selected again
  • use requestFocusFromTouch() without a separate explicit IME request
  • limit the behavior to PHONE layouts so TV/emulator navigation keeps its existing focus behavior
  • leave first-time Search navigation and existing search state unchanged

Risk containment

  • the focus request only runs when both the current and selected destinations are Search
  • the existing 400 ms navigation debounce remains in place
  • TV/emulator layouts are explicitly covered by the negative regression case

Validation

  • git diff --check
  • regression coverage for phone Search reselection, TV Search reselection, first Search selection, and non-Search reselection
  • repository CI: ABI compatibility, assemblePrereleaseDebug, lint, stable/prerelease unit tests, and full check passed (123 Gradle tasks)
  • CI run: https://github.com/recloudstream/cloudstream/actions/runs/33270550765

The requested API 23 device check remains the final manual validation item; the author environment does not have an Android SDK/emulator, so this is intentionally not claimed as completed.

AI assistance: OpenAI Codex. The contribution was rechecked against the current README, Gradle configuration, and pull-request workflows before the update.

Closes #3070

@KingLucius

Copy link
Copy Markdown
Contributor

@KingLucius

Copy link
Copy Markdown
Contributor

Can we use requestFocusFromTouch() ?

@coyaSONG
coyaSONG marked this pull request as ready for review July 15, 2026 13:21
@KingLucius

KingLucius commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Please study requestFocusFromTouch() as I know it's focusing the search text and open the keyboard, no need for other code to open the keyboard

@fire-light42

Copy link
Copy Markdown
Collaborator

Please be super careful with focus as we have had issues with this before (#1195). It is recommended to test this on api23 devices to make sure nothing weird happens.

@coyaSONG

Copy link
Copy Markdown
Author

Updated the PR on current master in 909a00c0 and narrowed the focus behavior to PHONE layouts only. The implementation now relies solely on requestFocusFromTouch(), keeps the existing debounce, and adds four regression cases covering phone reselection, TV reselection, first navigation, and non-Search reselection.

The full repository CI is green (ABI, APK assembly, lint, stable/prerelease unit tests, and check): https://github.com/recloudstream/cloudstream/actions/runs/33270550765

I do not have an Android SDK/emulator in the author environment, so I have not claimed the requested API 23 device validation. Could a maintainer with an API 23 device/emulator please confirm that Search reselection opens the keyboard, leaving Search dismisses it normally, and it does not reopen unexpectedly?

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.

[UX Improvement] Focus searchbar when tapping search navigation item twice

3 participants