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: primary session toggle, depth opacity, preview capsule button

libokai844e0a00c51c
diff --git a/Codync-iOS/Services/PrimarySessionManager.swift b/Codync-iOS/Services/PrimarySessionManager.swift
index 0e8b037c..3b672a03 100644
--- a/Codync-iOS/Services/PrimarySessionManager.swift
+++ b/Codync-iOS/Services/PrimarySessionManager.swift
@@ -10,27 +10,31 @@ final class PrimarySessionManager: ObservableObject {
@Published var isManuallyLocked: Bool = false
func autoSelect(from sessions: [SessionState]) {
- if isManuallyLocked {
- if let lockedId = primarySessionId,
- !sessions.contains(where: { $0.sessionId == lockedId }) {
- logger.info("Locked primary session \(lockedId) no longer exists, unlocking")
- isManuallyLocked = false
- } else {
- return
+ guard isManuallyLocked else {
+ // No manual lock — no primary session
+ if primarySessionId != nil {
+ primarySessionId = nil
}
+ return
}
- let best = sessions
- .sorted { autoFillPriority($0) > autoFillPriority($1) }
- .first
- if primarySessionId != best?.sessionId {
- primarySessionId = best?.sessionId
- if let id = primarySessionId {
- logger.info("Auto-selected primary: \(id)")
- }
+ // If locked session disappeared, unlock
+ if let lockedId = primarySessionId,
+ !sessions.contains(where: { $0.sessionId == lockedId }) {
+ logger.info("Locked primary session \(lockedId) no longer exists, unlocking")
+ isManuallyLocked = false
+ primarySessionId = nil
}
}
func manualLock(_ sessionId: String) {
+ if primarySessionId == sessionId && isManuallyLocked {
+ // Tap again to deselect — let algorithm auto-decide
+ isManuallyLocked = false
+ primarySessionId = nil
+ logger.info("Deselected primary: \(sessionId)")
+ Task { await save() }
+ return
+ }
primarySessionId = sessionId
isManuallyLocked = true
logger.info("Manually locked primary: \(sessionId)")
diff --git a/Codync-iOS/Views/Components/LiveActivityPreview.swift b/Codync-iOS/Views/Components/LiveActivityPreview.swift
index 41cf403f..e2e50e80 100644
--- a/Codync-iOS/Views/Components/LiveActivityPreview.swift
+++ b/Codync-iOS/Views/Components/LiveActivityPreview.swift
@@ -92,6 +92,9 @@ struct LiveActivityPreview: View {
@ViewBuilder
private func individualCard(session: SessionState, isPrimary: Bool) -> some View {
+ let currentTool = session.currentTask ?? "Working…"
+ let prevTool = session.lastEvent ?? session.summary
+
VStack(alignment: .leading, spacing: 0) {
// Header
HStack(spacing: 6) {
@@ -118,12 +121,19 @@ struct LiveActivityPreview: View {
Spacer().frame(height: 6)
- // Mini card stack
+ // Mini card stack — mirrors widget's TaskCard behavior
ZStack {
- miniCard(text: "Searching code", isBehind: true)
- miniCard(text: session.currentTask ?? "Reading file", isBehind: false)
+ miniCard(text: prevTool, isBehind: true)
+ miniCard(text: currentTool, isBehind: false)
+ .id(currentTool)
+ .transition(.asymmetric(
+ insertion: .offset(y: 80),
+ removal: .opacity
+ ))
}
.frame(height: 36)
+ .compositingGroup()
+ .clipped()
Spacer().frame(height: 6)
@@ -133,11 +143,11 @@ struct LiveActivityPreview: View {
.font(.system(size: 8, weight: .semibold))
.foregroundStyle(theme.primaryText.opacity(0.4))
.frame(width: 14, height: 14)
- Text(session.currentTask ?? "Working…")
+ Text(currentTool)
.font(.system(size: 10, weight: .semibold))
.foregroundStyle(theme.primaryText)
.lineLimit(1)
- .id(session.currentTask)
+ .id(currentTool)
.transition(.push(from: .bottom))
Spacer()
diff --git a/Codync-iOS/Views/IOSSessionListView.swift b/Codync-iOS/Views/IOSSessionListView.swift
index d21f4003..354c30fe 100644
--- a/Codync-iOS/Views/IOSSessionListView.swift
+++ b/Codync-iOS/Views/IOSSessionListView.swift
@@ -10,18 +10,19 @@ struct IOSSessionListView: View {
var body: some View {
ScrollView {
- LazyVStack(spacing: 1) {
+ LazyVStack(spacing: 4) {
// Collapsible settings
if showSettings {
modeSection
}
// Session list
- ForEach(sessions) { session in
+ ForEach(Array(sessions.enumerated()), id: \.element.sessionId) { index, session in
NavigationLink(destination: IOSSessionDetailView(session: session)) {
SessionRowContent(
session: session,
isPrimary: primarySessionManager.primarySessionId == session.sessionId,
+ depth: index,
onSetPrimary: { primarySessionManager.manualLock(session.sessionId) }
)
}
@@ -33,16 +34,27 @@ struct IOSSessionListView: View {
.background(theme.background)
.navigationBarTitleDisplayMode(.inline)
.toolbar {
- ToolbarItem(placement: .topBarTrailing) {
+ ToolbarItem(placement: .principal) {
Button {
withAnimation(.easeInOut(duration: 0.25)) {
showSettings.toggle()
}
} label: {
- Image(systemName: showSettings ? "gearshape.fill" : "gearshape")
- .font(.system(size: 15))
- .foregroundStyle(showSettings ? theme.accent : theme.secondaryText)
+ HStack(spacing: 5) {
+ Image(systemName: showSettings ? "chevron.up" : "chevron.down")
+ .font(.system(size: 9, weight: .semibold))
+ Text("Preview")
+ .font(.system(size: 13, weight: .medium))
+ }
+ .foregroundStyle(showSettings ? theme.primaryText : theme.secondaryText)
+ .padding(.horizontal, 14)
+ .padding(.vertical, 6)
+ .background(
+ Capsule()
+ .fill(showSettings ? theme.primaryText.opacity(0.1) : theme.primaryText.opacity(0.05))
+ )
}
+ .buttonStyle(.plain)
}
}
.toolbarColorScheme(.dark, for: .navigationBar)
@@ -94,6 +106,7 @@ struct IOSSessionListView: View {
private struct SessionRowContent: View {
let session: SessionState
let isPrimary: Bool
+ var depth: Int = 0
let onSetPrimary: () -> Void
@Environment(\.theme) private var theme
@@ -159,6 +172,9 @@ private struct SessionRowContent: View {
.padding(.horizontal, 8)
: nil
)
+ .opacity(depth == 0 ? 1.0 : max(0.65, 1.0 - Double(depth) * 0.1))
+ .animation(.spring(duration: 0.5, bounce: 0.15), value: isPrimary)
+ .animation(.spring(duration: 0.5, bounce: 0.15), value: depth)
}
private var subtitleColor: Color {