Skip to content

feat: add hardware keyboard navigation from input fields - WPB-14697 - #5085

Open
acv-w wants to merge 1 commit into
developfrom
fix/hardware-keyboard-navigation-WPB-14697
Open

feat: add hardware keyboard navigation from input fields - WPB-14697#5085
acv-w wants to merge 1 commit into
developfrom
fix/hardware-keyboard-navigation-WPB-14697

Conversation

@acv-w

@acv-w acv-w commented Jul 30, 2026

Copy link
Copy Markdown
Contributor
TaskWPB-14697 [iOS] Keyboard trapped in input field #55

Issue

Moves focus out of the message composer and conversation search when Tab is pressed, while preserving VoiceOver behavior. Conversation list cells are now keyboard-focusable.


Checklist

  • Title contains a reference JIRA issue number like [WPB-XXX].
  • Description is filled and free of optional paragraphs.
  • Adds/updates automated tests.

UI accessibility checklist

If your PR includes UI changes, please utilize this checklist:

  • Make sure you use the API for UI elements that support large fonts.
  • All colors are taken from WireDesign.ColorTheme or constructed using WireDesign.BaseColorPalette.
  • New UI elements have Accessibility strings for VoiceOver.

@acv-w
acv-w requested review from a team, David-Henner and caldrian and removed request for a team July 30, 2026 16:41
@caldrian
caldrian requested a review from Copilot July 30, 2026 16:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR improves hardware keyboard navigation in the app’s conversation UI by ensuring Tab can move focus out of text input fields (message composer and conversation search) and by making the conversation list focusable via the focus engine.

Changes:

  • Enabled focus on the conversation list UICollectionView to allow keyboard focus on list content.
  • Intercepted Tab in the conversation search bar to resign first responder and trigger a focus update.
  • Added preferredFocusEnvironments overrides for both the conversation list and the input bar to steer focus out of active text fields toward appropriate UI controls.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
wire-ios/Wire-iOS/Sources/UserInterface/ConversationList/ListContent/ConversationListContentController/ConversationListContentController.swift Enables focus on the conversation list collection view for keyboard navigation.
wire-ios/Wire-iOS/Sources/UserInterface/ConversationList/Container/ConversationListViewController+UISearchBarDelegate.swift Handles Tab key in the search bar to move focus out of the search field.
wire-ios/Wire-iOS/Sources/UserInterface/ConversationList/Container/ConversationListViewController.swift Adds focus-environment preference to direct focus to the conversation list when leaving search.
wire-ios/Wire-iOS/Sources/UserInterface/Conversation/InputBar/ConversationInputBarViewController+UITextViewDelegate.swift Updates Tab handling in the composer to trigger focus updates before leaving the text view.
wire-ios/Wire-iOS/Sources/UserInterface/Conversation/InputBar/ConversationInputBarViewController/ConversationInputBarViewController.swift Adds focus-environment preference to route focus to send/auxiliary buttons when leaving the composer.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +22 to +34
func searchBar(
_ searchBar: UISearchBar,
shouldChangeTextIn range: NSRange,
replacementText text: String
) -> Bool {
guard text == "\t" else { return true }

let focusEnvironment = navigationController ?? self
focusEnvironment.setNeedsFocusUpdate()
focusEnvironment.updateFocusIfNeeded()
searchBar.searchTextField.resignFirstResponder()
return false
}
Comment on lines +312 to +316
override var preferredFocusEnvironments: [any UIFocusEnvironment] {
guard navigationItem.searchController?.searchBar.searchTextField.isFirstResponder == true else {
return super.preferredFocusEnvironments
}

Comment on lines 86 to 90
if text == "\t" {
setNeedsFocusUpdate()
updateFocusIfNeeded()
textView.resignFirstResponder()
UIAccessibility.post(
Comment on lines +195 to +199
override var preferredFocusEnvironments: [any UIFocusEnvironment] {
guard isViewLoaded, inputBar.textView.isFirstResponder else {
return super.preferredFocusEnvironments
}

Comment on lines 151 to 155

collectionView.alwaysBounceVertical = true
collectionView.allowsFocus = true
collectionView.allowsSelection = true
collectionView.allowsMultipleSelection = false
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Test Results

1 941 tests   1 914 ✅  2m 56s ⏱️
  304 suites     27 💤
    1 files        0 ❌

Results for commit cdea14f.

Summary: workflow run #30562635224
Allure report (download zip): html-report-32512-fix_hardware-keyboard-navigation-WPB-14697

@github-actions

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 30 days with no activity. Please update it or close it in case is not relevant anymore.

@github-actions github-actions Bot added the stale label Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants