From b57367de1cd94c96531787fdb71d37b94cc128a4 Mon Sep 17 00:00:00 2001 From: Laan Tungir Date: Mon, 13 Jul 2026 12:29:25 -0400 Subject: [PATCH] v0.0.26 - Remove theme toggle link from pages, default restore_session=off, clear history and session on shutdown for privacy --- VERSION | 2 +- src/main.c | 13 +++++++++++-- src/nostr_bridge.c | 18 +----------------- src/settings.c | 2 +- src/version.h | 4 ++-- 5 files changed, 16 insertions(+), 23 deletions(-) diff --git a/VERSION b/VERSION index 2678ff8..c4475d3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0.25 +0.0.26 diff --git a/src/main.c b/src/main.c index 44dfa9a..f8b6c67 100644 --- a/src/main.c +++ b/src/main.c @@ -384,8 +384,17 @@ static void on_window_destroy(GtkWidget *widget, gpointer data) { (void)widget; (void)data; - /* Save the session before cleanup. */ - session_save(); + const browser_settings_t *s = settings_get(); + + if (s->restore_session) { + /* Save the session for next launch. */ + session_save(); + } else { + /* Privacy mode: clear session and history on shutdown. */ + db_session_clear(); + history_clear(); + g_print("[shutdown] Cleared session and history (restore_session=off)\n"); + } /* Stop the agent server. */ agent_server_stop(); diff --git a/src/nostr_bridge.c b/src/nostr_bridge.c index c30b091..6b303bd 100644 --- a/src/nostr_bridge.c +++ b/src/nostr_bridge.c @@ -507,23 +507,7 @@ static char *sovereign_page_head(const char *title) { /* Build the theme-toggle button + closing . * Returns a newly-allocated string (g_free). */ static char *sovereign_page_foot(void) { - /* The theme toggle immediately flips the CSS class on for an - * instant visual response, then fires an async XHR to save the setting - * in the background. No page reload, no UI blocking. */ - return g_strdup_printf( - "%s\n" - "\n", - settings_get()->theme_dark ? "Day Mode" : "Night Mode"); + return g_strdup("\n"); } /* ── Settings page ─────────────────────────────────────────────── */ diff --git a/src/settings.c b/src/settings.c index 4b75320..49b8ba2 100644 --- a/src/settings.c +++ b/src/settings.c @@ -54,7 +54,7 @@ static browser_settings_t g_settings; /* ── Defaults ─────────────────────────────────────────────────────── */ static void settings_set_defaults(browser_settings_t *s) { - s->restore_session = TRUE; + s->restore_session = FALSE; snprintf(s->new_tab_url, sizeof(s->new_tab_url), "%s", SETTINGS_NEW_TAB_URL_DEFAULT); s->tab_bar_position = GTK_POS_TOP; diff --git a/src/version.h b/src/version.h index 0f5dbb9..f76a26c 100644 --- a/src/version.h +++ b/src/version.h @@ -11,9 +11,9 @@ #ifndef SOVEREIGN_BROWSER_VERSION_H #define SOVEREIGN_BROWSER_VERSION_H -#define SB_VERSION "v0.0.25" +#define SB_VERSION "v0.0.26" #define SB_VERSION_MAJOR 0 #define SB_VERSION_MINOR 0 -#define SB_VERSION_PATCH 25 +#define SB_VERSION_PATCH 26 #endif /* SOVEREIGN_BROWSER_VERSION_H */