Skip to content

fix: home drawer keyboard focus trap [WPB-14804]#4907

Merged
Garzas merged 1 commit into
developfrom
fix/home-drawer-keyboard-focus-trap
Jun 8, 2026
Merged

fix: home drawer keyboard focus trap [WPB-14804]#4907
Garzas merged 1 commit into
developfrom
fix/home-drawer-keyboard-focus-trap

Conversation

@Garzas

@Garzas Garzas commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

https://wearezeta.atlassian.net/browse/WPB-14804


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

Fixed issues:

  • When the home hamburger menu was open, keyboard focus could still move to hidden background content.
  • The drawer could not be reliably closed with keyboard navigation.
  • Drawer keyboard navigation did not stay inside the drawer items and could expose hidden or stale focused drawer content.
  • An empty spacer area inside the drawer could receive focus.

Causes

The home drawer stayed composed while closed and relied mostly on default Compose focus traversal. This allowed hidden drawer content and background screen content to remain reachable depending on focus state.

The drawer item list also had no explicit forward/backward focus loop, and the spacer between top and bottom drawer items could become a focus target.

Solutions

  • Added explicit drawer focus handling and focus requesters for first/last drawer items.
  • Trapped keyboard focus inside the drawer while it is open.
  • Wrapped drawer item traversal so TAB from the last item returns to the first item, and SHIFT+TAB works in reverse.
  • Added ESC/Back handling to close the drawer from keyboard navigation.
  • Hid background screen semantics and focusability while the drawer is open.
  • Disabled drawer item click/focus semantics while the drawer is closed to avoid stale hidden focus.
  • Removed the focusable empty drawer spacer.
  • Split drawer/scaffold keyboard focus logic out of HomeScreen.kt into HomeScaffold.kt to keep the screen file smaller and easier to review.

@Garzas Garzas requested review from saleniuk and yamilmedina June 2, 2026 07:14
@Garzas Garzas self-assigned this Jun 2, 2026
@codecov

codecov Bot commented Jun 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 73 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.12%. Comparing base (baa4b99) to head (4dd8f5c).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
...in/kotlin/com/wire/android/ui/home/HomeScaffold.kt 0.00% 64 Missing ⚠️
...tlin/com/wire/android/ui/home/drawer/HomeDrawer.kt 0.00% 9 Missing ⚠️

❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4907      +/-   ##
===========================================
- Coverage    49.28%   49.12%   -0.16%     
===========================================
  Files          648      650       +2     
  Lines        22910    22983      +73     
  Branches      3503     3516      +13     
===========================================
  Hits         11291    11291              
- Misses       10572    10645      +73     
  Partials      1047     1047              
Files with missing lines Coverage Δ
...tlin/com/wire/android/ui/home/drawer/HomeDrawer.kt 0.00% <0.00%> (ø)
...in/kotlin/com/wire/android/ui/home/HomeScaffold.kt 0.00% <0.00%> (ø)

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update baa4b99...4dd8f5c. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Garzas Garzas force-pushed the fix/home-drawer-keyboard-focus-trap branch from f2d40e5 to 4dd8f5c Compare June 8, 2026 16:42
@sonarqubecloud

sonarqubecloud Bot commented Jun 8, 2026

Copy link
Copy Markdown

@Garzas Garzas enabled auto-merge June 8, 2026 16:48
@Garzas Garzas added this pull request to the merge queue Jun 8, 2026
Merged via the queue into develop with commit 5d7e15a Jun 8, 2026
19 of 20 checks passed
@Garzas Garzas deleted the fix/home-drawer-keyboard-focus-trap branch June 8, 2026 17:11
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.

3 participants