[PR #3660] [MERGED] PM-10094: Disable double-navigation by default #4322

Closed
opened 2025-11-26 23:42:54 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/3660
Author: @shannon-livefront
Created: 7/31/2024
Status: Merged
Merged: 8/1/2024
Merged by: @shannon-livefront

Base: mainHead: PM-10094-fix-double-navigation


📝 Commits (2)

  • a00c9ca PM-10094: Disable double-navigation by default
  • 349b837 PR feedback

📊 Changes

4 files changed (+29 additions, -8 deletions)

View changed files

app/src/main/java/com/x8bit/bitwarden/ui/platform/base/util/BackgroundEvent.kt (+8 -0)
📝 app/src/main/java/com/x8bit/bitwarden/ui/platform/base/util/EventsEffect.kt (+12 -0)
📝 app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditViewModel.kt (+4 -4)
📝 app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/itemlisting/VaultItemListingViewModel.kt (+5 -4)

📄 Description

🎟️ Tracking

PM-10094

📔 Objective

Nearly everywhere that navigation is possible in the app, rapidly double-clicking on the navigation button would cause the navigation action to happen twice, which would either stack two new views on top of each other or, in the case of rapidly navigating back too many times, break the view entirely. This PR fixes that issue by ignoring events that occur when the view is not resumed by default.

IMPORTANT NOTE: There is a new interface called BackgroundEvent that non-navigation events should conform to if there is a chance they might occur (and should be processed) before the view is resumed. So far only the passkey management related events fall into this category that we know of.

📸 Screenshots

An example of rapidly navigating to a new view (also occurs for push navigation when tapping on any of the folders in the list, and on the vault and settings tabs as well):

Before After

An example of rapidly navigating back from a view (also occurs when dismissing a slide-up view, though in that case the base view is still visible just unresponsive):

Before After

Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed
    issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/3660 **Author:** [@shannon-livefront](https://github.com/shannon-livefront) **Created:** 7/31/2024 **Status:** ✅ Merged **Merged:** 8/1/2024 **Merged by:** [@shannon-livefront](https://github.com/shannon-livefront) **Base:** `main` ← **Head:** `PM-10094-fix-double-navigation` --- ### 📝 Commits (2) - [`a00c9ca`](https://github.com/bitwarden/android/commit/a00c9cadea2e79e182bd2126c1781612e3613e25) PM-10094: Disable double-navigation by default - [`349b837`](https://github.com/bitwarden/android/commit/349b8371b2e2acb7564df32575582a448e69e529) PR feedback ### 📊 Changes **4 files changed** (+29 additions, -8 deletions) <details> <summary>View changed files</summary> ➕ `app/src/main/java/com/x8bit/bitwarden/ui/platform/base/util/BackgroundEvent.kt` (+8 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/platform/base/util/EventsEffect.kt` (+12 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/VaultAddEditViewModel.kt` (+4 -4) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/itemlisting/VaultItemListingViewModel.kt` (+5 -4) </details> ### 📄 Description ## 🎟️ Tracking <!-- Paste the link to the Jira or GitHub issue or otherwise describe / point to where this change is coming from. --> [PM-10094](https://bitwarden.atlassian.net/browse/PM-10094) ## 📔 Objective <!-- Describe what the purpose of this PR is, for example what bug you're fixing or new feature you're adding. --> Nearly everywhere that navigation is possible in the app, rapidly double-clicking on the navigation button would cause the navigation action to happen twice, which would either stack two new views on top of each other or, in the case of rapidly navigating _back_ too many times, break the view entirely. This PR fixes that issue by ignoring events that occur when the view is not resumed by default. IMPORTANT NOTE: There is a new interface called `BackgroundEvent` that non-navigation events should conform to if there is a chance they might occur (and should be processed) before the view is resumed. So far only the passkey management related events fall into this category that we know of. ## 📸 Screenshots <!-- Required for any UI changes; delete if not applicable. Use fixed width images for better display. --> An example of rapidly navigating to a new view (also occurs for push navigation when tapping on any of the folders in the list, and on the vault and settings tabs as well): | Before | After | | --- | --- | | <video src="https://github.com/user-attachments/assets/f512b02c-f586-4a28-9482-3cdb6d1d41d8" /> | <video src="https://github.com/user-attachments/assets/a8be77de-6769-4fcc-ad2e-c0de9ebab55a" /> | An example of rapidly navigating back from a view (also occurs when dismissing a slide-up view, though in that case the base view is still visible just unresponsive): | Before | After | | --- | --- | | <video src="https://github.com/user-attachments/assets/d21fe21f-af27-4540-ae5a-9dde15235d9a" /> | <video src="https://github.com/user-attachments/assets/d5d001ca-50a0-47c0-8e0d-0828a3f480eb" /> | ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes [PM-10094]: https://bitwarden.atlassian.net/browse/PM-10094?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-26 23:42:54 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#4322