From 2115d69ce2883624989064d698ef3ef499744967 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Sun, 1 Nov 2026 14:12:00 -0500 Subject: [PATCH] Add update notification/reminder for v2 --- README.md | 12 +++++++----- package.json | 4 ++-- src/c/main.c | 32 ++++++++++++++++++++++++++++++-- src/c/main.h | 3 ++- src/c/settings.h | 1 + 5 files changed, 42 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index bf0dd0d..3bb4b5a 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,13 @@ --- **Trigalarm** is a habit-correcting alarm for heavy sleepers that forces you to solve for theta in right triangles. It's the perfect amount of thought to activate your brain in the morning! +## MAJOR UPDATE INCOMING - BREAKING CHANGES - PLEASE READ!! +On Dec 1, 2026, Trigalarm on the Pebble store will be updated to v2.0.0. Your settings will **NOT** carry over, as this update makes major adjustments to the way Trigalarm works. + +The update is already finished and the PBW is available as a release package (see the linked git repo at the bottom of the store page). You will also be reminded of this in-app when disarming your alarm for the day. You will be prompted with an option to disable this reminder, if desired. + +If you decide to stick to the legacy version of the app, please sideload the v1.1.0 PBW, also available as a release on the git repo linked at the bottom of the store page. + ## The Pitch ### Simple The alarm setter is only one page. You can only set one alarm. There is no snooze, there is no weekly schedule, and there is no way to disable the alarm (you'll always have one set - every day - like it or not). @@ -26,8 +33,3 @@ Perhaps the most unique, Trigalarm features optional [Pavlok](https://pavlok.com - The vibration pattern is randomized. It derives the length of the three pulses from the angles in the generated triangle. Neat! - Some of the alarm scheduling code was taken from [Gentle Wake](https://github.com/SeaPea/GentleWake). It seems trusted by the community, so... I stole it! The beauty of open source, no AI needed! - A custom font was made to satisfy the need for something that looks like LECO but is monospaced. The version I made contains only numbers, period, and colon, but if you want to build off of it, [it's public](https://git.wetfence.xyz/RandyTheSilly/pebble-misc/src/branch/main/fonts) and easy to modify! - -## Future Goals (1.1 and beyond) -- Full touch navigation -- Draw measurements based on triangle side locations, rather than in fixed positions -- Custom, self-hosted Pavlok API support (going to try some Bluetooth reverse engineering) diff --git a/package.json b/package.json index 42097af..f7073ba 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "trigalarm", "author": "RandyTheSilly", - "version": "1.0.0", + "version": "1.1.0", "keywords": [ "alarm", "math", @@ -20,7 +20,7 @@ "@rebble/clay": "^1.0.10" }, "pebble": { - "displayName": "Trigalarm", + "displayName": "Trigalarm (Legacy; Read Desc)", "uuid": "293cd38c-4e8c-46ae-a3dc-c789d7ce93ab", "sdkVersion": "3", "enableMultiJS": true, diff --git a/src/c/main.c b/src/c/main.c index 4d961fd..da50874 100644 --- a/src/c/main.c +++ b/src/c/main.c @@ -96,12 +96,25 @@ static char *s_options_under[2]; static void push_setter_window(); +static void push_status_window(StatusWindowPurpose purpose); + static void click_handler_disable_tutorial(void *recognizer, void *ctx) { settings.TutorialEnabled = false; persist_write_data(STORAGE_KEY_SETTINGS, &settings, sizeof(settings)); window_stack_pop_all(true); } +static void click_handler_disable_update_notification(void *recognizer, void *ctx) { + persist_write_bool(STORAGE_KEY_UPDATE_NOTIFICATION_DISABLED, true); + window_stack_pop(true); + push_status_window(STATUS_CONFIRMATION); +} + +static void click_handler_skip_update_notification(void *recognizer, void *ctx) { + window_stack_pop(true); + push_status_window(STATUS_CONFIRMATION); +} + static void click_handler_push_setter(void *recognizer, void *ctx) { s_highlight_pos = 0; s_skip_current_day = true; // setting the next alarm should assume the user meant tomorrow @@ -139,6 +152,11 @@ static void status_math_failure_click_config_provider(void *ctx) { window_single_click_subscribe(BUTTON_ID_SELECT, click_handler_retry); } +static void status_update_notification_click_config_provider(void *ctx) { + window_single_click_subscribe(BUTTON_ID_SELECT, click_handler_skip_update_notification); + window_single_click_subscribe(BUTTON_ID_BACK, click_handler_disable_update_notification); +} + static void status_window_load(StatusWindowPurpose purpose) { Layer *window_layer = window_get_root_layer(s_status_window); s_status_txt_layer = text_layer_create(GRect(0, 0, PBL_DISPLAY_WIDTH, PBL_DISPLAY_HEIGHT)); @@ -164,12 +182,17 @@ static void status_window_load(StatusWindowPurpose purpose) { case STATUS_MATH_FAILURE: text_layer_set_text(s_status_txt_layer, "Incorrect equation.\nTry again!"); window_set_click_config_provider(s_status_window, status_math_failure_click_config_provider); + break; + case STATUS_UPDATE_NOTIFICATION: + text_layer_set_text(s_status_txt_layer, "IMPORTANT - READ!!\nTrigalarm will be updated to v2 (w/breaking changes) on Dec 1 2026. See store description for info.\n\nPress SELECT to continue or BACK to disable this notification (and continue)."); + window_set_click_config_provider(s_status_window, status_update_notification_click_config_provider); } text_layer_set_background_color(s_status_txt_layer, GColorClear); layer_set_frame(text_layer_get_layer(s_status_txt_layer), GRect(0, (PBL_DISPLAY_HEIGHT / 2) - (text_layer_get_content_size(s_status_txt_layer).h / 2), PBL_DISPLAY_WIDTH, PBL_DISPLAY_HEIGHT)); text_layer_set_text_alignment(s_status_txt_layer, GTextAlignmentCenter); layer_add_child(window_layer, text_layer_get_layer(s_status_txt_layer)); + text_layer_enable_screen_text_flow_and_paging(s_status_txt_layer, 3); } static void status_window_unload() { @@ -462,12 +485,17 @@ static void alarm_select_hold_handler(void *recognizer, void *ctx) { // set main alarm if the awareness alarm was solved within time limit tick_timer_service_unsubscribe(); // alarm is fully disarmed - prevent stimulus in confirmation window if (schedule_alarm(WAKE_MAIN_ALARM)) { - push_status_window(STATUS_CONFIRMATION); + if (!persist_read_bool(STORAGE_KEY_UPDATE_NOTIFICATION_DISABLED)) { + push_status_window(STATUS_UPDATE_NOTIFICATION); + } else { + push_status_window(STATUS_CONFIRMATION); + } } } else { // otherwise, set awareness alarm and exit + WakeupReason alarm_reason = s_alarm_reason; if (schedule_alarm(WAKE_AWARENESS_ALARM)) { - if (settings.TutorialEnabled && (s_alarm_reason == WAKE_MAIN_ALARM || s_alarm_reason == WAKE_RECOVERY_MAIN_ALARM)) { + if (settings.TutorialEnabled && (alarm_reason == WAKE_MAIN_ALARM || alarm_reason == WAKE_RECOVERY_MAIN_ALARM)) { push_status_window(STATUS_MAIN_TUTORIAL); } else { window_stack_pop_all(true); diff --git a/src/c/main.h b/src/c/main.h index 15d84ad..772cbf1 100644 --- a/src/c/main.h +++ b/src/c/main.h @@ -5,5 +5,6 @@ typedef enum STATUS_MAIN_TUTORIAL = 0, STATUS_CONFIRMATION = 1, STATUS_SET_FAILURE = 2, - STATUS_MATH_FAILURE = 3 + STATUS_MATH_FAILURE = 3, + STATUS_UPDATE_NOTIFICATION = 4 } StatusWindowPurpose; diff --git a/src/c/settings.h b/src/c/settings.h index 7819b18..4e1541f 100644 --- a/src/c/settings.h +++ b/src/c/settings.h @@ -9,6 +9,7 @@ #define STORAGE_KEY_ALARM_HOUR 0 #define STORAGE_KEY_ALARM_MINUTE 1 #define STORAGE_KEY_PAVLOK_INTENSITY 2 +#define STORAGE_KEY_UPDATE_NOTIFICATION_DISABLED 3 typedef struct AppSettings { bool TutorialEnabled;