From 727fc7d6af0489df8ccfe972607d765949467929 Mon Sep 17 00:00:00 2001 From: Rune Olsen Date: Wed, 29 Jul 2026 07:19:27 +0200 Subject: [PATCH] Refresh sidebar folders when the advanced conversation list closes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Creating/renaming/deleting a folder in ConversationListView only ever updated its own local @State — the sidebar has a separate folders array that was only refreshed by onAppear or conversation-change triggers, so a folder created in the modal didn't show up in the sidebar until the next app launch. Sidebar now reloads when showConversations transitions to false (the modal closing). --- oAI/Views/Main/SidebarView.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/oAI/Views/Main/SidebarView.swift b/oAI/Views/Main/SidebarView.swift index 84c3e57..31985b8 100644 --- a/oAI/Views/Main/SidebarView.swift +++ b/oAI/Views/Main/SidebarView.swift @@ -167,6 +167,11 @@ struct SidebarView: View { } .onChange(of: chatViewModel.currentConversationName) { loadData() } .onChange(of: chatViewModel.messages.count) { loadData() } + .onChange(of: chatViewModel.showConversations) { _, isShowing in + // Folders/conversations created, renamed, or deleted in the advanced + // conversation list modal live in its own @State — refresh ours once it closes. + if !isShowing { loadData() } + } } @ViewBuilder