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: 3-second Glass Morph reorder animation on iOS and macOS

libokaid9aed8699343
diff --git a/Codync-iOS/Views/IOSRootView.swift b/Codync-iOS/Views/IOSRootView.swift
index 9652ccf9..d233992b 100644
--- a/Codync-iOS/Views/IOSRootView.swift
+++ b/Codync-iOS/Views/IOSRootView.swift
@@ -6,6 +6,8 @@ struct IOSRootView: View {
@ObservedObject var liveActivityManager: LiveActivityManager
@AppStorage("codync_onboardingComplete") private var onboardingComplete = false
@AppStorage("codync_darkMode") private var isDarkMode = true
+ @State private var displayedSessions: [SessionState] = []
+ @State private var reorderTimer: Timer?
var body: some View {
NavigationStack {
@@ -14,7 +16,7 @@ struct IOSRootView: View {
IOSOnboardingView()
} else {
IOSSessionListView(
- sessions: receiver.sessions,
+ sessions: displayedSessions,
liveActivityManager: liveActivityManager
)
}
@@ -28,5 +30,31 @@ struct IOSRootView: View {
}
liveActivityManager.updateSessions(sessions)
}
+ .task {
+ // Initialize with current sessions
+ displayedSessions = sortSessions(receiver.sessions)
+ // Start 3-second reorder timer
+ reorderTimer = Timer.scheduledTimer(withTimeInterval: 3, repeats: true) { _ in
+ Task { @MainActor in
+ let sorted = sortSessions(receiver.sessions)
+ withAnimation(.spring(duration: 0.6, bounce: 0.15)) {
+ displayedSessions = sorted
+ }
+ }
+ }
+ }
+ .onDisappear {
+ reorderTimer?.invalidate()
+ reorderTimer = nil
+ }
+ }
+
+ private func sortSessions(_ sessions: [SessionState]) -> [SessionState] {
+ sessions.sorted { a, b in
+ let aWeight = a.status == .working ? 0 : a.status == .needsInput ? 1 : 2
+ let bWeight = b.status == .working ? 0 : b.status == .needsInput ? 1 : 2
+ if aWeight != bWeight { return aWeight < bWeight }
+ return a.updatedAt > b.updatedAt
+ }
}
}
diff --git a/Codync-macOS/Views/SessionListView.swift b/Codync-macOS/Views/SessionListView.swift
index a03db204..3cdb6fca 100644
--- a/Codync-macOS/Views/SessionListView.swift
+++ b/Codync-macOS/Views/SessionListView.swift
@@ -6,6 +6,10 @@ struct SessionListView: View {
var panelState: CodyncPanelState?
@AppStorage("codync_darkMode") private var isDarkMode = false
@State private var selectedSession: SessionState?
+ @State private var displayedSessions: [SessionState] = []
+ @State private var reorderTimer: Timer?
+ @State private var previousOrder: [String] = []
+ @State private var cardStyles: [String: GlassCardStyle] = [:]
@Environment(\.theme) private var injectedTheme
private var theme: CodyncTheme {
@@ -28,6 +32,21 @@ struct SessionListView: View {
.background(theme.background)
.environment(\.theme, theme)
.preferredColorScheme(theme.isDark ? .dark : .light)
+ .task {
+ displayedSessions = stateManager.sessions
+ reorderTimer = Timer.scheduledTimer(withTimeInterval: 3, repeats: true) { _ in
+ Task { @MainActor in
+ let sorted = stateManager.sessions
+ withAnimation(.spring(duration: 0.6, bounce: 0.15)) {
+ displayedSessions = sorted
+ }
+ }
+ }
+ }
+ .onDisappear {
+ reorderTimer?.invalidate()
+ reorderTimer = nil
+ }
}
private var sessionList: some View {
@@ -36,15 +55,16 @@ struct SessionListView: View {
PanelHeaderView(panelState: panelState)
}
- if stateManager.sessions.isEmpty {
+ if displayedSessions.isEmpty && stateManager.sessions.isEmpty {
emptyState
} else {
ScrollView(.vertical, showsIndicators: false) {
VStack(spacing: 2) {
- ForEach(stateManager.sessions) { session in
+ ForEach(displayedSessions) { session in
SessionRowView(session: session) {
withAnimation(.easeInOut(duration: 0.2)) { selectedSession = session }
}
+ .glassCard(cardStyles[session.sessionId] ?? .normal, isDark: theme.isDark)
}
}
.padding(.vertical, 6)
@@ -56,6 +76,23 @@ struct SessionListView: View {
.padding(.vertical, 6)
}
}
+ .onChange(of: displayedSessions.map(\.sessionId)) { _, newOrder in
+ var newStyles: [String: GlassCardStyle] = [:]
+ for (newIdx, id) in newOrder.enumerated() {
+ if let oldIdx = previousOrder.firstIndex(of: id) {
+ if newIdx < oldIdx { newStyles[id] = .elevated }
+ else if newIdx > oldIdx { newStyles[id] = .receded }
+ }
+ }
+ cardStyles = newStyles
+ previousOrder = newOrder
+
+ // Reset after 0.8s
+ Task {
+ try? await Task.sleep(for: .seconds(0.8))
+ withAnimation(.easeOut(duration: 0.3)) { cardStyles = [:] }
+ }
+ }
}
private var emptyState: some View {