mirror of
https://github.com/kuhyx/wake-alarm.git
synced 2026-11-24 14:26:24 +01:00
The escape-hatch form was a keyboard dead end. Tk traps Tab inside a tk.Text (inserts a literal tab, refocuses the widget) and binds Shift-Tab to nothing, so the only exits are the undocumented Ctrl+Tab / Ctrl+Shift+Tab. Unlike diet_guard's equivalent box, which at least binds <Return>, this one bound nothing at all -- so a keyboard-only user who tabbed into the justification field at 6am could not get back out to Submit. Enter now activates Submit / Back / the escape button too. X11 Tk binds only <space> on Button, so the key a user actually reaches for did nothing. Escape returns to the alarm from the escape FORM. To be explicit, because this app's whole point is resisting dismissal: this does not weaken the gating. The alarm still requires DISMISS_ROUNDS_REQUIRED correct answers or the budgeted escape hatch. The absent global <Escape>, the overrideredirect + grab_set_global + VT lock, and the hidden-until-earned escape button are deliberate adversarial design and are left alone. What changed is that the *sanctioned* paths are now reachable without a pointer. Focus rings everywhere: the dismiss-code entry, the escape button, the justification Text and the three escape-form fields all kept Tk's default 1px BLACK ring, invisible against #211D1B. On a screen with no other window and a global grab, that ring is the only feedback that a keystroke landed anywhere. _alarm_view.py imported gatelock only under TYPE_CHECKING, so bind_activate would have raised NameError at runtime while the module still imported cleanly -- an import smoke test would have missed it. phone_app is Android-only, so 1366x768 does not apply; its risk is landscape. home_screen and settings_screen were bare Columns that cannot scroll, so content overflowed with the stripe pattern painted over the primary control: phone landscape leaves ~360px of body height for ~405px of content. Both now scroll inside a SafeArea. The status line also rendered an unbounded raw 'Error: $e' with no maxLines, which added 100-150px and overflowed even in portrait; it is capped at four lines. The gatelock pin moves to v0.3.0, which is where the shared Tk-default workarounds live. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
19 lines
576 B
Plaintext
19 lines
576 B
Plaintext
# Wake Alarm — runtime + development dependencies
|
|
# Runtime: tkinter/json/hmac/wave/subprocess (stdlib) plus gatelock and
|
|
# python-kasa below (python-kasa is optional at runtime; the module degrades
|
|
# gracefully if it's missing, but is required here for mypy/pylint/tests).
|
|
bandit>=1.7.0
|
|
codespell>=2.2.0
|
|
coverage>=7.4.0
|
|
gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.3.0#subdirectory=gatelock
|
|
mypy>=1.8.0
|
|
pre-commit>=3.6.0
|
|
pylint>=3.0.0
|
|
pytest>=8.0.0
|
|
pytest-cov>=4.1.0
|
|
pytest-randomly>=3.15.0
|
|
pytest-sugar>=1.0.0
|
|
pytest-xdist>=3.5.0
|
|
python-kasa>=0.7
|
|
ruff>=0.8.0
|