refactor: one place each for "in view" and the keyboard's backspace

ui-new's messagesInView() and ui-lvgl's threadInView() hold the
lit-and-unlocked test the viewing checks repeated; the keyboard's three
copies of the backspace call deleteBeforeCursor(). A stale comment on the
cursor-mode hint goes, onDisplayOn() sits after the view helpers it calls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-10-08 23:58:52 +02:00
co-authored by Claude Opus 5.5
parent 9e24abcbeb
commit d901a58424
7 changed files with 31 additions and 43 deletions
+2 -1
View File
@@ -60,10 +60,11 @@ class UITask : public UITaskBase, public UiCoreHost {
GenericVibration vibration;
#endif
unsigned long _next_refresh, _auto_off;
bool _display_was_on = true; // loop(): the display back on and unlocked
bool _display_was_on = true; // loop(): messagesInView() last time round
NodePrefs* _node_prefs;
bool _locked;
bool _tool_from_home = false;
bool messagesInView() const; // Messages on a lit, unlocked display
unsigned long _lock_wake_until; // when to blank screen again after locked wake (5s)
int _lock_seq_count; // Enter presses while Back held (lock/unlock sequence)
unsigned long _lock_seq_ms; // millis() of last lock-sequence press (for timeout)