From 97a6d4bcbd20b052bba3ec91dc581fd5bdc8ef82 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 19 May 2026 22:21:23 +0000 Subject: [PATCH] fix(calendars): wire feeds into updateFeedsWith so new events stream in live + drop redundant Calendar Lists label MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two things turned out to be the same bug: 1. New calendar events arriving from relays didn't show up in either feed without a manual pull-to-refresh. The screen was stuck on whatever the last full refresh saw. 2. After a top-nav filter switch the feed looked like it was reflecting "a previous state" — same root cause: filter switch ran a full refresh from LocalCache, but events that the new subscription subsequently delivered were dropped on the floor. AccountFeedContentStates.updateFeedsWith / deleteNotes had calls for every other feed but neither calendarAppointmentsFeed nor calendarCollectionsFeed — so LocalCache.live.newEventBundles flowed past them. Added both calls (and the matching deleteFromFeed entries) so new appointments/collections insert into the visible feed live. Also dropped the redundant "Calendar Lists" label above the top-nav filter spinner on the collections screen — it duplicated the screen title shown by the navigation chrome. --- .../ui/screen/loggedIn/AccountFeedContentStates.kt | 6 ++++++ .../loggedIn/calendars/CalendarCollectionsTopBar.kt | 12 ------------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/AccountFeedContentStates.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/AccountFeedContentStates.kt index e6efff11c0..525f56eacc 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/AccountFeedContentStates.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/AccountFeedContentStates.kt @@ -200,6 +200,9 @@ class AccountFeedContentStates( longsFeed.updateFeedWith(newNotes) articlesFeed.updateFeedWith(newNotes) + calendarAppointmentsFeed.updateFeedWith(newNotes) + calendarCollectionsFeed.updateFeedWith(newNotes) + notifications.updateFeedWith(newNotes) if (account.settings.splitNotificationsEnabled.value) { notificationsFollowing.updateFeedWith(newNotes) @@ -252,6 +255,9 @@ class AccountFeedContentStates( longsFeed.deleteFromFeed(newNotes) articlesFeed.deleteFromFeed(newNotes) + calendarAppointmentsFeed.deleteFromFeed(newNotes) + calendarCollectionsFeed.deleteFromFeed(newNotes) + notifications.deleteFromFeed(newNotes) if (account.settings.splitNotificationsEnabled.value) { notificationsFollowing.deleteFromFeed(newNotes) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/calendars/CalendarCollectionsTopBar.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/calendars/CalendarCollectionsTopBar.kt index 6a69b92145..e34b97aa9e 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/calendars/CalendarCollectionsTopBar.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/calendars/CalendarCollectionsTopBar.kt @@ -20,11 +20,8 @@ */ package com.vitorpamplona.amethyst.ui.screen.loggedIn.calendars -import androidx.compose.material3.MaterialTheme -import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue -import androidx.compose.ui.text.font.FontWeight import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.vitorpamplona.amethyst.R import com.vitorpamplona.amethyst.model.TopFilter @@ -63,15 +60,6 @@ private fun CalendarCollectionsTopNavFilterBar( ) { val allLists by followListsModel.kind3GlobalPeopleRoutes.collectAsStateWithLifecycle() - // We could reuse CalendarsTopNavFilterBar verbatim, but the screen title isn't shown by - // UserDrawerSearchTopBar's content slot — wrapping the spinner with the route title keeps - // the user oriented inside an otherwise filter-only header. - Text( - text = stringRes(R.string.route_calendar_collections), - style = MaterialTheme.typography.labelMedium, - color = MaterialTheme.colorScheme.onSurfaceVariant, - fontWeight = FontWeight.SemiBold, - ) FeedFilterSpinner( placeholderCode = listName, explainer = stringRes(R.string.select_list_to_filter),