mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-09-14 15:16:40 +00:00
fix(ui): confirm destructive actions, retire last Hold-Enter-cancel, de-dup labels
Continuing the consistency review: sweep for the same three defect shapes
elsewhere in ui-new/ (own read pass plus two parallel research agents),
verified against source before acting.
Three destructive actions fired on a single Enter with no way back, unlike
contact-delete's existing confirm-defaulted-to-Cancel popup: Trail's "Reset
trail" (wipes the whole recorded route, no undo short of a prior manual
Save -- reuses Trail's own multi-level menu machinery, alongside its
GPS-off confirm), Messages' channel Delete, and RadioPresetPicker's saved-
preset delete (shared by Settings > Radio and Tools > Repeater, so one fix
covers both). All three now confirm the same way, defaulting to Cancel.
KeyboardWidget was the one place Hold-Enter still doubled as Cancel: Shift,
Backspace and a Latin letter's accent popup already have real, kept
meanings under a hold, but every other special-row cell (Space, OK/Done,
the {} placeholder) fell through to a bare CANCELLED, closing the keyboard
exactly like the real Cancel key. Now a no-op there too, matching the "only
Back closes it" rule already applied to popups and screens.
MessagesScreen defined the same two label arrays (Notif states, melody
slots) four times over, once per context-menu handler. Hoisted to one
pair of static class members -- constexpr wasn't enough to get the linker
to emit them on this toolchain, so they follow the same declare-in-class/
define-out-of-class shape NearbyScreen::FILTER_LABELS already uses.
Alert text: "Advert sent!"/"Advert failed.." and "Sent!" were the only
toasts anywhere with trailing punctuation; normalized to the plain style
every other confirmation uses. Unpinning from the Favourites Dial reported
the freed slot number from the Messages screens but not from Nodes or the
dial's own tile menu; now consistent everywhere pinning already was.
DiagnosticsScreen's Live/System/Font tab renderers hand-rolled the same
scroll-clamp/loop/indicator skeleton drawList() already bundles; switched
both to drawList (passing the screen's own _scroll as its `sel` too, since
neither tab has a row cursor -- makes drawList's internal clamp a no-op and
leaves clampScroll() as the only thing bounding it, unchanged). Pure
internal tidy, no behavior change.
This commit is contained in:
@@ -911,17 +911,16 @@ struct KeyboardWidget {
|
||||
const int rows = gridRows();
|
||||
const int cols = gridCols();
|
||||
|
||||
// Hold-Enter is normally "cancel", but three places give it a more useful
|
||||
// meaning instead: Shift -> toggle a persistent caps-lock (a plain tap is
|
||||
// one-shot -- see the commit sites below); Backspace -> clear the whole
|
||||
// field in one action instead of holding it down; a Latin-page letter cell
|
||||
// with accented variants -> open the accent popup (see accent_active
|
||||
// above). Every other special-row cell keeps hold-to-cancel; any other
|
||||
// letter/symbol cell (a plain letter with no accents, or any T9/alt-
|
||||
// alphabet/symbols cell) is a silent no-op instead, so it can't
|
||||
// accidentally close the keyboard. Cursor mode itself moved off Hold-Enter
|
||||
// entirely -- see the KEY_UP block below, where UP from row 0 now enters
|
||||
// it instead.
|
||||
// Hold-Enter has a distinct meaning on three cells -- Shift -> toggle a
|
||||
// persistent caps-lock (a plain tap is one-shot -- see the commit sites
|
||||
// below); Backspace -> clear the whole field in one action instead of
|
||||
// holding it down; a Latin-page letter cell with accented variants ->
|
||||
// open the accent popup (see accent_active above) -- and is a silent
|
||||
// no-op everywhere else (any other special-row cell, a plain letter with
|
||||
// no accents, or any T9/alt-alphabet/symbols cell), matching the "only
|
||||
// Back closes it" rule every other screen's popups/menus follow. Cursor
|
||||
// mode itself moved off Hold-Enter entirely -- see the KEY_UP block
|
||||
// below, where UP from row 0 now enters it instead.
|
||||
if (c == KEY_CONTEXT_MENU) {
|
||||
if (row == rows && col == 0) { // Shift
|
||||
caps_lock = !caps_lock;
|
||||
@@ -941,7 +940,7 @@ struct KeyboardWidget {
|
||||
}
|
||||
return NONE; // no variants for this cell, or T9/non-Latin/symbols page
|
||||
}
|
||||
return CANCELLED;
|
||||
return NONE; // any other special-row cell (Space, OK/Done, placeholder)
|
||||
}
|
||||
|
||||
if (c == KEY_UP) {
|
||||
|
||||
Reference in New Issue
Block a user