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: stacked tool cards in Live Activity (Chowder-style)

libokai88a9fbf03d00
diff --git a/Codync-iOS/Services/LiveActivityManager.swift b/Codync-iOS/Services/LiveActivityManager.swift
index a3b9fe55..47d6e67a 100644
--- a/Codync-iOS/Services/LiveActivityManager.swift
+++ b/Codync-iOS/Services/LiveActivityManager.swift
@@ -16,7 +16,8 @@ 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 previousTasks: [String: String] = [:] // sessionId → last completed tool
+ private var secondPreviousTasks: [String: String] = [:] // sessionId → second-last tool
private var tickTimer: Timer?
private static let maxActivities = 4
@@ -258,6 +259,8 @@ final class LiveActivityManager: ObservableObject {
if let current = currentTool,
let prev = lastPushedState[session.sessionId]?.currentTask,
current != prev, !prev.isEmpty {
+ // Shift chain: previous → secondPrevious, current → previous
+ secondPreviousTasks[session.sessionId] = previousTasks[session.sessionId]
previousTasks[session.sessionId] = prev
}
@@ -270,6 +273,7 @@ final class LiveActivityManager: ObservableObject {
totalCount: session.totalTaskCount,
currentTask: currentTool,
previousTask: previousTasks[session.sessionId],
+ secondPreviousTask: secondPreviousTasks[session.sessionId],
contextPct: session.contextPct,
costUSD: session.costUSD,
durationSec: liveDuration,
diff --git a/CodyncLiveActivity/CodyncLiveActivityWidget.swift b/CodyncLiveActivity/CodyncLiveActivityWidget.swift
index 905da5f1..ff6e8808 100644
--- a/CodyncLiveActivity/CodyncLiveActivityWidget.swift
+++ b/CodyncLiveActivity/CodyncLiveActivityWidget.swift
@@ -250,18 +250,30 @@ struct CodyncLiveActivityWidget: Widget {
.frame(maxWidth: .infinity, alignment: .trailing)
.transition(.blurReplace)
} else {
- // 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
- ))
+ // Stacked cards: secondPrevious behind, previous in front
+ let secondPrev = nonEmpty(state.secondPreviousTask)
+ ZStack {
+ if let sp = secondPrev {
+ TaskCard(
+ text: simplifyToolText(sp) ?? sp,
+ icon: toolIcon(for: sp),
+ isBehind: true,
+ isInProgress: false
+ )
+ }
+ TaskCard(
+ text: simplifyToolText(prevTool) ?? prevTool ?? "",
+ icon: toolIcon(for: prevTool),
+ isBehind: false,
+ isInProgress: false
+ )
+ .id(prevTool)
+ .transition(.asymmetric(
+ insertion: .offset(y: 120),
+ removal: .opacity
+ ))
+ }
+ .compositingGroup()
}
}
.frame(height: 80)
diff --git a/CodyncShared/Sources/Models/CodyncAttributes.swift b/CodyncShared/Sources/Models/CodyncAttributes.swift
index 96c860af..943c1fd3 100644
--- a/CodyncShared/Sources/Models/CodyncAttributes.swift
+++ b/CodyncShared/Sources/Models/CodyncAttributes.swift
@@ -22,6 +22,7 @@ public struct CodyncAttributes: ActivityAttributes, Codable, Sendable {
public let totalCount: Int
public let currentTask: String?
public let previousTask: String?
+ public let secondPreviousTask: String?
public let contextPct: Int
public let costUSD: Double
public let durationSec: Int
@@ -30,6 +31,7 @@ public struct CodyncAttributes: ActivityAttributes, Codable, Sendable {
public init(status: String, model: String, tasks: [TaskItem],
completedCount: Int, totalCount: Int, currentTask: String?,
previousTask: String? = nil,
+ secondPreviousTask: String? = nil,
contextPct: Int, costUSD: Double, durationSec: Int,
sessionStartDate: Date = Date()) {
self.status = status
@@ -39,6 +41,7 @@ public struct CodyncAttributes: ActivityAttributes, Codable, Sendable {
self.totalCount = totalCount
self.currentTask = currentTask
self.previousTask = previousTask
+ self.secondPreviousTask = secondPreviousTask
self.contextPct = contextPct
self.costUSD = costUSD
self.durationSec = durationSec
@@ -74,6 +77,7 @@ public struct CodyncAttributes: Codable, Sendable {
public let totalCount: Int
public let currentTask: String?
public let previousTask: String?
+ public let secondPreviousTask: String?
public let contextPct: Int
public let costUSD: Double
public let durationSec: Int
@@ -82,6 +86,7 @@ public struct CodyncAttributes: Codable, Sendable {
public init(status: String, model: String, tasks: [TaskItem],
completedCount: Int, totalCount: Int, currentTask: String?,
previousTask: String? = nil,
+ secondPreviousTask: String? = nil,
contextPct: Int, costUSD: Double, durationSec: Int,
sessionStartDate: Date = Date()) {
self.status = status
@@ -91,6 +96,7 @@ public struct CodyncAttributes: Codable, Sendable {
self.totalCount = totalCount
self.currentTask = currentTask
self.previousTask = previousTask
+ self.secondPreviousTask = secondPreviousTask
self.contextPct = contextPct
self.costUSD = costUSD
self.durationSec = durationSec