Skip to content

Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.

feat: Chowder-style Live Activity layout — previousTask card + currentTask footer

libokaid155d44a7fdb
diff --git a/Codync-iOS/Services/LiveActivityManager.swift b/Codync-iOS/Services/LiveActivityManager.swift
index 5a275c5c..a3b9fe55 100644
--- a/Codync-iOS/Services/LiveActivityManager.swift
+++ b/Codync-iOS/Services/LiveActivityManager.swift
@@ -16,6 +16,7 @@ final class LiveActivityManager: ObservableObject {
private var activities: [String: Activity<CodyncAttributes>] = [:]
private var sessionsByID: [String: SessionState] = [:]
private var lastPushedState: [String: CodyncAttributes.ContentState] = [:]
+ private var previousTasks: [String: String] = [:] // sessionId → last completed tool
private var tickTimer: Timer?
private static let maxActivities = 4
@@ -223,6 +224,7 @@ final class LiveActivityManager: ObservableObject {
|| prev?.completedCount != state.completedCount
|| prev?.totalCount != state.totalCount
|| prev?.currentTask != state.currentTask
+ || prev?.previousTask != state.previousTask
|| prev?.contextPct != state.contextPct
|| prev?.costUSD != state.costUSD
// Update every 2s for sparkle animation, even without field changes
@@ -251,7 +253,14 @@ final class LiveActivityManager: ObservableObject {
}
private func contentState(from session: SessionState) -> CodyncAttributes.ContentState {
- // Compute durationSec locally so it ticks every second — drives sparkle animation
+ // Track tool changes: when currentTask changes, old one becomes previousTask
+ let currentTool = session.currentTask
+ if let current = currentTool,
+ let prev = lastPushedState[session.sessionId]?.currentTask,
+ current != prev, !prev.isEmpty {
+ previousTasks[session.sessionId] = prev
+ }
+
let liveDuration = max(session.durationSec, Int(Date().timeIntervalSince(session.startedAt)))
return .init(
status: session.status.rawValue,
@@ -259,7 +268,8 @@ final class LiveActivityManager: ObservableObject {
tasks: session.truncatedTasks,
completedCount: session.completedTaskCount,
totalCount: session.totalTaskCount,
- currentTask: session.currentTask,
+ currentTask: currentTool,
+ previousTask: previousTasks[session.sessionId],
contextPct: session.contextPct,
costUSD: session.costUSD,
durationSec: liveDuration,
diff --git a/CodyncLiveActivity/CodyncLiveActivityWidget.swift b/CodyncLiveActivity/CodyncLiveActivityWidget.swift
index 89754e91..905da5f1 100644
--- a/CodyncLiveActivity/CodyncLiveActivityWidget.swift
+++ b/CodyncLiveActivity/CodyncLiveActivityWidget.swift
@@ -205,24 +205,9 @@ struct CodyncLiveActivityWidget: Widget {
private func cardBanner(context: ActivityViewContext<CodyncAttributes>) -> some View {
let state = context.state
- let completedTasks = state.tasks.filter { $0.status == .completed }
- let currentTool = nonEmpty(state.currentTask)
- let cards: [(text: String, isInProgress: Bool)] = {
- var result: [(String, Bool)] = []
- // Show last completed task behind
- if let last = completedTasks.last {
- result.append((last.truncatedContent, false))
- }
- // Show current tool as front card (in-progress)
- if let tool = currentTool, state.isBusy {
- result.append((tool, true))
- } else if completedTasks.count >= 2 {
- // No active tool — show last 2 completed
- result.insert((completedTasks[completedTasks.count - 2].truncatedContent, false), at: 0)
- }
- return result
- }()
- let isWaiting = cards.isEmpty && !state.isCompleted
+ let prevTool = nonEmpty(state.previousTask)
+ let hasToolActivity = prevTool != nil
+ let isWaiting = !hasToolActivity && !state.isCompleted
VStack(alignment: .leading, spacing: 4) {
bannerHeader(context: context)
@@ -248,7 +233,7 @@ struct CodyncLiveActivityWidget: Widget {
.frame(maxWidth: .infinity)
.padding(.bottom, 12)
} else if isWaiting {
- let prompt = nonEmpty(context.attributes.summary) ?? nonEmpty(state.currentTask) ?? "Analyzing code…"
+ let prompt = nonEmpty(context.attributes.summary) ?? "Analyzing code…"
Text(prompt)
.lineLimit(2)
.multilineTextAlignment(.leading)
@@ -265,19 +250,18 @@ struct CodyncLiveActivityWidget: Widget {
.frame(maxWidth: .infinity, alignment: .trailing)
.transition(.blurReplace)
} else {
- ZStack {
- ForEach(Array(cards.enumerated()), id: \.offset) { idx, card in
- let isBehind = idx < cards.count - 1
- TaskCard(
- text: simplifyToolText(card.text) ?? card.text,
- icon: toolIcon(for: card.text),
- isBehind: isBehind,
- isInProgress: card.isInProgress
- )
- }
- }
- .compositingGroup()
- .transition(.blurReplace)
+ // Middle card: last completed tool step (Chowder-style)
+ TaskCard(
+ text: simplifyToolText(prevTool) ?? prevTool ?? "",
+ icon: toolIcon(for: prevTool),
+ isBehind: false,
+ isInProgress: false
+ )
+ .id(prevTool)
+ .transition(.asymmetric(
+ insertion: .offset(y: 120),
+ removal: .opacity
+ ))
}
}
.frame(height: 80)
diff --git a/CodyncShared/Sources/Models/CodyncAttributes.swift b/CodyncShared/Sources/Models/CodyncAttributes.swift
index 1d9ce777..96c860af 100644
--- a/CodyncShared/Sources/Models/CodyncAttributes.swift
+++ b/CodyncShared/Sources/Models/CodyncAttributes.swift
@@ -21,6 +21,7 @@ public struct CodyncAttributes: ActivityAttributes, Codable, Sendable {
public let completedCount: Int
public let totalCount: Int
public let currentTask: String?
+ public let previousTask: String?
public let contextPct: Int
public let costUSD: Double
public let durationSec: Int
@@ -28,6 +29,7 @@ public struct CodyncAttributes: ActivityAttributes, Codable, Sendable {
public init(status: String, model: String, tasks: [TaskItem],
completedCount: Int, totalCount: Int, currentTask: String?,
+ previousTask: String? = nil,
contextPct: Int, costUSD: Double, durationSec: Int,
sessionStartDate: Date = Date()) {
self.status = status
@@ -36,6 +38,7 @@ public struct CodyncAttributes: ActivityAttributes, Codable, Sendable {
self.completedCount = completedCount
self.totalCount = totalCount
self.currentTask = currentTask
+ self.previousTask = previousTask
self.contextPct = contextPct
self.costUSD = costUSD
self.durationSec = durationSec
@@ -70,6 +73,7 @@ public struct CodyncAttributes: Codable, Sendable {
public let completedCount: Int
public let totalCount: Int
public let currentTask: String?
+ public let previousTask: String?
public let contextPct: Int
public let costUSD: Double
public let durationSec: Int
@@ -77,6 +81,7 @@ public struct CodyncAttributes: Codable, Sendable {
public init(status: String, model: String, tasks: [TaskItem],
completedCount: Int, totalCount: Int, currentTask: String?,
+ previousTask: String? = nil,
contextPct: Int, costUSD: Double, durationSec: Int,
sessionStartDate: Date = Date()) {
self.status = status
@@ -85,6 +90,7 @@ public struct CodyncAttributes: Codable, Sendable {
self.completedCount = completedCount
self.totalCount = totalCount
self.currentTask = currentTask
+ self.previousTask = previousTask
self.contextPct = contextPct
self.costUSD = costUSD
self.durationSec = durationSec