Files
gib edc4b88990
Gateway / check (push) Successful in 9s
Gateway / image (push) Successful in 22s
Watch: snooze finished threads, name the files a file approval would edit, Settle on finished notifications, an instant launch from the saved feed, plain Loading states, and no more cancelled errors
Gateway: an approval push for a file change says which files it would edit
2026-11-02 14:45:34 -05:00

50 lines
1.6 KiB
Swift

// The full Recent list, opened from the feed's "N more" row. It loads `GET /v1/recent` when it
// appears; nothing polls. Rows look and swipe like the feed's, to settle or snooze, and the header
// has Settle all.
import SwiftUI
struct RecentView: View {
@Environment(AppModel.self) private var model
/// Snapshots render the rows without their List, which ImageRenderer leaves blank.
var scrolls = true
var body: some View {
Group {
if scrolls {
List { rows }
.listStyle(.plain)
.refreshable { await model.loadAllRecent() }
.task { await model.loadAllRecent() }
} else {
VStack(spacing: 6) { rows }
.padding(.horizontal, 4)
}
}
.navigationTitle("Recent")
}
@ViewBuilder private var rows: some View {
if let all = model.allRecent {
let items = model.visibleRecent(all)
RecentHeader(title: items.count == 1 ? "1 thread" : "\(items.count) threads", recent: items)
.feedRow()
ForEach(items) { item in
RecentRow(item: item).feedRow()
}
}
if model.allRecent == nil || model.allRecentError != nil {
LoadStatus(loaded: model.allRecent != nil, error: model.allRecentError, retry: model.loadAllRecent)
.feedRow()
}
}
}
#Preview("Recent") {
NavigationStack {
RecentView()
}
.environment(AppModel.preview())
.fontDesign(.rounded)
}