more proactive vlm agent features

This commit is contained in:
joyzhuo
2026-03-29 00:58:22 -04:00
parent 15943b4759
commit 275a53ab40
7 changed files with 431 additions and 120 deletions

View File

@@ -63,57 +63,8 @@ struct FocusSessionView: View {
Divider()
// Argus pipeline status bar (debug always visible when session is active)
if !session.argusStatus.isEmpty {
HStack(spacing: 6) {
Text(session.argusStatus)
.font(.caption2)
.foregroundStyle(.secondary)
.lineLimit(1)
Spacer()
}
.padding(.horizontal)
.padding(.vertical, 4)
.background(Color.secondary.opacity(0.06))
Divider()
}
// Proactive action card (VLM friction or app-switch loop)
if let card = session.proactiveCard {
ProactiveCardView(card: card, onDismiss: {
withAnimation { session.proactiveCard = nil }
}, onApprove: { label in
session.approvedActionLabel = label
withAnimation { session.proactiveCard = nil }
// Clear toast after 4 seconds
Task {
try? await Task.sleep(for: .seconds(4))
session.approvedActionLabel = nil
}
})
.padding(.horizontal)
.padding(.top, 10)
.transition(.move(edge: .top).combined(with: .opacity))
}
// Approved action confirmation toast
if let label = session.approvedActionLabel {
HStack(spacing: 8) {
Image(systemName: "checkmark.circle.fill")
.foregroundStyle(.green)
Text("Approved: \(label)")
.font(.caption.bold())
.foregroundStyle(.green)
Spacer()
}
.padding(.horizontal)
.padding(.vertical, 6)
.background(Color.green.opacity(0.08))
.transition(.move(edge: .top).combined(with: .opacity))
}
ScrollView {
VStack(alignment: .leading, spacing: 20) {
VStack(alignment: .leading, spacing: 16) {
// Current step card
if let step = session.currentStep {