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") {
|
Section("All notes") {
|
||||||
ForEach(notes) { note in
|
ForEach(orderedNotes) { note in
|
||||||
row(note)
|
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 {
|
private func row(_ note: NoteEntity) -> some View {
|
||||||
Button {
|
Button {
|
||||||
editingNote = note
|
editingNote = note
|
||||||
} label: {
|
} label: {
|
||||||
NoteRowView(note: note)
|
NoteRowView(note: note)
|
||||||
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
|
.contentShape(Rectangle())
|
||||||
}
|
}
|
||||||
.buttonStyle(.plain)
|
.buttonStyle(.plain)
|
||||||
.swipeActions(edge: .trailing) {
|
.swipeActions(edge: .trailing) {
|
||||||
|
|||||||
Reference in New Issue
Block a user