From 096b5a4d17c85fa5f87db3e72364e9c3506d1e64 Mon Sep 17 00:00:00 2001 From: cirakg Date: Sun, 25 Oct 2026 12:46:42 +0100 Subject: feat(pin): exactly 4 digits, entered on the 4th digit The keypad has no OK key; the 4th digit submits, so a tap that also arrives as START can no longer submit a partial PIN (the likely cause of "Wrong PIN" before the code opened). PINs set by earlier versions still unlock and are then replaced by a 4-digit one. Opening an entry ignores a second request from the same tap. A Require PIN sent from the phone while the watch is locked now applies at the next PIN instead of waiting for Confirm all. The linter skips .claude. Co-Authored-By: Claude Opus 5.5 --- tools/ui_flow.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'tools/ui_flow.py') diff --git a/tools/ui_flow.py b/tools/ui_flow.py index a17d435..8c08caf 100644 --- a/tools/ui_flow.py +++ b/tools/ui_flow.py @@ -14,7 +14,7 @@ the screen. Watches without a button for an action use touch instead (Venu Sq 2 has no UP/DOWN and no select button). The app (UI-test build, source/util/TestMode.mc) starts with fake entries, -the PIN 123456 and a frozen clock, and prints "DIAG shown " after +the PIN 1234 and a frozen clock, and prints "DIAG shown " after drawing each screen, so every step waits for the screen it expects instead of sleeping. Menus are native Menu2 views that print nothing; for those the script waits a fixed time. @@ -65,10 +65,10 @@ MENU_SETTLE_S = 1.5 # Menu2 has no "shown" line SETTLE_S = 0.4 # after a "shown" line, before the screenshot CLICK_PAUSE_S = 0.25 HOLD_S = 1.6 # long enough for a hold (menu) on every device -FIXTURE_PIN = "123456" # source/app/Fixtures.mc -WRONG_PIN = "000000" +FIXTURE_PIN = "1234" # source/app/Fixtures.mc +WRONG_PIN = "0000" FAILURES_UNTIL_WAIT = 5 # source/storage/Lockout.mc: the 5th failure starts a delay -SELECTOR_OK = 10 # source/ui/PinView.mc: selector positions 0-9, then OK +SELECTOR_DIGITS = 10 # source/ui/PinView.mc: selector positions 0-9 (no OK; the 4th digit submits) GYM_CARD = "5901234123457" # source/app/Fixtures.mc: EAN-13 with its check digit MEMBER_QR = ( # source/app/Fixtures.mc: a version 6 QR "https://example.com/member/fake-0042?name=Alice%20Example&card=0000111122223333&valid=2027-12-31&level=gold" @@ -298,12 +298,11 @@ class Flow: value, xy = item.split("=") x, y = xy.split(",") centres[int(value)] = (int(x), int(y)) - for digit in pin: + for digit in pin: # the 4th digit submits self.sim.tap(*centres[int(digit)]) - self.sim.tap(*centres[-2]) # OK return - for position in [int(d) for d in pin] + [SELECTOR_OK]: - steps = (position - self.selector) % (SELECTOR_OK + 1) + for position in [int(d) for d in pin]: + steps = (position - self.selector) % SELECTOR_DIGITS for _ in range(steps): self.sim.press("down") self.selector = position -- cgit v1.2.3