Skip to content

[PM-36376] fix: Clear folder and owner dropdown lag after a card scan - #7353

Merged
andrebispo5 merged 2 commits into
mainfrom
PM-36376-folders-dropdown-menu-lags
Sep 3, 2026
Merged

andrebispo5 merged 2 commits into
mainfrom
PM-36376-folders-dropdown-menu-lags

Conversation

@andrebispo5

@andrebispo5 andrebispo5 commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

๐ŸŽŸ๏ธ Tracking

https://bitwarden.atlassian.net/browse/PM-36376

๐Ÿ“” Objective

  • Scanning a card auto-focuses the cardholder name field, so the keyboard is up. Tapping
    the folder dropdown then made the sheet stutter on its way in.
  • The folder and owner selectors now clear focus first, like the "Add field" button in
    this screen already does.
  • Added two regression tests. Both fail without the fix.

@github-actions github-actions Bot added app:password-manager Bitwarden Password Manager app context t:bug Change Type - Bug labels Sep 3, 2026
@andrebispo5
andrebispo5 marked this pull request as ready for review September 3, 2026 16:59
@andrebispo5
andrebispo5 requested review from a team and david-livefront as code owners September 3, 2026 16:59
Copilot AI lite review requested due to automatic review settings September 3, 2026 16:59
@github-actions

github-actions Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

๐Ÿค– Bitwarden Claude Code Review

Overall Assessment: APPROVE

This is a narrowly scoped UI bug fix that clears focus before the folder and owner bottom sheets open in VaultAddEditContent, plus two regression tests. I verified the root cause: BitwardenTextSelectionButton renders its inner TextField with enabled = false, so tapping it never steals focus from the previously focused cardholder name field โ€” leaving the soft keyboard to animate away while the sheet animates in. Both bottom-sheet triggers on this screen (FolderSelection and OwnerSelection) are covered by the fix, LocalFocusManager.current is read at composable scope rather than inside the lambdas, and the approach matches the existing VaultAddEditCustomFieldsButton pattern in the same package. The two new tests follow the conventions of the adjacent folder/owner tests and assert focus state before and after the click.

Code Review Details

No findings.

Notes considered and intentionally not raised as findings:

  • Moving focusManager.clearFocus() into BitwardenTextSelectionButton would cover all selection buttons at once, but the component has 9 call sites across the app, so that would alter behavior at 7 unrelated places. The call-site approach here matches the established pattern in VaultAddEditCustomFieldsButton.kt:71-75.
  • The two new onClick lambdas are identical; at two occurrences in one file this is not worth extracting.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

๐ŸŸข Approval recommended

The change is narrowly scoped to the reported UI issue and is backed by targeted regression tests that would fail without the focus-clearing behavior.

Pull request overview

Fixes a UI stutter on the Vault Add/Edit screen by clearing focus (and therefore dismissing the soft keyboard) before presenting the Folder and Owner selection UI, which is particularly noticeable after a card scan auto-focuses the cardholder name field.

Changes:

  • Clear Compose focus before opening the Folder picker bottom sheet.
  • Clear Compose focus before opening the Owner selector bottom sheet.
  • Add regression tests asserting focus is cleared when tapping Folder/Owner selectors after focusing the cardholder name field.
File summaries
File Description
app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditItemContent.kt Clears current focus before triggering folder/owner selection actions to avoid keyboard + bottom sheet animation contention.
app/src/test/kotlin/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditScreenTest.kt Adds regression tests verifying the focused CardholderName field loses focus when Folder/Owner selectors are tapped.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

๐Ÿ’ก Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@codecov

codecov Bot commented Sep 3, 2026 •

Copy link
Copy Markdown

Codecov Report

โœ… All modified and coverable lines are covered by tests.
โœ… Project coverage is 85.99%. Comparing base (952431d) to head (6a7d1a7).
โš ๏ธ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7353      +/-   ##
==========================================
- Coverage   86.18%   85.99%   -0.19%     
==========================================
  Files         900      982      +82     
  Lines       66138    68348    +2210     
  Branches    10144    10220      +76     
==========================================
+ Hits        57001    58778    +1777     
- Misses       5560     5971     +411     
- Partials     3577     3599      +22     
Flag Coverage ฮ”
app-data 18.12% <0.00%> (-0.12%) โฌ‡๏ธ
app-ui-auth-tools 18.95% <0.00%> (+0.16%) โฌ†๏ธ
app-ui-platform 16.81% <0.00%> (+0.49%) โฌ†๏ธ
app-ui-vault 27.71% <100.00%> (+0.58%) โฌ†๏ธ
authenticator 6.00% <0.00%> (-0.02%) โฌ‡๏ธ
lib-core-network-bridge 4.04% <0.00%> (-0.01%) โฌ‡๏ธ
lib-data-ui 1.19% <0.00%> (-0.01%) โฌ‡๏ธ

Flags with carried forward coverage won't be shown. Click here to find out more.

โ˜” View full report in Codecov by Harness.
๐Ÿ“ข Have feedback on the report? Share it here.

๐Ÿš€ New features to boost your workflow:
  • โ„๏ธ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • ๐Ÿ“ฆ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@andrebispo5

Copy link
Copy Markdown
Contributor Author

@david-livefront Thanks!

@andrebispo5
andrebispo5 added this pull request to the merge queue Sep 3, 2026
Merged via the queue into main with commit b1d6d6b Sep 3, 2026
32 checks passed
@andrebispo5
andrebispo5 deleted the PM-36376-folders-dropdown-menu-lags branch September 3, 2026 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app:password-manager Bitwarden Password Manager app context t:bug Change Type - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants