iPad: lead the dashboard with a "Needs you" section
The Home dashboard only surfaced running sessions and rollup counts, so chats blocking on you (an approval or your next prompt) were visible only as sidebar washes. Add a "Needs you" card pinned above the stat cards (amber header + border) listing sessions where status.needsYou(disposition) holds, each tapping into its detail. Mirrors the Mac home's "Needs attention" lead. Shared by iPhone and iPad; hidden when nothing's waiting. Verified in the iPad simulator. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
@@ -11,6 +11,13 @@ struct HomeView: View {
|
||||
|
||||
private var counts: DashboardCounts { store.dashboard.counts }
|
||||
|
||||
/// Sessions blocking on a human — the dashboard's "which session needs me?" answer (the Mac
|
||||
/// home §2). Uses turn disposition so a finished-the-work chat doesn't count; archived hidden.
|
||||
private var needsAttention: [WireSessionSummary] {
|
||||
store.liveSessions
|
||||
.filter { $0.status.needsYou($0.disposition) }
|
||||
.sorted { $0.updatedAt > $1.updatedAt }
|
||||
}
|
||||
/// Sessions actively working a turn — drives both the "In progress" stat card and the
|
||||
/// live list pinned above the to-dos.
|
||||
private var running: [WireSessionSummary] {
|
||||
@@ -66,6 +73,10 @@ struct HomeView: View {
|
||||
}
|
||||
}
|
||||
|
||||
// "Which session needs me?" — pinned above everything when a chat is blocking
|
||||
// on you (an approval or your next prompt), so it leads the dashboard.
|
||||
if !needsAttention.isEmpty { NeedsAttentionSection(sessions: needsAttention) }
|
||||
|
||||
statCards
|
||||
|
||||
// The Mac's usage gauges (5-hour / weekly windows); hidden when the host
|
||||
@@ -121,6 +132,39 @@ struct HomeView: View {
|
||||
}
|
||||
}
|
||||
|
||||
/// The dashboard's attention list: chats blocking on you (an approval or your next prompt),
|
||||
/// pinned at the very top. Tapping a row drops into that session. Header tinted in the attention
|
||||
/// colour so it reads as urgent, matching the Mac home's "Needs attention" lead.
|
||||
private struct NeedsAttentionSection: View {
|
||||
let sessions: [WireSessionSummary]
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: 10) {
|
||||
HStack {
|
||||
Label("Needs you", systemImage: "exclamationmark.triangle.fill")
|
||||
.font(.headline).foregroundStyle(Palette.attention)
|
||||
Spacer()
|
||||
Text("\(sessions.count)")
|
||||
.font(.subheadline.weight(.semibold)).foregroundStyle(Palette.attention)
|
||||
}
|
||||
ForEach(sessions.prefix(6), id: \.sessionID) { summary in
|
||||
NavigationLink {
|
||||
SessionDetailView(sessionID: summary.sessionID)
|
||||
} label: {
|
||||
SessionRow(summary: summary)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
.hoverEffect(.highlight)
|
||||
}
|
||||
}
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.card()
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: 14)
|
||||
.strokeBorder(Palette.attention.opacity(0.35), lineWidth: 1))
|
||||
}
|
||||
}
|
||||
|
||||
/// Live peek at sessions actively running a turn, pinned above the to-do list on Home. Tapping
|
||||
/// a row drops into the session transcript.
|
||||
private struct InProgressSessions: View {
|
||||
|
||||
Reference in New Issue
Block a user