mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-09-18 09:06:39 +00:00
feat(ui): message-wake toggle + all home pages visible by default
Two independent changes, requested together: 1. Settings > Sound > "Msg wake" (NodePrefs::msg_wake_screen_off, 0xC0DE002A) lets a user disable UITask::newMsg()'s existing behaviour of turning the display on for an incoming message when it was off and no companion app is connected. Stored inverted so both a fresh device and an existing saved-prefs file default to "on" (today's behaviour). New sim_test_set_msg_wake_disabled() hook verifies it without scripting Settings navigation -- confirmed end to end via a real A<->R<->B mesh in Playwright: message delivered while B's screen is off either wakes it (enabled) or doesn't (disabled), checked via real canvas pixels. 2. A brand-new or factory-reset device now shows ALL home pages by default instead of a curated 5-page carousel (MyMesh.cpp used to seed home_pages_mask = HP_DEFAULT; now seeds 0, which every other read site already treated as "all visible" -- HP_DEFAULT is now unused, removed). Existing users' saved masks are untouched. New sim_test_get_home_pages_mask() getter confirms a fresh instance reads back 0. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -611,6 +611,13 @@ void DataStore::loadPrefsInt(const char *filename, NodePrefs& _prefs, double& no
|
||||
rd(&_prefs.fav_sort_off, sizeof(_prefs.fav_sort_off));
|
||||
if (_prefs.fav_sort_off > 1) _prefs.fav_sort_off = 0;
|
||||
|
||||
// → 0xC0DE002A: append msg_wake_screen_off. Inverted (see NodePrefs), so
|
||||
// both a pre-0x2A file's stray sentinel byte here and a file that ends
|
||||
// before this field clamp/zero to 0 = wake screen for incoming msgs,
|
||||
// which is the existing default behaviour.
|
||||
rd(&_prefs.msg_wake_screen_off, sizeof(_prefs.msg_wake_screen_off));
|
||||
if (_prefs.msg_wake_screen_off > 1) _prefs.msg_wake_screen_off = 0;
|
||||
|
||||
// Schema sentinel: bumped on layout changes. Mismatch means an older file
|
||||
// (or a different schema); rd() already zero-inits any fields not present,
|
||||
// so we just log it — next savePrefs writes the current sentinel.
|
||||
@@ -830,6 +837,7 @@ void DataStore::savePrefs(const NodePrefs& _prefs, double node_lat, double node_
|
||||
file.write((uint8_t *)_prefs.repeat_extra_scopes, sizeof(_prefs.repeat_extra_scopes));
|
||||
file.write((uint8_t *)_prefs.favourite_kinds, sizeof(_prefs.favourite_kinds));
|
||||
file.write((uint8_t *)&_prefs.fav_sort_off, sizeof(_prefs.fav_sort_off));
|
||||
file.write((uint8_t *)&_prefs.msg_wake_screen_off, sizeof(_prefs.msg_wake_screen_off));
|
||||
|
||||
// Tail sentinel — must be last. See NodePrefs::SCHEMA_SENTINEL. Its write is
|
||||
// the one we check: once the flash fills, writes return 0, so a good
|
||||
|
||||
Reference in New Issue
Block a user