From 35042ff04ffc50e55ff59a385849442be4429d6b Mon Sep 17 00:00:00 2001 From: cirakg Date: Mon, 19 Oct 2026 22:28:09 +0200 Subject: feat(ui): add the list, OTP detail, PIN entry, menu, info screens and glance List with live codes and countdowns, adaptive rows and lazy headers; OTP detail with ring or bar, next code and HOTP next; PIN keypad or button selector with create, unlock, change, lockout display and pending promotion; native menu; glance with the entry count; self-test after the first frame; option properties with defaults. Codes are computed one per timer event, apart from drawing, for the watchdog. A UI-test build (uitest.jungle) starts with fake entries, PIN 123456 and a frozen clock. Co-Authored-By: Claude Opus 5.5 --- source/storage/Vault.mc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'source/storage/Vault.mc') diff --git a/source/storage/Vault.mc b/source/storage/Vault.mc index 0bb3cbc..95f77c9 100644 --- a/source/storage/Vault.mc +++ b/source/storage/Vault.mc @@ -352,7 +352,7 @@ class Vault { private function newId() as String { var id = ""; do { - var random = Cryptography.randomBytes(Entry.ID_LENGTH); + var random = TestMode.ON ? testIdBytes() : Cryptography.randomBytes(Entry.ID_LENGTH); var alphabetSize = Entry.ID_ALPHABET.length(); id = ""; for (var i = 0; i < Entry.ID_LENGTH; i++) { @@ -364,6 +364,18 @@ class Vault { return id; } + // UI-test build only: predictable IDs, so screenshots are reproducible. + private var _testIdCounter as Number = 0; + + private function testIdBytes() as ByteArray { + _testIdCounter++; + var out = new [Entry.ID_LENGTH]b; + for (var i = 0; i < Entry.ID_LENGTH; i++) { + out[i] = (_testIdCounter * (7 + i * 3) + i * 11) & 0xFF; + } + return out; + } + // Store a value, turning a store-full error into VaultError FULL. private function write(key as String, value as Application.Storage.ValueType) as Void { try { -- cgit v1.2.3