trackslash
VAULT-36 P2

Show the next code near the end of its countdown

0
All issues

Description

Add a "Show Next Code" setting. When it's on, a time-based code (TOTP) shows the next code, smaller, during the last few seconds of its countdown. That way nobody has to wait for a code that's about to expire. Most authenticator apps do this.

Details:

  • Show it on feed cards and on the code's detail page.
  • The card's layout mustn't jump when the next code appears. #600 matched the code sizes on TOTP and HOTP cards, so keep them matched.
  • Only show the next code while the current one is visible. Anything that hides the current code (privacy, locked, hidden, editing) hides the next one too.
  • Decide what tapping copies during that window. The current code is the safe answer.
  • Counter-based codes (HOTP), AutoFill and widgets are out of scope.

Tests:

  • Unit tests for when the next code shows, and for its value at the edge of a period.
  • Snapshot tests of a card with the next code showing, in light and dark mode.

Sub-issues

0

Linked issues

0

GitHub

0

No branches or pull requests linked.

Comments

1
Bradley

Fixed in https://github.com/badbundle/vault-app/pull/634 (merged as b20e8886).

The setting: a new Show Next Code toggle in the Codes section, under Tap a Code To. It's off by default, and the Codes footer explains it.

What it shows: when it's on, a time-based code shows "Next 654 321" in small text just above its timer bar, on feed cards and on the code's page.

  • It appears for the last 10 seconds of a period. For a period too short for that, it's the last third, so 5 s of a 15 s code.
  • At the end of the period, the next code becomes the current one.

Layout: the label sits in the space that was already above the bar, so the card doesn't move, and TOTP and HOTP code sizes stay matched (#600).

When it's hidden: anything that hides the current code hides the next one too. That covers locked, private, expired or errored codes, and editing.

Copying: tapping during that window still copies the current code.

Out of scope: HOTP, AutoFill and widgets never show it.

Accessibility: VoiceOver reads it as "Next code, 654, 321".

Tests:

  • Unit tests for when it shows, including at the period edges.
  • The RFC 6238 value across a period edge.
  • The view model hiding it and still copying the current code.
  • Default and persistence.
  • Snapshots of cards (light, dark, larger text, editing, setting off), TOTP beside HOTP at 6 and 8 digits, the detail page and Settings.