fix(calendars): wire feeds into updateFeedsWith so new events stream in live + drop redundant Calendar Lists label

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.
This commit is contained in:
Claude
2026-05-19 22:21:23 +00:00
parent cc78744a10
commit 97a6d4bcbd
2 changed files with 6 additions and 12 deletions
@@ -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)
@@ -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),