From 72e031a99d5af8db4a9b172842707ec3b1ca6e41 Mon Sep 17 00:00:00 2001 From: Patedam Date: Sat, 7 Mar 2026 23:55:43 -0500 Subject: [PATCH] removed the blinking light after connection as it was taking a lot of iteration time. Made the sidebar icon use the famous burger --- Provider/frontend/src/lib/Sidebar.svelte | 25 +++++++++++++++++++----- Provider/frontend/version.json | 2 +- Provider/main/Kconfig.projbuild | 7 +++++++ Provider/main/connect.cpp | 14 +++++++++++-- Provider/main/led_status.cpp | 2 ++ Provider/main/main.cpp | 2 ++ 6 files changed, 44 insertions(+), 8 deletions(-) diff --git a/Provider/frontend/src/lib/Sidebar.svelte b/Provider/frontend/src/lib/Sidebar.svelte index 840ac83..0af74a0 100644 --- a/Provider/frontend/src/lib/Sidebar.svelte +++ b/Provider/frontend/src/lib/Sidebar.svelte @@ -19,7 +19,11 @@ onclick={() => collapsed = !collapsed} title={collapsed ? 'Expand' : 'Collapse'} > - {collapsed ? '▶' : '◀'} + + + + + @@ -55,6 +59,10 @@ width: 56px; } + .sidebar.collapsed .sidebar-header { + justify-content: center; + } + .sidebar-header { display: flex; align-items: center; @@ -79,13 +87,20 @@ border: none; color: var(--color-text-secondary); cursor: pointer; - padding: 4px; - font-size: 10px; - border-radius: 4px; - transition: color 0.15s, background 0.15s; + padding: 6px; + display: flex; + align-items: center; + justify-content: center; + border-radius: 6px; + transition: all 0.2s; flex-shrink: 0; } + .collapse-btn svg { + width: 18px; + height: 18px; + } + .collapse-btn:hover { color: var(--color-text-primary); background: var(--color-bg-card-hover); diff --git a/Provider/frontend/version.json b/Provider/frontend/version.json index 0325e63..9caea60 100644 --- a/Provider/frontend/version.json +++ b/Provider/frontend/version.json @@ -1,5 +1,5 @@ { "major": 0, "minor": 1, - "revision": 13 + "revision": 14 } \ No newline at end of file diff --git a/Provider/main/Kconfig.projbuild b/Provider/main/Kconfig.projbuild index 792b3c1..950cb20 100644 --- a/Provider/main/Kconfig.projbuild +++ b/Provider/main/Kconfig.projbuild @@ -24,6 +24,13 @@ menu "CalendarInk Network Configuration" help Number of times to retry the WiFi connection before failing completely. + config CALENDINK_BLINK_IP + bool "Blink last IP digit on connect" + default n + help + If enabled, the LED will blink the last digit of the IP address + acquired to assist in debugging. + endmenu menu "Calendink Web Server" diff --git a/Provider/main/connect.cpp b/Provider/main/connect.cpp index 14a6c8f..ce6939e 100644 --- a/Provider/main/connect.cpp +++ b/Provider/main/connect.cpp @@ -18,9 +18,11 @@ #include "types.hpp" // Forward declarations +#if CONFIG_CALENDINK_BLINK_IP internal esp_err_t get_ip_info(esp_netif_ip_info_t *ip_info); internal void led_blink_number(int n, uint8_t r, uint8_t g, uint8_t b); internal void blink_last_ip_octet(); +#endif // Internal states internal esp_netif_ip_info_t s_current_ip_info = {}; @@ -161,7 +163,9 @@ internal esp_err_t connect_ethernet(bool blockUntilIPAcquired) { ESP_LOGI(kLogEthernet, "Waiting for IP address."); xSemaphoreTake(s_semph_get_ip_addrs, portMAX_DELAY); +#if CONFIG_CALENDINK_BLINK_IP blink_last_ip_octet(); +#endif } return ESP_OK; @@ -205,7 +209,9 @@ internal esp_err_t check_ethernet_connection(uint32_t timeoutSeconds) if (xSemaphoreTake(s_semph_get_ip_addrs, pdMS_TO_TICKS(timeoutSeconds * 1000))) { +#if CONFIG_CALENDINK_BLINK_IP blink_last_ip_octet(); +#endif return ESP_OK; } else @@ -342,7 +348,9 @@ internal esp_err_t connect_wifi(const char *ssid, const char *password, { ESP_LOGI(kLogWifi, "Waiting for IP address."); xSemaphoreTake(s_semph_get_wifi_ip_addrs, portMAX_DELAY); +#if CONFIG_CALENDINK_BLINK_IP blink_last_ip_octet(); +#endif } return ESP_OK; @@ -390,7 +398,9 @@ internal esp_err_t check_wifi_connection(uint32_t timeoutSeconds) if (xSemaphoreTake(s_semph_get_wifi_ip_addrs, pdMS_TO_TICKS(timeoutSeconds * 1000))) { +#if CONFIG_CALENDINK_BLINK_IP blink_last_ip_octet(); +#endif return ESP_OK; } else @@ -399,14 +409,13 @@ internal esp_err_t check_wifi_connection(uint32_t timeoutSeconds) } } +#if CONFIG_CALENDINK_BLINK_IP internal esp_err_t get_ip_info(esp_netif_ip_info_t *ip_info) { *ip_info = s_current_ip_info; return ESP_OK; } -internal void led_blink_number(int n, uint8_t r, uint8_t g, uint8_t b); - internal void blink_last_ip_octet() { esp_netif_ip_info_t ip_info; @@ -431,3 +440,4 @@ internal void blink_last_ip_octet() led_blink_number(u, 255, 255, 255); } } +#endif diff --git a/Provider/main/led_status.cpp b/Provider/main/led_status.cpp index f9110e2..119afc3 100644 --- a/Provider/main/led_status.cpp +++ b/Provider/main/led_status.cpp @@ -58,6 +58,7 @@ internal void set_led_status(led_status status) } led_strip_refresh(led_strip); } +#if CONFIG_CALENDINK_BLINK_IP internal void led_blink_number(int n, uint8_t r, uint8_t g, uint8_t b) { if (n <= 0) @@ -85,3 +86,4 @@ internal void led_blink_number(int n, uint8_t r, uint8_t g, uint8_t b) } vTaskDelay(pdMS_TO_TICKS(1000)); } +#endif diff --git a/Provider/main/main.cpp b/Provider/main/main.cpp index 06f6afb..9e6658e 100644 --- a/Provider/main/main.cpp +++ b/Provider/main/main.cpp @@ -11,8 +11,10 @@ #include "freertos/task.h" #include "nvs.h" #include "nvs_flash.h" +#include "sdkconfig.h" #include "soc/gpio_num.h" + // Project headers #include "appstate.hpp" #include "types.hpp"