From 8c115e3af1efd8d4edc3d5ae7f9aceaa2346a15e Mon Sep 17 00:00:00 2001 From: Andrew Blakeslee Moore Date: Sat, 4 Jul 2026 15:33:04 -0700 Subject: [PATCH] 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 --- .../NucleicRemote/Views/HomeView.swift | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/NucleicRemote/NucleicRemote/Views/HomeView.swift b/NucleicRemote/NucleicRemote/Views/HomeView.swift index 9f0e813..8c169f4 100644 --- a/NucleicRemote/NucleicRemote/Views/HomeView.swift +++ b/NucleicRemote/NucleicRemote/Views/HomeView.swift @@ -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 {