ui: update list filters when a chat is added (#8107)

* ui: update list filters when a chat is added

* ui: count list filters on the main thread and after chat list reloads

* android, desktop: check and add a known chat on the main thread

* docs: list filter counts in the apps' specs

* docs: correct the list filter gaps in the apps' specs

* ui: revert the recounts, replaceChat change and main-thread moves

* docs: revert the list filter notes in the apps' specs

---------

Co-authored-by: spaced4ndy-agents <342056592+spaced4ndy-agents@users.noreply.github.com>
This commit is contained in:
spaced4ndyandspaced4ndy-agents authored and GitHub committed 2026-11-11 16:57:32 +00:00
1 parent f7c91cbeb9
commit 3469bc7514
2 files changed
+4 -2

No files matched your search

+1 -1
View File
@@ -612,6 +612,7 @@ final class ChatModel: ObservableObject {
} else {
addChat_(chat, at: 0)
}
ChatTagsModel.shared.addPresetChatTags(chat.chatInfo, chat.chatStats)
popChatCollector.throttlePopChat(chat.chatInfo.id, currentPosition: 0)
}
@@ -656,7 +657,6 @@ final class ChatModel: ObservableObject {
updateChatInfo(cInfo)
} else if addMissing {
addChat(Chat(chatInfo: cInfo, chatItems: []))
ChatTagsModel.shared.addPresetChatTags(cInfo, ChatStats())
}
}
@@ -458,6 +458,9 @@ object ChatModel {
suspend fun addChat(chat: Chat) {
chats.add(index = 0, chat)
if (secondaryContextFilter == null) {
addPresetChatTags(chat.chatInfo, chat.chatStats)
}
popChatCollector.throttlePopChat(chat.remoteHostId, chat.id, currentPosition = 0)
}
@@ -519,7 +522,6 @@ object ChatModel {
updateChatInfo(rhId, cInfo)
} else if (addMissing) {
addChat(Chat(remoteHostId = rhId, chatInfo = cInfo, chatItems = arrayListOf()))
addPresetChatTags(cInfo, Chat.ChatStats())
}
}