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

Open
opened 2026-04-11 03:55:59 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/bitwarden/android/pull/6779

State: open
Merged: No


🎟️ Tracking

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

📔 Objective

Add a "next TOTP code" preview to the Authenticator app. When a verification code is about to expire (< 10 seconds remaining), the upcoming code is displayed below the current one, allowing users to pre-read the next code without waiting for rotation.

Key behaviors:

  • Next code appears only when timeLeftSeconds < 10
  • Displayed in smaller, secondary-color text below the current code
  • Controlled by a "Show next code" toggle in Settings > Data (default: off)
  • Tapping an item still copies the current code

Implementation details:

  • Data layer: Second generateTotp() SDK call with currentTime + periodSeconds
  • Settings: Full DiskSource → Repository → ViewModel → Screen chain for the toggle
  • UI: Conditional rendering in VaultVerificationCodeItem composable
  • Wired through both ItemListingViewModel and ItemSearchViewModel

📸 Screenshots

Settings

Figma Actual

Disclaimer: Figma includes the new Switch row, but other settings are outdated.

Upcoming code

**Original Pull Request:** https://github.com/bitwarden/android/pull/6779 **State:** open **Merged:** No --- ## 🎟️ Tracking https://bitwarden.atlassian.net/browse/BWA-99 ## 📔 Objective Add a "next TOTP code" preview to the Authenticator app. When a verification code is about to expire (< 10 seconds remaining), the upcoming code is displayed below the current one, allowing users to pre-read the next code without waiting for rotation. **Key behaviors:** - Next code appears only when `timeLeftSeconds < 10` - Displayed in smaller, secondary-color text below the current code - Controlled by a "Show next code" toggle in Settings > Data (default: off) - Tapping an item still copies the **current** code **Implementation details:** - Data layer: Second `generateTotp()` SDK call with `currentTime + periodSeconds` - Settings: Full `DiskSource → Repository → ViewModel → Screen` chain for the toggle - UI: Conditional rendering in `VaultVerificationCodeItem` composable - Wired through both `ItemListingViewModel` and `ItemSearchViewModel` ## 📸 Screenshots ### Settings | Figma | Actual | |--------|--------| | <img width="365" src="https://github.com/user-attachments/assets/67d2f873-937b-422c-a4ca-6bf6a088aa3a" /> | <img width="365" src="https://github.com/user-attachments/assets/51a860f5-46cd-415a-bccc-70b9b22050b5" /> | *Disclaimer: Figma includes the new Switch row, but other settings are outdated.* ### Upcoming code <video src="https://github.com/user-attachments/assets/b8337cce-0b52-4c17-9ffb-623f7a460397" width="365" />
GiteaMirror added the pull-request label 2026-04-11 03:55:59 -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#13005