From 7fbac5e809c7968789f3193261d14b5848844b58 Mon Sep 17 00:00:00 2001 From: Rune Olsen Date: Tue, 28 Jul 2026 13:25:40 +0200 Subject: [PATCH] Fix black row text after moving to a folder, remove duplicate chevron MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pin conversation row title text to .foregroundStyle(.primary) instead of the implicit default — under List's sidebar/source-list style, AppKit's row highlighting could resolve default text to black on a just-interacted-with row (e.g. right after a drag/context-menu move), making it unreadable. Also drop Section(isExpanded:), which was rendering its own native disclosure chevron on the right in addition to the custom one already in the header on the left; folder collapse now works purely off the existing collapsedFolders state with a plain Section, so only the intended left-side chevron remains. --- oAI/Views/Main/SidebarView.swift | 22 ++++++-------------- oAI/Views/Screens/ConversationListView.swift | 22 ++++++-------------- 2 files changed, 12 insertions(+), 32 deletions(-) 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) {