diff --git a/oAI/Views/Main/SidebarView.swift b/oAI/Views/Main/SidebarView.swift index 8d037af..93b3534 100644 --- a/oAI/Views/Main/SidebarView.swift +++ b/oAI/Views/Main/SidebarView.swift @@ -131,9 +131,11 @@ struct SidebarView: View { ForEach(folders) { folder in let folderConversations = conversationsByFolder[folder.id] ?? [] if !folderConversations.isEmpty || searchText.isEmpty { - Section(isExpanded: isExpandedBinding(for: folder.id)) { - ForEach(folderConversations) { conversation in - conversationRow(conversation) + Section { + if !collapsedFolders.contains(folder.id) { + ForEach(folderConversations) { conversation in + conversationRow(conversation) + } } } header: { folderHeader(folder) @@ -204,19 +206,6 @@ struct SidebarView: View { } } - private func isExpandedBinding(for folderId: UUID) -> Binding { - Binding( - get: { !collapsedFolders.contains(folderId) }, - set: { isExpanded in - if isExpanded { - collapsedFolders.remove(folderId) - } else { - collapsedFolders.insert(folderId) - } - } - ) - } - private func handleDrop(_ items: [String], toFolder folderId: UUID?) -> Bool { var moved = false for idString in items { @@ -423,6 +412,7 @@ struct SidebarConversationRow: View { VStack(alignment: .leading, spacing: 2) { Text(conversation.name) .font(.system(size: 13, weight: .medium)) + .foregroundStyle(.primary) .lineLimit(1) HStack(spacing: 4) { Text("^[\(conversation.messageCount) message](inflect: true)") diff --git a/oAI/Views/Screens/ConversationListView.swift b/oAI/Views/Screens/ConversationListView.swift index d462cc4..f3bc95e 100644 --- a/oAI/Views/Screens/ConversationListView.swift +++ b/oAI/Views/Screens/ConversationListView.swift @@ -221,9 +221,11 @@ struct ConversationListView: View { ForEach(folders) { folder in let folderConversations = conversationsByFolder[folder.id] ?? [] if !folderConversations.isEmpty || searchText.isEmpty { - Section(isExpanded: isExpandedBinding(for: folder.id)) { - ForEach(folderConversations) { conversation in - conversationRow(conversation) + Section { + if !collapsedFolders.contains(folder.id) { + ForEach(folderConversations) { conversation in + conversationRow(conversation) + } } } header: { folderHeader(folder) @@ -443,19 +445,6 @@ struct ConversationListView: View { } } - private func isExpandedBinding(for folderId: UUID) -> Binding { - Binding( - get: { !collapsedFolders.contains(folderId) }, - set: { isExpanded in - if isExpanded { - collapsedFolders.remove(folderId) - } else { - collapsedFolders.insert(folderId) - } - } - ) - } - private func handleDrop(_ items: [String], toFolder folderId: UUID?) -> Bool { var moved = false for idString in items { @@ -696,6 +685,7 @@ struct ConversationRow: View { VStack(alignment: .leading, spacing: 4) { Text(conversation.name) .font(.system(size: 15, weight: .semibold)) + .foregroundStyle(.primary) .lineLimit(1) HStack(spacing: 6) {