Float in-flight notes to top of list; make full row tappable
Claude-Session: https://claude.ai/code/session_014esDWi42URLEC6Cj17hGQ3
This commit is contained in:
@@ -55,7 +55,7 @@ struct NotesListView: View {
|
||||
}
|
||||
|
||||
Section("All notes") {
|
||||
ForEach(notes) { note in
|
||||
ForEach(orderedNotes) { note in
|
||||
row(note)
|
||||
}
|
||||
}
|
||||
@@ -71,11 +71,23 @@ struct NotesListView: View {
|
||||
}
|
||||
}
|
||||
|
||||
/// In-flight notes (transcription still pending) float to the top;
|
||||
/// everything else stays newest-first.
|
||||
private var orderedNotes: [NoteEntity] {
|
||||
notes.filter(isInFlight) + notes.filter { !isInFlight($0) }
|
||||
}
|
||||
|
||||
private func isInFlight(_ note: NoteEntity) -> Bool {
|
||||
note.audio?.transcriptionStatus == .pending
|
||||
}
|
||||
|
||||
private func row(_ note: NoteEntity) -> some View {
|
||||
Button {
|
||||
editingNote = note
|
||||
} label: {
|
||||
NoteRowView(note: note)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.contentShape(Rectangle())
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
.swipeActions(edge: .trailing) {
|
||||
|
||||
Reference in New Issue
Block a user