summaryrefslogtreecommitdiff
path: root/source/ui/CodeView.mc
diff options
context:
space:
mode:
authorcirakg <cirakg@cirakg.xyz>2026-10-25 23:51:52 +0100
committercirakg <cirakg@cirakg.xyz>2026-10-25 23:51:52 +0100
commitb8addc87f804789368612bf8e1be31a2bf28efe1 (patch)
treebece4051eb6f009eba05ffdd585420232741a7d7 /source/ui/CodeView.mc
parent140a6660f63f88d05ba9aae0bf1c4b401bb6574d (diff)
test(ui): second UI scenario, and the fixes it found
A second UI-test build (uitest-extra.jungle) covers the legacy PIN and the forced new PIN, Change and Reset PIN, a queued Require PIN, UPC-A, Code 39, the code error screen, the encoding progress, auto-lock on a barcode, the light theme and the glance without a code; the main flow adds the Steam and Library details and the menu's text screens. Fixed from what it found: Entry IDs tripped the watchdog with 110 entries; auto-lock didn't close a locked barcode; a queued Require PIN showed "Confirm in menu"; locked barcodes lacked the padlock; the PIN keypad's bottom row, the Reset PIN question, text-screen bottoms, the glance title and the light-theme warning colour. Goldens approved on all seven watches; only the Forerunner 70 was re-verified after the version bump. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'source/ui/CodeView.mc')
-rw-r--r--source/ui/CodeView.mc19
1 files changed, 16 insertions, 3 deletions
diff --git a/source/ui/CodeView.mc b/source/ui/CodeView.mc
index efa23d2..03f1fa7 100644
--- a/source/ui/CodeView.mc
+++ b/source/ui/CodeView.mc
@@ -27,6 +27,9 @@
// ticker timer does the renewing (and redraws the progress while
// encoding), so a code screen never needs more timers.
// * Too big: a message with the size needed.
+// * A locked code closes back to the list when auto-lock fires while it
+// is open (README 7.5), like a locked OTP entry: the ticker keeps
+// running for it and checks the session.
// The payload is decrypted when the screen opens and wiped once encoded.
import Toybox.Attention;
@@ -70,6 +73,9 @@ class CodeView extends WatchUi.View {
_shownLogged = false;
encode();
boostBrightness();
+ if (header.locked) {
+ startTicker();
+ }
}
function onHide() as Void {
@@ -143,8 +149,13 @@ class CodeView extends WatchUi.View {
}
// Progress redraws while a job runs; brightness renewals during the
- // minute. The ticker stops when neither is needed.
+ // minute; auto-lock for a locked code. The ticker stops when none of
+ // them is needed.
function onTick() as Void {
+ if (header.locked && AppState.checkAutoLock()) {
+ WatchUi.popView(WatchUi.SLIDE_RIGHT);
+ return;
+ }
if (_job != null) {
WatchUi.requestUpdate();
}
@@ -157,7 +168,7 @@ class CodeView extends WatchUi.View {
light();
}
}
- if (_job == null && _boostStart < 0) {
+ if (_job == null && _boostStart < 0 && !header.locked) {
stopTicker();
}
}
@@ -266,8 +277,10 @@ class CodeView extends WatchUi.View {
} else if (code instanceof RunsPainter) {
drawMatrix(dc, code, smallFont, smallH);
} else if (job != null) {
+ var percent = job.percent();
dc.drawText(w / 2, h / 2 - smallH / 2, smallFont, (job instanceof RunsPainter ? "Drawing… " : "Encoding… ")
- + job.percent() + "%", Graphics.TEXT_JUSTIFY_CENTER);
+ + percent + "%", Graphics.TEXT_JUSTIFY_CENTER);
+ Diag.data("code_progress", "percent=" + percent); // for UI scripts
} else {
drawMessage(dc, code instanceof Codes.CodeError ? code.message : "…", smallFont, smallH);
}