fix empty detail view on thread select, reduce toolbar overflow
- add .id(selectedThread?.id) to ThreadDetailView to force SwiftUI NavigationSplitView detail re-evaluation on selection change - selectMailbox clears selectedThread/messages to avoid stale state - remove defer/project buttons from folder toolbar (4 buttons instead of 7), keyboard shortcuts still work Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -63,6 +63,7 @@ struct ContentView: View {
|
|||||||
requestCompose(mode)
|
requestCompose(mode)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
.id(viewModel.selectedThread?.id)
|
||||||
}
|
}
|
||||||
.safeAreaInset(edge: .bottom) {
|
.safeAreaInset(edge: .bottom) {
|
||||||
statusBanner
|
statusBanner
|
||||||
|
|||||||
@@ -187,6 +187,8 @@ final class MailViewModel {
|
|||||||
func selectMailbox(_ mailbox: MailboxInfo) {
|
func selectMailbox(_ mailbox: MailboxInfo) {
|
||||||
selectedMailbox = mailbox
|
selectedMailbox = mailbox
|
||||||
selectedItem = nil
|
selectedItem = nil
|
||||||
|
selectedThread = nil
|
||||||
|
messages = []
|
||||||
items = []
|
items = []
|
||||||
guard let accountConfig else { return }
|
guard let accountConfig else { return }
|
||||||
startObservingThreads(accountId: accountConfig.id, mailboxId: mailbox.id)
|
startObservingThreads(accountId: accountConfig.id, mailboxId: mailbox.id)
|
||||||
|
|||||||
@@ -161,31 +161,6 @@ struct ThreadListView: View {
|
|||||||
}
|
}
|
||||||
.keyboardShortcut("u", modifiers: [.shift, .command])
|
.keyboardShortcut("u", modifiers: [.shift, .command])
|
||||||
.help("Toggle Read/Unread (⇧⌘U)")
|
.help("Toggle Read/Unread (⇧⌘U)")
|
||||||
|
|
||||||
Button {
|
|
||||||
showMoveSheet = true
|
|
||||||
} label: {
|
|
||||||
Label("Move", systemImage: "folder")
|
|
||||||
}
|
|
||||||
.keyboardShortcut("m", modifiers: [.shift, .command])
|
|
||||||
.help("Move to… (⇧⌘M)")
|
|
||||||
|
|
||||||
// GTD shortcuts available in folder views too
|
|
||||||
Button {
|
|
||||||
showDeferPicker = true
|
|
||||||
} label: {
|
|
||||||
Label("Defer", systemImage: "clock.arrow.circlepath")
|
|
||||||
}
|
|
||||||
.keyboardShortcut("d", modifiers: [])
|
|
||||||
.help("Defer (d)")
|
|
||||||
|
|
||||||
Button {
|
|
||||||
showLabelPicker = true
|
|
||||||
} label: {
|
|
||||||
Label("Project", systemImage: "folder.badge.plus")
|
|
||||||
}
|
|
||||||
.keyboardShortcut("p", modifiers: [])
|
|
||||||
.help("File to Project (p)")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user