Public Access
M0 step 7: Settings, About, Storage, first-boot setup
- lib/apps_model (host-tested): SettingsMenu (rows, readable values, choices, validation messages) and SetupWizard (names, Region confirmation, timezone; saves only when finished) - AppManager: modal Apps that Home/Back can't leave (setup wizard) - SettingsApp: all settings plus Storage (usage, erase SD behind a dialog) and About (version, node id, battery, memory, uptime) pages, replacing the temporary Diagnostics App - SetupApp: first-boot wizard, opened modally until SetupDone - Node id and default names derived from the MAC like Meshtastic - Widget demo is now hidden (About, then w) - lib_ldf_mode = deep+ so libraries see each other's headers Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EhqxQ49eCju4CzKYNjZzwT
This commit is contained in:
@@ -155,6 +155,32 @@ void test_update_reaches_only_the_foreground_app() {
|
||||
TEST_ASSERT_EQUAL(0, f.launcher.lastUpdate);
|
||||
}
|
||||
|
||||
void test_modal_app_keeps_home_and_back() {
|
||||
Fixture f;
|
||||
f.manager.openModal("demo");
|
||||
f.manager.handleKey(KeyEvent::of(Key::Home));
|
||||
f.manager.handleKey(KeyEvent::of(Key::Back));
|
||||
TEST_ASSERT_EQUAL_PTR(&f.demo, &f.manager.foreground());
|
||||
TEST_ASSERT_EQUAL(2, f.demo.keys.size()); // both reached the App
|
||||
}
|
||||
|
||||
void test_ending_the_modal_returns_to_launcher_and_unlocks_home() {
|
||||
Fixture f;
|
||||
f.manager.openModal("demo");
|
||||
f.manager.endModal();
|
||||
TEST_ASSERT_EQUAL_PTR(&f.launcher, &f.manager.foreground());
|
||||
f.manager.open("notes");
|
||||
f.manager.handleKey(KeyEvent::of(Key::Home));
|
||||
TEST_ASSERT_EQUAL_PTR(&f.launcher, &f.manager.foreground());
|
||||
}
|
||||
|
||||
void test_modal_app_cannot_be_switched_away_by_open() {
|
||||
Fixture f;
|
||||
f.manager.openModal("demo");
|
||||
TEST_ASSERT_FALSE(f.manager.open("notes"));
|
||||
TEST_ASSERT_EQUAL_PTR(&f.demo, &f.manager.foreground());
|
||||
}
|
||||
|
||||
int main() {
|
||||
UNITY_BEGIN();
|
||||
RUN_TEST(test_launcher_is_in_foreground_after_begin);
|
||||
@@ -170,5 +196,8 @@ int main() {
|
||||
RUN_TEST(test_switching_apps_requests_a_redraw);
|
||||
RUN_TEST(test_app_can_request_its_own_redraw);
|
||||
RUN_TEST(test_update_reaches_only_the_foreground_app);
|
||||
RUN_TEST(test_modal_app_keeps_home_and_back);
|
||||
RUN_TEST(test_ending_the_modal_returns_to_launcher_and_unlocks_home);
|
||||
RUN_TEST(test_modal_app_cannot_be_switched_away_by_open);
|
||||
return UNITY_END();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user