[PR #6842] [BWA-99] feat: Add next TOTP code preview in Authenticator #55128

Open
opened 2026-05-01 21:05:11 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/6842
Author: @mpbw2
Created: 4/27/2026
Status: 🔄 Open

Base: mainHead: BWA-99/show-next-totp


📝 Commits (2)

  • 03849f3 [BWA-99] feat: Add next TOTP code preview in Authenticator
  • 1337f1f Use parameterized string resource for next TOTP code label

📊 Changes

8 files changed (+100 additions, -21 deletions)

View changed files

📝 authenticator/src/main/kotlin/com/bitwarden/authenticator/data/authenticator/manager/TotpCodeManagerImpl.kt (+8 -3)
📝 authenticator/src/main/kotlin/com/bitwarden/authenticator/data/authenticator/manager/model/VerificationCodeItem.kt (+3 -0)
📝 authenticator/src/main/kotlin/com/bitwarden/authenticator/ui/authenticator/feature/util/VerificationCodeItemExtensions.kt (+1 -0)
📝 authenticator/src/main/kotlin/com/bitwarden/authenticator/ui/platform/components/listitem/VaultVerificationCodeItem.kt (+42 -16)
📝 authenticator/src/main/kotlin/com/bitwarden/authenticator/ui/platform/components/listitem/model/VerificationCodeDisplayItem.kt (+1 -0)
📝 authenticator/src/test/kotlin/com/bitwarden/authenticator/data/authenticator/manager/util/TotpCodeManagerTest.kt (+42 -2)
📝 authenticator/src/test/kotlin/com/bitwarden/authenticator/data/authenticator/manager/util/VerificationCodeItemUtil.kt (+2 -0)
📝 ui/src/main/res/values/strings.xml (+1 -0)

📄 Description

🎟️ Tracking

https://bitwarden.atlassian.net/browse/BWA-99

📔 Objective

Shows the upcoming TOTP code inline below the current code during the final 5 seconds of each period, so users can copy the next code before it becomes active without waiting for the rollover.

Changes:

  • VerificationCodeItem — added nextCode: String? field
  • TotpCodeManagerImpl — computes next code via a second generateTotp(uri, time + period) call at each period boundary; silently null on SDK failure
  • VerificationCodeDisplayItem — added nextAuthCode: String? field
  • VerificationCodeItemExtensions — maps nextCodenextAuthCode in toDisplayItem()
  • VaultVerificationCodeItem — renders next code below current code when timeLeftSeconds <= 5; applies to both item listing and search screens
  • New next_verification_code string resource ("Next: %1$s") in :ui module

📸 Screenshots


🔄 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/6842 **Author:** [@mpbw2](https://github.com/mpbw2) **Created:** 4/27/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `BWA-99/show-next-totp` --- ### 📝 Commits (2) - [`03849f3`](https://github.com/bitwarden/android/commit/03849f38dac44b4f2fcb2cdc011e40cf7d79e9b7) [BWA-99] feat: Add next TOTP code preview in Authenticator - [`1337f1f`](https://github.com/bitwarden/android/commit/1337f1f43284202ede84c871c694a5cc035b72f3) Use parameterized string resource for next TOTP code label ### 📊 Changes **8 files changed** (+100 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `authenticator/src/main/kotlin/com/bitwarden/authenticator/data/authenticator/manager/TotpCodeManagerImpl.kt` (+8 -3) 📝 `authenticator/src/main/kotlin/com/bitwarden/authenticator/data/authenticator/manager/model/VerificationCodeItem.kt` (+3 -0) 📝 `authenticator/src/main/kotlin/com/bitwarden/authenticator/ui/authenticator/feature/util/VerificationCodeItemExtensions.kt` (+1 -0) 📝 `authenticator/src/main/kotlin/com/bitwarden/authenticator/ui/platform/components/listitem/VaultVerificationCodeItem.kt` (+42 -16) 📝 `authenticator/src/main/kotlin/com/bitwarden/authenticator/ui/platform/components/listitem/model/VerificationCodeDisplayItem.kt` (+1 -0) 📝 `authenticator/src/test/kotlin/com/bitwarden/authenticator/data/authenticator/manager/util/TotpCodeManagerTest.kt` (+42 -2) 📝 `authenticator/src/test/kotlin/com/bitwarden/authenticator/data/authenticator/manager/util/VerificationCodeItemUtil.kt` (+2 -0) 📝 `ui/src/main/res/values/strings.xml` (+1 -0) </details> ### 📄 Description ## 🎟️ Tracking https://bitwarden.atlassian.net/browse/BWA-99 ## 📔 Objective Shows the upcoming TOTP code inline below the current code during the final 5 seconds of each period, so users can copy the next code before it becomes active without waiting for the rollover. **Changes:** - `VerificationCodeItem` — added `nextCode: String?` field - `TotpCodeManagerImpl` — computes next code via a second `generateTotp(uri, time + period)` call at each period boundary; silently `null` on SDK failure - `VerificationCodeDisplayItem` — added `nextAuthCode: String?` field - `VerificationCodeItemExtensions` — maps `nextCode` → `nextAuthCode` in `toDisplayItem()` - `VaultVerificationCodeItem` — renders next code below current code when `timeLeftSeconds <= 5`; applies to both item listing and search screens - New `next_verification_code` string resource (`"Next: %1$s"`) in `:ui` module ## 📸 Screenshots <!-- Required for any UI changes; delete if not applicable. Use fixed width images for better display. --> --- <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 2026-05-01 21:05:11 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#55128