From 4a907c750c6ecd11e0bf6b5eacce3404a342432a Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 24 Jun 2026 15:14:22 +0000 Subject: [PATCH 1/2] fix: reset bottom bar to defaults when parsed config has 0 items Blank stored strings and successfully-parsed empty JSON arrays both left the bottom bar invisible. Now both cases fall back to DefaultBottomBarEntries so navigation is never silently lost. Co-Authored-By: Claude --- .../amethyst/model/preferences/UISharedPreferences.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/preferences/UISharedPreferences.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/preferences/UISharedPreferences.kt index 7a9de9483e..dbb4d05734 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/preferences/UISharedPreferences.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/preferences/UISharedPreferences.kt @@ -146,7 +146,9 @@ class UiSharedPreferences( preferences[UI_USE_TRACKED_BROADCASTS]?.let { BooleanType.valueOf(it) } ?: if (featureSet == FeatureSetType.COMPLETE) BooleanType.ALWAYS else BooleanType.NEVER, automaticallyCreateDrafts = preferences[UI_AUTOMATICALLY_CREATE_DRAFTS]?.let { BooleanType.valueOf(it) } ?: BooleanType.ALWAYS, - bottomBarItems = preferences[UI_BOTTOM_BAR_ITEMS]?.let { decodeBottomBarItems(it) } ?: DefaultBottomBarEntries, + bottomBarItems = + (preferences[UI_BOTTOM_BAR_ITEMS]?.let { decodeBottomBarItems(it) } ?: DefaultBottomBarEntries) + .ifEmpty { DefaultBottomBarEntries }, showHomeNewThreadsTab = preferences[UI_SHOW_HOME_NEW_THREADS_TAB] ?: true, showHomeConversationsTab = preferences[UI_SHOW_HOME_CONVERSATIONS_TAB] ?: true, showHomeEverythingTab = preferences[UI_SHOW_HOME_EVERYTHING_TAB] ?: false, @@ -215,7 +217,7 @@ class UiSharedPreferences( } private fun decodeBottomBarItems(raw: String): List? { - if (raw.isBlank()) return emptyList() + if (raw.isBlank()) return DefaultBottomBarEntries // Current format: a JSON list of BottomBarEntry (built-ins + favorites). runCatching { return JsonMapper.fromJson>(raw) } // Configs written before the stable @SerialName discriminators used the fully-qualified From 851fb827355ee874c26a291ad70236069e3aabbf Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 24 Jun 2026 15:32:18 +0000 Subject: [PATCH 2/2] fix: only reset bottom bar to defaults on parse errors, not intentional empty selection The ifEmpty guard incorrectly reset a user-saved empty bar to defaults. A successfully parsed empty list (user actively removed all items) is now preserved. Only blank/unset keys and unrecognizable formats fall back to DefaultBottomBarEntries. Co-Authored-By: Claude --- .../amethyst/model/preferences/UISharedPreferences.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/preferences/UISharedPreferences.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/preferences/UISharedPreferences.kt index dbb4d05734..af4c15f520 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/preferences/UISharedPreferences.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/preferences/UISharedPreferences.kt @@ -146,9 +146,7 @@ class UiSharedPreferences( preferences[UI_USE_TRACKED_BROADCASTS]?.let { BooleanType.valueOf(it) } ?: if (featureSet == FeatureSetType.COMPLETE) BooleanType.ALWAYS else BooleanType.NEVER, automaticallyCreateDrafts = preferences[UI_AUTOMATICALLY_CREATE_DRAFTS]?.let { BooleanType.valueOf(it) } ?: BooleanType.ALWAYS, - bottomBarItems = - (preferences[UI_BOTTOM_BAR_ITEMS]?.let { decodeBottomBarItems(it) } ?: DefaultBottomBarEntries) - .ifEmpty { DefaultBottomBarEntries }, + bottomBarItems = preferences[UI_BOTTOM_BAR_ITEMS]?.let { decodeBottomBarItems(it) } ?: DefaultBottomBarEntries, showHomeNewThreadsTab = preferences[UI_SHOW_HOME_NEW_THREADS_TAB] ?: true, showHomeConversationsTab = preferences[UI_SHOW_HOME_CONVERSATIONS_TAB] ?: true, showHomeEverythingTab = preferences[UI_SHOW_HOME_EVERYTHING_TAB] ?: false,