mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-26 14:58:12 +00:00
feat(admin): typed Radio/Routing field editors; pre-release audit fixes
Tools > Admin: split the Radio tab's single "f,bw,sf,cr" comma-string field (free-text keyboard) into 4 independent, type-appropriate rows -- Frequency (same digit-cursor DigitEditor Settings/Repeater use locally), Bandwidth/Spreading factor/Coding rate (discrete-set LEFT/RIGHT stepping), plus TX power and the 3 Routing numeric fields as number steppers and Repeat as an ON/OFF toggle. Edits happen locally (zero mesh traffic per keystroke); only Enter sends one combined `set`, Cancel sends nothing. Full pre-release audit of all 16 commits since v1.22 (5 parallel focus areas: display/font, keyboard/messages, Nodes/Admin, Bot/channels, UITask+NodePrefs schema) turned up and fixed: - Admin: fetched FK_NUMBER values weren't clamped to the field's range, so a value already out-of-range could get stuck unreachable; fixed commit-time float format noise (%.6f -> %.3f); Cancel/failed-login always returned to the Nodes picker even when Admin was opened directly from a node's Hold-Enter action -- now returns to wherever it was actually opened from (AdminScreen::_from_picker). - Keyboard: one-shot Shift was consumed after the *first* T9 multi-tap, so cycling to the 2nd/3rd candidate always came out lowercase -- fixed by caching the cycle's caps state (t9_caps). - Messages: history is numbered newest-first, so a message arriving while scrolled up to an older one silently relabeled the view onto a different message -- selection now shifts with the insert. - Channels: onChannelRemoved() didn't clear ch_notif_override/ ch_notif_muted/ch_fav_bitmask despite its own contract comment requiring it (now far more reachable via the on-device Delete); an all-zero hex secret silently self-deleted the channel it was just saved into (collides with the empty-slot sentinel) -- rejected. - Room login: isRoomLoggedIn() indexed the login-tracking ring directly instead of via its head offset, silently wrong once the ring wraps (8+ rooms/session) -- the new on-device Logout depends on this being right. - Font/display: removed the now fully-inert Settings > Display > Font toggle and the dead LemonFont.h (retired by the earlier misc-fixed font unification, zero remaining includes); fixed a copy-pasted "5x7" comment (font is 6x9), two meaningless dead ternaries, and an OLED/e-ink inconsistency in the undefined-glyph fallback box offset. - AdminField's `kind`/bounds fields no longer rely on default member initializers inside aggregate-init: this toolchain's actual nRF52 build (unlike env:native) has no explicit -std= override, so it predates C++14's aggregate-with-default-member-initializer rule. Given an explicit constructor instead -- portable regardless of standard, all existing field-table literals unchanged. Docs updated to match: tools_screen.md (Diagnostics as a 3-tab carousel, was documented as one flat screen), message_screen.md (chat bubbles, newest-at-bottom, cursor mode, secret validation), settings_screen.md (dropped the dead Font row), solo_ui_framework.md (header menu_hint signatures, icon priority-drop, KeyboardWidget's T9/alphabets/cursor-mode). release-notes.md gains the v1.23 section covering all of the above plus the other 15 commits since v1.22. Build-verified on WioTrackerL1_companion_solo_dual. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -45,8 +45,9 @@ static const char* const KB_T9_GROUPS[KB_PAGES][9] = {
|
||||
|
||||
// Additional (non-Latin) keyboard alphabets — NodePrefs::keyboard_alt_alphabet
|
||||
// picks which one (if any) joins the Latin/symbols page cycle. Every alphabet
|
||||
// here must fall inside Lemon's U+0020-04FF range (src/helpers/ui/LemonFont.h)
|
||||
// since that's what actually draws these glyphs on-screen.
|
||||
// here must fall inside the misc-fixed font's U+0020-04FF range
|
||||
// (src/helpers/ui/MiscFixedFont.h) since that's what actually draws these
|
||||
// glyphs on-screen.
|
||||
//
|
||||
// Unlike KB_CHARS (single ASCII byte per cell), these hold UTF-8 strings —
|
||||
// Cyrillic is 2 bytes/codepoint — so cells are `const char*`, not `char`.
|
||||
@@ -363,6 +364,12 @@ struct KeyboardWidget {
|
||||
int t9_cell = -1;
|
||||
int t9_cycle = 0;
|
||||
uint32_t t9_last_ms = 0;
|
||||
// Caps state the *first* tap of the current T9 cycle applied -- reused by every
|
||||
// later cycling tap on the same cell, since one-shot Shift is consumed (see
|
||||
// below) right after that first tap, before the user has settled on a letter.
|
||||
// Without this, cycling to the 2nd/3rd/... candidate would always render
|
||||
// lowercase regardless of Shift.
|
||||
bool t9_caps = false;
|
||||
|
||||
int gridRows() const { return isT9() ? KB_T9_ROWS : KB_ROWS_CHAR; }
|
||||
int gridCols() const { return isT9() ? KB_T9_COLS : KB_COLS_CHAR; }
|
||||
@@ -765,7 +772,7 @@ struct KeyboardWidget {
|
||||
if (t9_cycle < glen) kbUtf8CharAt(group, t9_cycle, one);
|
||||
else { one[0] = (char)('1' + cell); one[1] = '\0'; }
|
||||
char shown[5];
|
||||
kbApplyCapsUtf8(one, caps, shown, sizeof(shown));
|
||||
kbApplyCapsUtf8(one, t9_caps, shown, sizeof(shown));
|
||||
// Replace the codepoint just before the cursor (what the previous
|
||||
// tap inserted), preserving anything after the cursor too.
|
||||
int old_n = kbUtf8LastCharBytes(buf, cursor_pos);
|
||||
@@ -793,6 +800,7 @@ struct KeyboardWidget {
|
||||
buf[len] = '\0';
|
||||
t9_cell = cell;
|
||||
t9_cycle = 0;
|
||||
t9_caps = caps; // remember it for every later cycling tap on this cell
|
||||
if (caps && !caps_lock) caps = false; // one-shot: only this first tap gets capitalised
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user