Fix black row text after moving to a folder, remove duplicate chevron

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.
This commit is contained in:
2026-07-28 13:25:40 +02:00
parent 8c0cfb87f5
commit 7fbac5e809
2 changed files with 12 additions and 32 deletions
+4 -14
View File
@@ -131,10 +131,12 @@ struct SidebarView: View {
ForEach(folders) { folder in
let folderConversations = conversationsByFolder[folder.id] ?? []
if !folderConversations.isEmpty || searchText.isEmpty {
Section(isExpanded: isExpandedBinding(for: folder.id)) {
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<Bool> {
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)")
+4 -14
View File
@@ -221,10 +221,12 @@ struct ConversationListView: View {
ForEach(folders) { folder in
let folderConversations = conversationsByFolder[folder.id] ?? []
if !folderConversations.isEmpty || searchText.isEmpty {
Section(isExpanded: isExpandedBinding(for: folder.id)) {
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<Bool> {
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) {