From 70034036839c06f1317eacee55c657f6108227b1 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 13 Apr 2026 13:46:31 +0300 Subject: l2: remove the fasting science screen from the app MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Deleted all science-related code: window, text layers, buffers, callbacks, click handlers, window load/unload/appear functions, menu item, and enum entry. Renumbered main menu enum (8 items → 7). Updated AGENTS.md and PLAN.md to reflect the removal. Co-Authored-By: Claude Sonnet 4.6 --- AGENTS.md | 1 - PLAN.md | 22 ++------ src/c/fastforge.c | 162 +----------------------------------------------------- 3 files changed, 9 insertions(+), 176 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 359d5ae..15bb456 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -134,7 +134,6 @@ This workflow was used successfully to verify: - current timer - history screen - statistics screen -- fasting science screen - settings screen - backup export logs diff --git a/PLAN.md b/PLAN.md index 858dd59..d1917a8 100644 --- a/PLAN.md +++ b/PLAN.md @@ -38,7 +38,7 @@ Everything runs locally on your Linux laptop using the official Rebble SDK. No C | High | Fasting Streak Counter | Current + longest streak on every screen | | High | Statistics Dashboard | Avg length, total hours, success rate, longest fast | | Medium | Notes/Tags on Fast | Quick tags + auto milestone badges (Fat Burn, Ketosis, etc.) | -| Medium | Fasting Science Screen | Physiology timeline + 5×20 h vs 2×24 h + 2×18 h comparison | +| ~~Medium~~ | ~~Fasting Science Screen~~ | ~~Physiology timeline + 5×20 h vs 2×24 h + 2×18 h comparison~~ (removed) | | Debug | Developer Mode | Fast-forward time, force alarm, fake clock (for local testing) | --- @@ -158,18 +158,9 @@ static void timer_update_proc(Layer *layer, GContext *ctx) { --- -### 7. Fasting Science Screen (Protocol Comparison) +### 7. ~~Fasting Science Screen~~ (Removed) -Add to main menu → “Fasting Science”. -Hard-coded text (fits Pebble screen perfectly): - -- **Physiology Timeline** (copy the table from earlier research) -- **Protocol Showdown** - 5×20 h = 100 h/week → max daily consistency & fat oxidation - 2×24 h + 2×18 h = 84 h/week → deeper autophagy on long days + better sustainability - Recommendation text: “Choose 5×20 h for aggressive fat loss, mixed for long-term adherence.” - -Include two preset buttons that auto-start a fast with the chosen target. +This feature was removed. The physiology timeline and protocol comparison screen has been deleted from the app. --- @@ -221,9 +212,8 @@ On phone side (minimal companion app or Rebble tools) receive the data as CSV. 3. Stop Current Fast (if running) 4. History 5. Statistics -6. Fasting Science -7. Settings -8. Backup to Phone +6. Settings +7. Backup to Phone --- @@ -233,7 +223,7 @@ On phone side (minimal companion app or Rebble tools) receive the data as CSV. **Day 2:** Timer window + visuals (progress + stage) + alarm **Day 3:** History + edit screens + notes/tags **Day 4:** Statistics + streak + presets -**Day 5:** Fasting Science screen + protocol comparison +**Day 5:** ~~Fasting Science screen + protocol comparison~~ (feature removed) **Day 6:** Settings + AppMessage backup stub **Day 7:** Polish, debug menu, final testing on emulator diff --git a/src/c/fastforge.c b/src/c/fastforge.c index 8358132..c6337dd 100644 --- a/src/c/fastforge.c +++ b/src/c/fastforge.c @@ -11,10 +11,9 @@ enum { MAIN_MENU_INDEX_STOP_CURRENT = 2, MAIN_MENU_INDEX_HISTORY = 3, MAIN_MENU_INDEX_STATS = 4, - MAIN_MENU_INDEX_SCIENCE = 5, - MAIN_MENU_INDEX_SETTINGS = 6, - MAIN_MENU_INDEX_BACKUP = 7, - MAIN_MENU_ITEM_COUNT = 8 + MAIN_MENU_INDEX_SETTINGS = 5, + MAIN_MENU_INDEX_BACKUP = 6, + MAIN_MENU_ITEM_COUNT = 7 }; enum { @@ -33,7 +32,6 @@ static Window *s_menu_window; static Window *s_timer_window; static Window *s_goal_window; static Window *s_presets_window; -static Window *s_science_window; static Window *s_settings_window; static Window *s_stats_window; static Window *s_detail_window; @@ -62,10 +60,6 @@ static TextLayer *s_goal_time_layer; static TextLayer *s_goal_stage_layer; static TextLayer *s_goal_hint_layer; -static TextLayer *s_science_title_layer; -static TextLayer *s_science_timeline_layer; -static TextLayer *s_science_showdown_layer; -static TextLayer *s_science_hint_layer; static TextLayer *s_settings_title_layer; static TextLayer *s_settings_target_layer; #ifdef DEBUG @@ -96,9 +90,6 @@ static char s_detail_text[48]; static char s_stage_text[32]; static char s_goal_time_text[24]; static char s_goal_stage_text[24]; -static char s_science_timeline_text[192]; -static char s_science_showdown_text[160]; -static char s_science_hint_text[80]; static char s_settings_target_text[32]; #ifdef DEBUG static char s_settings_dev_text[32]; @@ -136,7 +127,6 @@ static void refresh_timer_view(void); static void refresh_goal_window_content(void); static void sync_main_menu_state(void); static void refresh_running_edit_window_content(void); -static void refresh_science_window_content(void); static void refresh_settings_window_content(void); #ifdef DEBUG static void show_debug_menu_window(void); @@ -311,34 +301,6 @@ static Window *create_window_with_handlers(WindowHandlers handlers, return window; } -static void set_science_content(void) { - snprintf(s_science_timeline_text, sizeof(s_science_timeline_text), - "0h Fed 4h insulin drop\n" - "8h Glycogen drop 12h fat burn\n" - "18h Ketones rise 24h deep keto\n" - "36h+ Adaptation peaks"); - snprintf(s_science_showdown_text, sizeof(s_science_showdown_text), - "5x20h = 100h/wk\n" - "2x24h+2x18h = 84h/wk\n" - "20h wins consistency.\n" - "24h anchor fits the mixed plan."); - snprintf(s_science_hint_text, sizeof(s_science_hint_text), - "SELECT 20h plan\nDOWN 24h anchor BACK Menu"); -} - -static void refresh_science_window_content(void) { - set_science_content(); - if (s_science_timeline_layer) { - text_layer_set_text(s_science_timeline_layer, s_science_timeline_text); - } - if (s_science_showdown_layer) { - text_layer_set_text(s_science_showdown_layer, s_science_showdown_text); - } - if (s_science_hint_layer) { - text_layer_set_text(s_science_hint_layer, s_science_hint_text); - } -} - static uint16_t clamp_default_target_minutes(int target_minutes) { if (target_minutes < 8 * 60) { return 8 * 60; @@ -736,29 +698,6 @@ static void start_fast_from_preset(uint16_t target_minutes) { refresh_all_ui_state(); } -static void start_fast_from_science_preset(uint16_t target_minutes) { - if (fast_is_running()) { - show_placeholder_window("FAST RUNNING", - "Stop the current fast before starting a new one.", - "BACK Menu"); - return; - } - - global_target_minutes = target_minutes; - if (!fast_start(target_minutes)) { - show_placeholder_window("FAST RUNNING", - "Stop the current fast before starting a new one.", - "BACK Menu"); - return; - } - - if (window_stack_contains_window(s_science_window)) { - window_stack_remove(s_science_window, false); - } - safe_push_window(s_timer_window, true); - refresh_all_ui_state(); -} - static uint16_t history_menu_get_num_sections(MenuLayer *menu_layer, void *data) { (void)menu_layer; (void)data; @@ -1161,13 +1100,6 @@ static void menu_statistics_callback(int index, void *context) { safe_push_window(s_stats_window, true); } -static void menu_science_callback(int index, void *context) { - (void)index; - (void)context; - refresh_science_window_content(); - safe_push_window(s_science_window, true); -} - static void menu_settings_callback(int index, void *context) { (void)index; (void)context; @@ -1303,32 +1235,6 @@ static void placeholder_dismiss_handler(ClickRecognizerRef recognizer, void *con window_stack_remove(s_detail_window, true); } -static void science_select_click_handler(ClickRecognizerRef recognizer, void *context) { - (void)recognizer; - (void)context; - start_fast_from_science_preset(20 * 60); -} - -static void science_down_click_handler(ClickRecognizerRef recognizer, void *context) { - (void)recognizer; - (void)context; - start_fast_from_science_preset(24 * 60); -} - -static void science_back_click_handler(ClickRecognizerRef recognizer, void *context) { - (void)recognizer; - (void)context; - window_stack_remove(s_science_window, true); -} - -static void science_click_config_provider(void *context) { - (void)context; - window_single_click_subscribe(BUTTON_ID_SELECT, science_select_click_handler); - window_single_click_subscribe(BUTTON_ID_DOWN, science_down_click_handler); - window_single_click_subscribe(BUTTON_ID_BACK, science_back_click_handler); - window_single_click_subscribe(BUTTON_ID_UP, science_back_click_handler); -} - static void settings_up_click_handler(ClickRecognizerRef recognizer, void *context) { (void)recognizer; (void)context; @@ -1715,55 +1621,6 @@ static void stats_window_appear(Window *window) { refresh_stats_window_content(); } -static void science_window_load(Window *window) { - Layer *window_layer = window_get_root_layer(window); - GRect bounds = layer_get_bounds(window_layer); - - s_science_title_layer = create_text_layer(GRect(0, 4, bounds.size.w, 24), - GTextAlignmentCenter, - FONT_KEY_GOTHIC_24_BOLD, - GColorBlack, GColorClear, false); - text_layer_set_text(s_science_title_layer, "FASTING SCIENCE"); - - s_science_timeline_layer = create_text_layer(GRect(4, 28, bounds.size.w - 8, 56), - GTextAlignmentLeft, - FONT_KEY_GOTHIC_14, - GColorBlack, GColorClear, true); - - s_science_showdown_layer = create_text_layer(GRect(4, 84, bounds.size.w - 8, 54), - GTextAlignmentLeft, - FONT_KEY_GOTHIC_14_BOLD, - GColorBlack, GColorClear, true); - - s_science_hint_layer = create_text_layer(GRect(0, 140, bounds.size.w, 28), - GTextAlignmentCenter, - FONT_KEY_GOTHIC_14_BOLD, - GColorBlack, GColorClear, true); - - add_text_layer(window_layer, s_science_title_layer); - add_text_layer(window_layer, s_science_timeline_layer); - add_text_layer(window_layer, s_science_showdown_layer); - add_text_layer(window_layer, s_science_hint_layer); - refresh_science_window_content(); -} - -static void science_window_unload(Window *window) { - (void)window; - text_layer_destroy(s_science_title_layer); - s_science_title_layer = NULL; - text_layer_destroy(s_science_timeline_layer); - s_science_timeline_layer = NULL; - text_layer_destroy(s_science_showdown_layer); - s_science_showdown_layer = NULL; - text_layer_destroy(s_science_hint_layer); - s_science_hint_layer = NULL; -} - -static void science_window_appear(Window *window) { - (void)window; - refresh_science_window_content(); -} - static void settings_window_load(Window *window) { Layer *window_layer = window_get_root_layer(window); GRect bounds = layer_get_bounds(window_layer); @@ -1883,11 +1740,6 @@ static void configure_main_menu_items(void) { .subtitle = "Dashboard metrics", .callback = menu_statistics_callback }; - s_main_menu_items[MAIN_MENU_INDEX_SCIENCE] = (SimpleMenuItem) { - .title = "Fasting Science", - .subtitle = "Physiology timeline", - .callback = menu_science_callback - }; s_main_menu_items[MAIN_MENU_INDEX_SETTINGS] = (SimpleMenuItem) { .title = "Settings", .subtitle = "Defaults and behavior", @@ -2013,13 +1865,6 @@ static void init_info_windows(void) { }, NULL); window_set_background_color(s_stats_window, theme_surface_background_color()); - s_science_window = create_window_with_handlers((WindowHandlers) { - .load = science_window_load, - .appear = science_window_appear, - .unload = science_window_unload - }, science_click_config_provider); - window_set_background_color(s_science_window, theme_surface_background_color()); - s_settings_window = create_window_with_handlers((WindowHandlers) { .load = settings_window_load, .appear = settings_window_appear, @@ -2058,7 +1903,6 @@ static void destroy_windows(void) { window_destroy(s_debug_window); #endif window_destroy(s_settings_window); - window_destroy(s_science_window); window_destroy(s_stats_window); window_destroy(s_running_edit_window); window_destroy(s_history_edit_window); -- cgit v1.2.3