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: segmented ring, shared SessionRowView, notch alignment fixes

libokai9c98173f452d
diff --git a/Codync-iOS/Views/Components/LiveActivityPreview.swift b/Codync-iOS/Views/Components/LiveActivityPreview.swift
index c747d1f0..70deee9f 100644
--- a/Codync-iOS/Views/Components/LiveActivityPreview.swift
+++ b/Codync-iOS/Views/Components/LiveActivityPreview.swift
@@ -43,6 +43,8 @@ struct LiveActivityPreview: View {
.stroke(theme.primaryText.opacity(0.06), lineWidth: 1)
)
)
+ .animation(.easeInOut(duration: 0.3), value: displaySessions.map(\.sessionId))
+ .animation(.easeInOut(duration: 0.3), value: displaySessions.map(\.currentTask))
}
// MARK: - Overall Preview
@@ -50,40 +52,19 @@ struct LiveActivityPreview: View {
@ViewBuilder
private var overallPreview: some View {
VStack(alignment: .leading, spacing: 4) {
- ForEach(Array(displaySessions.enumerated()), id: \.offset) { index, session in
+ ForEach(Array(displaySessions.enumerated()), id: \.element.sessionId) { index, session in
let isPrimary = primarySessionId != nil
? session.sessionId == primarySessionId
: index == 0
- HStack(spacing: 8) {
- Circle()
- .fill(dotColor(for: session.status, isPrimary: isPrimary))
- .frame(width: 7, height: 7)
-
- Text(session.projectName)
- .font(.system(size: 13, weight: isPrimary ? .semibold : .medium))
- .foregroundStyle(theme.primaryText)
- .lineLimit(1)
- .layoutPriority(1)
-
- Text(modelDisplayLabel(session.model))
- .font(.system(size: 10, weight: .medium))
- .foregroundStyle(theme.primaryText.opacity(0.5))
- .padding(.horizontal, 7)
- .padding(.vertical, 2)
- .background(
- Capsule().fill(theme.primaryText.opacity(0.08))
- )
-
- Spacer(minLength: 0)
-
- if let task = session.currentTask, !task.isEmpty {
- Text(task)
- .font(.system(size: 11))
- .foregroundStyle(theme.primaryText.opacity(0.3))
- .lineLimit(1)
- }
- }
+ SessionRowView(
+ projectName: session.projectName,
+ model: session.model,
+ currentTask: session.currentTask,
+ status: session.status,
+ isPrimary: isPrimary,
+ fg: theme.primaryText
+ )
.padding(.horizontal, 10)
.padding(.vertical, 8)
.background(
@@ -99,7 +80,7 @@ struct LiveActivityPreview: View {
@ViewBuilder
private var individualPreview: some View {
VStack(spacing: 8) {
- ForEach(Array(displaySessions.enumerated()), id: \.offset) { index, session in
+ ForEach(Array(displaySessions.enumerated()), id: \.element.sessionId) { index, session in
let isPrimary = primarySessionId != nil
? session.sessionId == primarySessionId
: index == 0
@@ -156,6 +137,8 @@ struct LiveActivityPreview: View {
.font(.system(size: 10, weight: .semibold))
.foregroundStyle(theme.primaryText)
.lineLimit(1)
+ .id(session.currentTask)
+ .transition(.push(from: .bottom))
Spacer()
@@ -203,15 +186,6 @@ struct LiveActivityPreview: View {
.zIndex(isBehind ? 0 : 1)
}
- private func dotColor(for status: SessionStatus, isPrimary: Bool) -> Color {
- if isPrimary { return theme.primaryText }
- switch status {
- case .working: return theme.primaryText
- case .idle: return theme.primaryText.opacity(0.3)
- default: return theme.primaryText.opacity(0.5)
- }
- }
-
// MARK: - Mock Data
static let mockSessions: [SessionState] = [
diff --git a/Codync-iOS/Views/IOSStatusIndicator.swift b/Codync-iOS/Views/IOSStatusIndicator.swift
index f8ce5a43..2cfebe97 100644
--- a/Codync-iOS/Views/IOSStatusIndicator.swift
+++ b/Codync-iOS/Views/IOSStatusIndicator.swift
@@ -6,16 +6,21 @@ struct SessionStatusView: View {
let completedTasks: Int
let totalTasks: Int
var waitingReason: WaitingReason?
+ @Environment(\.theme) private var theme
private var hasTasks: Bool { totalTasks > 0 }
- private var progress: Double {
- totalTasks > 0 ? Double(completedTasks) / Double(totalTasks) : 0
- }
var body: some View {
if hasTasks {
- ProgressRingView(progress: progress, status: status, waitingReason: waitingReason)
- .frame(width: 18, height: 18)
+ SegmentedRingView(
+ completedCount: completedTasks,
+ totalCount: totalTasks,
+ isWorking: status == .working,
+ fg: theme.primaryText,
+ lineWidth: 1.5,
+ gapDegrees: 24
+ )
+ .frame(width: 12, height: 12)
} else if status == .working {
ClaudeSparkleView()
.frame(width: 14, height: 14)
@@ -25,50 +30,6 @@ struct SessionStatusView: View {
}
}
-// MARK: - Progress Ring
-
-private struct ProgressRingView: View {
- let progress: Double
- let status: SessionStatus
- var waitingReason: WaitingReason?
- @Environment(\.theme) private var theme
- @State private var isPulsing = false
-
- private var isWorking: Bool { status == .working }
- private var needsAttention: Bool { status == .needsInput || status == .error }
-
- var body: some View {
- ZStack {
- Circle()
- .stroke(theme.secondaryText.opacity(0.15), lineWidth: 2)
- Circle()
- .trim(from: 0, to: progress)
- .stroke(theme.primaryText.opacity(0.7), style: StrokeStyle(lineWidth: 2, lineCap: .round))
- .rotationEffect(.degrees(-90))
- if isWorking {
- Circle()
- .trim(from: max(0, progress - 0.08), to: progress)
- .stroke(theme.primaryText.opacity(0.4), style: StrokeStyle(lineWidth: 3, lineCap: .round))
- .rotationEffect(.degrees(-90))
- .blur(radius: 1.5)
- .opacity(isPulsing ? 1.0 : 0.3)
- }
- if needsAttention {
- Circle()
- .fill(theme.waitingColor(for: waitingReason))
- .frame(width: 5, height: 5)
- .offset(x: 6, y: -6)
- }
- }
- .animation(
- isWorking ? .easeInOut(duration: 1.2).repeatForever(autoreverses: true) : .default,
- value: isPulsing
- )
- .onAppear { if isWorking { isPulsing = true } }
- .onChange(of: status) { _, _ in isPulsing = (status == .working) }
- }
-}
-
// MARK: - Minimal Dot
private struct MinimalDotView: View {
diff --git a/Codync-macOS/App/MenuBarController.swift b/Codync-macOS/App/MenuBarController.swift
index b9d8899d..2816e3ac 100644
--- a/Codync-macOS/App/MenuBarController.swift
+++ b/Codync-macOS/App/MenuBarController.swift
@@ -311,7 +311,7 @@ private struct CodyncPanelContentView: View {
bottomCornerRadius: bottomCornerRadius
))
.shadow(color: isExpanded ? .black.opacity(0.6) : .clear, radius: 8)
- .offset(x: isExpanded ? 0 : 15, y: isExpanded ? 0 : -2)
+ .offset(x: isExpanded ? 0 : 15)
.background(
GeometryReader { geo in
Color.clear.preference(key: ContentHeightKey.self, value: geo.size.height)
diff --git a/Codync-macOS/App/NSScreen+Notch.swift b/Codync-macOS/App/NSScreen+Notch.swift
index 59fbf855..f49b8ee2 100644
--- a/Codync-macOS/App/NSScreen+Notch.swift
+++ b/Codync-macOS/App/NSScreen+Notch.swift
@@ -28,8 +28,8 @@ extension NSScreen {
let fullWidth = frame.width
let leftPadding = auxiliaryTopLeftArea?.width ?? 0
let rightPadding = auxiliaryTopRightArea?.width ?? 0
- let notchWidth = fullWidth - leftPadding - rightPadding + 4
- let notchHeight = safeAreaInsets.top + 2
+ let notchWidth = fullWidth - leftPadding - rightPadding
+ let notchHeight = safeAreaInsets.top + 1
return CGSize(width: notchWidth, height: notchHeight)
}
}
diff --git a/Codync-macOS/Views/StatusDotView.swift b/Codync-macOS/Views/StatusDotView.swift
index 07bd0944..2cfebe97 100644
--- a/Codync-macOS/Views/StatusDotView.swift
+++ b/Codync-macOS/Views/StatusDotView.swift
@@ -6,16 +6,21 @@ struct SessionStatusView: View {
let completedTasks: Int
let totalTasks: Int
var waitingReason: WaitingReason?
+ @Environment(\.theme) private var theme
private var hasTasks: Bool { totalTasks > 0 }
- private var progress: Double {
- totalTasks > 0 ? Double(completedTasks) / Double(totalTasks) : 0
- }
var body: some View {
if hasTasks {
- ProgressRingView(progress: progress, status: status, waitingReason: waitingReason)
- .frame(width: 18, height: 18)
+ SegmentedRingView(
+ completedCount: completedTasks,
+ totalCount: totalTasks,
+ isWorking: status == .working,
+ fg: theme.primaryText,
+ lineWidth: 1.5,
+ gapDegrees: 24
+ )
+ .frame(width: 12, height: 12)
} else if status == .working {
ClaudeSparkleView()
.frame(width: 14, height: 14)
@@ -25,54 +30,6 @@ struct SessionStatusView: View {
}
}
-// MARK: - Progress Ring
-
-private struct ProgressRingView: View {
- let progress: Double
- let status: SessionStatus
- var waitingReason: WaitingReason?
- @Environment(\.theme) private var theme
- @State private var isPulsing = false
-
- private var isWorking: Bool { status == .working }
- private var needsAttention: Bool { status == .needsInput || status == .error }
-
- var body: some View {
- ZStack {
- Circle()
- .stroke(theme.secondaryText.opacity(0.15), lineWidth: 2)
- Circle()
- .trim(from: 0, to: progress)
- .stroke(theme.primaryText.opacity(0.7), style: StrokeStyle(lineWidth: 2, lineCap: .round))
- .rotationEffect(.degrees(-90))
- if isWorking {
- Circle()
- .trim(from: max(0, progress - 0.08), to: progress)
- .stroke(theme.primaryText.opacity(0.4), style: StrokeStyle(lineWidth: 3, lineCap: .round))
- .rotationEffect(.degrees(-90))
- .blur(radius: 1.5)
- .opacity(isPulsing ? 1.0 : 0.3)
- }
- if needsAttention {
- Circle()
- .fill(attentionColor)
- .frame(width: 5, height: 5)
- .offset(x: 6, y: -6)
- }
- }
- .animation(
- isWorking ? .easeInOut(duration: 1.2).repeatForever(autoreverses: true) : .default,
- value: isPulsing
- )
- .onAppear { if isWorking { isPulsing = true } }
- .onChange(of: status) { _, _ in isPulsing = (status == .working) }
- }
-
- private var attentionColor: Color {
- theme.waitingColor(for: waitingReason)
- }
-}
-
// MARK: - Minimal Dot
private struct MinimalDotView: View {
diff --git a/CodyncLiveActivity/CodyncLiveActivityWidget.swift b/CodyncLiveActivity/CodyncLiveActivityWidget.swift
index 94c9fd88..62a397e9 100644
--- a/CodyncLiveActivity/CodyncLiveActivityWidget.swift
+++ b/CodyncLiveActivity/CodyncLiveActivityWidget.swift
@@ -679,38 +679,16 @@ struct OverallLiveActivityWidget: Widget {
@ViewBuilder
private func overallSessionRow(session: SessionSummary, isPrimary: Bool, isDark: Bool) -> some View {
- let task = session.currentTask.flatMap { $0.isEmpty ? nil : $0 }
let fg: Color = isDark ? .white : widgetFg
- HStack(spacing: 8) {
- Circle()
- .fill(overallDotColor(session.status, isDark: isDark))
- .frame(width: 8, height: 8)
-
- Text(session.projectName)
- .font(.subheadline.weight(.medium))
- .foregroundStyle(fg)
- .lineLimit(1)
- .layoutPriority(1)
-
- Text(modelLabel(session.model))
- .font(.system(size: 10, weight: .medium))
- .foregroundStyle(fg.opacity(0.6))
- .padding(.horizontal, 6)
- .padding(.vertical, 2)
- .background(fg.opacity(0.1), in: Capsule())
-
- if let task {
- Text(task)
- .font(.caption)
- .foregroundStyle(fg.opacity(0.4))
- .lineLimit(1)
- .id(task)
- .transition(.push(from: .bottom))
- }
-
- Spacer(minLength: 0)
- }
+ SessionRowView(
+ projectName: session.projectName,
+ model: session.model,
+ currentTask: session.currentTask,
+ status: session.status,
+ isPrimary: isPrimary,
+ fg: fg
+ )
.padding(.horizontal, 12)
.padding(.vertical, 8)
}
@@ -720,18 +698,6 @@ struct OverallLiveActivityWidget: Widget {
?? state.sessions.first
}
- private func overallDotColor(_ status: SessionStatus, isDark: Bool) -> Color {
- let base: Color = isDark ? .white : widgetFg
- switch status {
- case .working: return base
- case .needsInput: return base.opacity(0.7)
- case .compacting: return base.opacity(0.5)
- case .idle: return base.opacity(0.3)
- case .error: return base.opacity(0.5)
- case .completed: return base.opacity(0.3)
- }
- }
-
private func modelLabel(_ model: String) -> String {
modelDisplayLabel(model)
}
diff --git a/CodyncShared/Sources/Theme/SegmentedRingView.swift b/CodyncShared/Sources/Theme/SegmentedRingView.swift
new file mode 100644
index 00000000..d33fa277
--- /dev/null
+++ b/CodyncShared/Sources/Theme/SegmentedRingView.swift
@@ -0,0 +1,63 @@
+import SwiftUI
+
+/// Segmented progress ring showing individual task segments.
+/// Each task is a separate arc with brightness indicating status.
+/// Shared across iOS and macOS targets.
+public struct SegmentedRingView: View {
+ public let completedCount: Int
+ public let totalCount: Int
+ public let isWorking: Bool
+ public let fg: Color
+ public var lineWidth: CGFloat = 2
+ public var gapDegrees: Double = 6
+
+ public init(completedCount: Int, totalCount: Int, isWorking: Bool, fg: Color,
+ lineWidth: CGFloat = 2, gapDegrees: Double = 6) {
+ self.completedCount = completedCount
+ self.totalCount = totalCount
+ self.isWorking = isWorking
+ self.fg = fg
+ self.lineWidth = lineWidth
+ self.gapDegrees = gapDegrees
+ }
+
+ public var body: some View {
+ Canvas { context, size in
+ let center = CGPoint(x: size.width / 2, y: size.height / 2)
+ let radius = min(size.width, size.height) / 2 - lineWidth / 2
+ let total = max(totalCount, 1)
+ let totalGap = gapDegrees * Double(total)
+ let segmentDegrees = (360.0 - totalGap) / Double(total)
+
+ for i in 0..<total {
+ let startAngle = -90.0 + Double(i) * (segmentDegrees + gapDegrees)
+ let endAngle = startAngle + segmentDegrees
+
+ let path = Path { p in
+ p.addArc(
+ center: center,
+ radius: radius,
+ startAngle: .degrees(startAngle),
+ endAngle: .degrees(endAngle),
+ clockwise: false
+ )
+ }
+
+ let opacity: Double
+ if i < completedCount {
+ opacity = 0.8
+ } else if i == completedCount && isWorking {
+ opacity = 0.4
+ } else {
+ opacity = 0.12
+ }
+
+ context.stroke(
+ path,
+ with: .color(fg.opacity(opacity)),
+ style: StrokeStyle(lineWidth: lineWidth, lineCap: .round)
+ )
+ }
+ }
+ }
+}
diff --git a/CodyncShared/Sources/Theme/SessionRowView.swift b/CodyncShared/Sources/Theme/SessionRowView.swift
new file mode 100644
index 00000000..b50729d1
--- /dev/null
+++ b/CodyncShared/Sources/Theme/SessionRowView.swift
@@ -0,0 +1,65 @@
+import SwiftUI
+
+/// Shared session row used in both Live Activity widget and in-app preview.
+/// Renders: dot + project name + model tag + spacer + current task
+public struct SessionRowView: View {
+ public let projectName: String
+ public let model: String
+ public let currentTask: String?
+ public let status: SessionStatus
+ public let isPrimary: Bool
+ public let fg: Color
+
+ public init(
+ projectName: String, model: String, currentTask: String?,
+ status: SessionStatus, isPrimary: Bool, fg: Color
+ ) {
+ self.projectName = projectName
+ self.model = model
+ self.currentTask = currentTask
+ self.status = status
+ self.isPrimary = isPrimary
+ self.fg = fg
+ }
+
+ public var body: some View {
+ HStack(spacing: 8) {
+ Circle()
+ .fill(dotColor)
+ .frame(width: 7, height: 7)
+
+ Text(projectName)
+ .font(.system(size: 13, weight: isPrimary ? .semibold : .medium))
+ .foregroundStyle(fg)
+ .lineLimit(1)
+ .layoutPriority(1)
+
+ Text(modelDisplayLabel(model))
+ .font(.system(size: 10, weight: .medium))
+ .foregroundStyle(fg.opacity(0.5))
+ .padding(.horizontal, 6)
+ .padding(.vertical, 2)
+ .background(fg.opacity(0.08), in: Capsule())
+
+ Spacer(minLength: 0)
+
+ if let task = currentTask, !task.isEmpty {
+ Text(task)
+ .font(.system(size: 11))
+ .foregroundStyle(fg.opacity(0.4))
+ .lineLimit(1)
+ .id(task)
+ .transition(.push(from: .bottom))
+ }
+ }
+ }
+
+ private var dotColor: Color {
+ if isPrimary { return fg }
+ switch status {
+ case .working: return fg
+ case .idle: return fg.opacity(0.3)
+ default: return fg.opacity(0.5)
+ }
+ }
+}