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.

refactor: update all views to minimal grayscale design

libokaic53966b40720
diff --git a/CodePulse-macOS/Views/SessionDetailView.swift b/CodePulse-macOS/Views/SessionDetailView.swift
index b5f94e3c..f45d2d80 100644
--- a/CodePulse-macOS/Views/SessionDetailView.swift
+++ b/CodePulse-macOS/Views/SessionDetailView.swift
@@ -4,10 +4,10 @@ import CodePulseShared
struct SessionDetailView: View {
let session: SessionState
let onBack: () -> Void
+ @Environment(\.theme) private var theme
var body: some View {
VStack(spacing: 0) {
- // Navigation header
HStack(spacing: 6) {
Button(action: onBack) {
HStack(spacing: 2) {
@@ -16,43 +16,53 @@ struct SessionDetailView: View {
Text("Back")
.font(.system(size: 12))
}
- .foregroundStyle(.secondary)
+ .foregroundStyle(theme.secondaryText)
}
.buttonStyle(.plain)
+ .onHover { inside in
+ if inside { NSCursor.pointingHand.push() }
+ else { NSCursor.pop() }
+ }
Spacer()
- StatusDotView(status: session.status)
+ SessionStatusView(
+ status: session.status,
+ completedTasks: session.completedTaskCount,
+ totalTasks: session.totalTaskCount
+ )
Text(session.status.label)
.font(.system(size: 11, weight: .medium))
- .foregroundStyle(session.status.color)
+ .foregroundStyle(session.status == .needsInput ? theme.warning : theme.secondaryText)
}
.padding(.horizontal, 12)
.padding(.vertical, 8)
Divider().padding(.horizontal, 8)
- ScrollView {
+ ScrollView(.vertical, showsIndicators: false) {
VStack(alignment: .leading, spacing: 12) {
-
- // Title section
VStack(alignment: .leading, spacing: 4) {
- Text(session.summary)
- .font(.system(size: 14, weight: .semibold))
- .lineLimit(2)
-
+ HStack(spacing: 4) {
+ Text(session.summary)
+ .font(.system(size: 14, weight: .semibold))
+ .foregroundStyle(theme.primaryText)
+ .lineLimit(2)
+ if !session.model.isEmpty {
+ SessionTagView(tag: session.model)
+ }
+ }
HStack(spacing: 6) {
Label(session.projectName, systemImage: "folder")
- Text("·")
- Text(session.gitBranch)
- Text("·")
- Text(session.model)
+ if !session.gitBranch.isEmpty {
+ Text("·")
+ Text(session.gitBranch)
+ }
}
.font(.system(size: 11))
- .foregroundStyle(.secondary)
+ .foregroundStyle(theme.secondaryText)
}
- // Stats row
HStack(spacing: 0) {
statItem("\(session.contextPct)%", "Context")
Divider().frame(height: 24)
@@ -63,30 +73,30 @@ struct SessionDetailView: View {
.padding(.vertical, 6)
.background(
RoundedRectangle(cornerRadius: 8, style: .continuous)
- .fill(.quaternary.opacity(0.3))
+ .fill(theme.cardBackground)
)
- // Tasks section
if !session.tasks.isEmpty {
- VStack(alignment: .leading, spacing: 8) {
- HStack {
- Text("Tasks")
- .font(.system(size: 12, weight: .medium))
+ VStack(alignment: .leading, spacing: 10) {
+ HStack(spacing: 10) {
+ DetailProgressRing(completed: session.completedTaskCount, total: session.totalTaskCount)
+ VStack(alignment: .leading, spacing: 2) {
+ Text("Tasks")
+ .font(.system(size: 12, weight: .medium))
+ .foregroundStyle(theme.primaryText)
+ Text("\(session.completedTaskCount) of \(session.totalTaskCount) completed")
+ .font(.system(size: 11))
+ .foregroundStyle(theme.secondaryText)
+ }
Spacer()
- Text("\(session.completedTaskCount)/\(session.totalTaskCount)")
- .font(.system(size: 11, design: .rounded))
- .foregroundStyle(.secondary)
}
-
- ProgressBarView(tasks: session.tasks)
-
VStack(alignment: .leading, spacing: 4) {
ForEach(session.tasks) { task in
HStack(spacing: 6) {
taskIcon(task.status)
Text(task.content)
.font(.system(size: 12))
- .foregroundStyle(task.status == .pending ? .tertiary : .primary)
+ .foregroundStyle(task.status == .pending ? theme.secondaryText : theme.primaryText)
.lineLimit(1)
}
}
@@ -104,14 +114,11 @@ struct SessionDetailView: View {
Group {
switch status {
case .completed:
- Image(systemName: "checkmark.circle.fill")
- .foregroundStyle(.green)
+ Image(systemName: "checkmark.circle.fill").foregroundStyle(.blue)
case .inProgress:
- Image(systemName: "circlebadge.fill")
- .foregroundStyle(.cyan)
+ Image(systemName: "circlebadge.fill").foregroundStyle(.blue)
case .pending:
- Image(systemName: "circle")
- .foregroundStyle(.tertiary)
+ Image(systemName: "circle").foregroundStyle(theme.secondaryText)
}
}
.font(.system(size: 11))
@@ -121,9 +128,10 @@ struct SessionDetailView: View {
VStack(spacing: 2) {
Text(value)
.font(.system(size: 13, weight: .semibold, design: .rounded))
+ .foregroundStyle(theme.primaryText)
Text(label)
.font(.system(size: 10))
- .foregroundStyle(.secondary)
+ .foregroundStyle(theme.secondaryText)
}
.frame(maxWidth: .infinity)
}
@@ -136,3 +144,31 @@ struct SessionDetailView: View {
return "\(h)h \(m)m"
}
}
+
+private struct DetailProgressRing: View {
+ let completed: Int
+ let total: Int
+ @State private var animatedProgress: Double = 0
+
+ private var progress: Double {
+ total > 0 ? Double(completed) / Double(total) : 0
+ }
+
+ var body: some View {
+ ZStack {
+ Circle().stroke(Color.primary.opacity(0.06), lineWidth: 3)
+ Circle()
+ .trim(from: 0, to: animatedProgress)
+ .stroke(Color.blue, style: StrokeStyle(lineWidth: 3, lineCap: .round))
+ .rotationEffect(.degrees(-90))
+ Text("\(Int(progress * 100))%")
+ .font(.system(size: 10, weight: .semibold, design: .rounded))
+ .foregroundStyle(.primary)
+ }
+ .frame(width: 36, height: 36)
+ .onAppear { withAnimation(.easeOut(duration: 0.6)) { animatedProgress = progress } }
+ .onChange(of: progress) { _, newValue in
+ withAnimation(.easeOut(duration: 0.4)) { animatedProgress = newValue }
+ }
+ }
+}
diff --git a/CodePulse-macOS/Views/SessionListView.swift b/CodePulse-macOS/Views/SessionListView.swift
index 003654fa..3d957ddc 100644
--- a/CodePulse-macOS/Views/SessionListView.swift
+++ b/CodePulse-macOS/Views/SessionListView.swift
@@ -3,12 +3,14 @@ import CodePulseShared
struct SessionListView: View {
@ObservedObject var stateManager: SessionStateManager
+ @AppStorage("codepulse_darkMode") private var isDarkMode = false
@State private var selectedSession: SessionState?
+ private var theme: CodePulseTheme { CodePulseTheme(isDark: isDarkMode) }
+
var body: some View {
VStack(spacing: 0) {
if let selected = selectedSession {
- // Find the live version of this session
let liveSession = stateManager.sessions.first { $0.sessionId == selected.sessionId } ?? selected
SessionDetailView(session: liveSession) {
withAnimation(.easeInOut(duration: 0.2)) { selectedSession = nil }
@@ -17,7 +19,11 @@ struct SessionListView: View {
sessionList
}
}
- .frame(width: 320, height: 380)
+ .frame(width: 320)
+ .fixedSize(horizontal: true, vertical: true)
+ .background(theme.background)
+ .environment(\.theme, theme)
+ .preferredColorScheme(isDarkMode ? .dark : .light)
}
private var sessionList: some View {
@@ -25,50 +31,66 @@ struct SessionListView: View {
if stateManager.sessions.isEmpty {
emptyState
} else {
- ScrollView {
- LazyVStack(spacing: 1) {
+ ScrollView(.vertical, showsIndicators: false) {
+ VStack(spacing: 2) {
ForEach(stateManager.sessions) { session in
- Button {
+ SessionRowView(session: session) {
withAnimation(.easeInOut(duration: 0.2)) { selectedSession = session }
- } label: {
- SessionRowView(session: session)
}
- .buttonStyle(.plain)
}
}
- .padding(.vertical, 4)
- .padding(.horizontal, 4)
+ .padding(.vertical, 6)
+ .padding(.horizontal, 2)
}
+ .frame(maxHeight: 420)
}
- Spacer(minLength: 0)
+ Divider().padding(.horizontal, 8)
- // Footer
- HStack {
- Text("CodePulse")
- .font(.system(size: 10, weight: .medium))
- .foregroundStyle(.quaternary)
- Spacer()
- }
- .padding(.horizontal, 12)
- .padding(.vertical, 6)
+ footer
}
}
private var emptyState: some View {
- VStack(spacing: 12) {
- Spacer()
- Image(systemName: "waveform.path")
- .font(.system(size: 28, weight: .light))
- .foregroundStyle(.tertiary)
+ VStack(spacing: 8) {
+ Image(systemName: "terminal")
+ .font(.system(size: 24, weight: .light))
+ .foregroundStyle(theme.secondaryText)
Text("No active sessions")
.font(.system(size: 13))
- .foregroundStyle(.secondary)
- Text("Start a Claude Code session to see it here")
- .font(.system(size: 11))
- .foregroundStyle(.tertiary)
- Spacer()
+ .foregroundStyle(theme.secondaryText)
}
+ .frame(height: 120)
.frame(maxWidth: .infinity)
}
+
+ private var footer: some View {
+ HStack(alignment: .center, spacing: 8) {
+ Text("CodePulse")
+ .font(.system(size: 10, weight: .medium))
+ .foregroundStyle(theme.secondaryText.opacity(0.6))
+
+ Spacer()
+
+ Button(action: { isDarkMode.toggle() }) {
+ Image(systemName: isDarkMode ? "sun.max" : "moon")
+ .font(.system(size: 11))
+ .foregroundStyle(theme.secondaryText)
+ }
+ .buttonStyle(.plain)
+
+ Button(action: { NSApp.terminate(nil) }) {
+ Text("Quit")
+ .font(.system(size: 11))
+ .foregroundStyle(theme.secondaryText)
+ }
+ .buttonStyle(.plain)
+ .onHover { inside in
+ if inside { NSCursor.pointingHand.push() }
+ else { NSCursor.pop() }
+ }
+ }
+ .padding(.horizontal, 12)
+ .padding(.vertical, 8)
+ }
}
diff --git a/CodePulse-macOS/Views/SessionRowView.swift b/CodePulse-macOS/Views/SessionRowView.swift
index a9e517e2..ac0f35b3 100644
--- a/CodePulse-macOS/Views/SessionRowView.swift
+++ b/CodePulse-macOS/Views/SessionRowView.swift
@@ -3,67 +3,76 @@ import CodePulseShared
struct SessionRowView: View {
let session: SessionState
+ let onSelect: () -> Void
+ @Environment(\.theme) private var theme
@State private var isHovered = false
+ @State private var isPressed = false
var body: some View {
- HStack(spacing: 10) {
- StatusDotView(status: session.status)
-
- VStack(alignment: .leading, spacing: 1) {
- Text(session.summary)
- .font(.system(size: 13, weight: isHovered ? .medium : .regular))
- .foregroundStyle(.primary)
- .lineLimit(1)
-
- // Show lastEvent or status subtitle
- if let subtitle = subtitleText {
- Text(subtitle)
- .font(.system(size: 11))
- .foregroundStyle(subtitleColor)
- .lineLimit(1)
- }
+ Button(action: {
+ withAnimation(.spring(duration: 0.15)) { isPressed = true }
+ DispatchQueue.main.asyncAfter(deadline: .now() + 0.08) {
+ withAnimation(.spring(duration: 0.15)) { isPressed = false }
}
+ onSelect()
+ }) {
+ HStack(spacing: 8) {
+ SessionStatusView(
+ status: session.status,
+ completedTasks: session.completedTaskCount,
+ totalTasks: session.totalTaskCount
+ )
- Spacer(minLength: 4)
+ VStack(alignment: .leading, spacing: 2) {
+ HStack(spacing: 4) {
+ Text(session.summary)
+ .font(.system(size: 13, weight: isHovered ? .medium : .regular))
+ .foregroundStyle(theme.primaryText)
+ .lineLimit(1)
+ .truncationMode(.middle)
+ if !session.model.isEmpty {
+ SessionTagView(tag: session.model)
+ }
+ }
+ if let subtitle = session.lastEvent ?? session.currentTask {
+ Text(subtitle)
+ .font(.system(size: 11))
+ .foregroundStyle(session.status == .needsInput ? theme.warning : theme.secondaryText)
+ .lineLimit(1)
+ }
+ }
- Text(relativeTime(session.startedAt))
- .font(.system(size: 11, design: .rounded))
- .foregroundStyle(.tertiary)
- }
- .padding(.horizontal, 8)
- .padding(.vertical, 6)
- .background(
- RoundedRectangle(cornerRadius: 6, style: .continuous)
- .fill(isHovered ? Color.primary.opacity(0.06) : Color.clear)
- )
- .onHover { h in withAnimation(.easeOut(duration: 0.12)) { isHovered = h } }
- .contentShape(Rectangle())
- }
+ Spacer(minLength: 4)
- private var subtitleText: String? {
- if let lastEvent = session.lastEvent {
- return lastEvent
- }
- if let currentTask = session.currentTask {
- return currentTask
+ Text(relativeTime(session.startedAt))
+ .font(.system(size: 11, design: .rounded))
+ .foregroundStyle(theme.secondaryText)
+ }
+ .padding(.leading, 6)
+ .padding(.trailing, 10)
+ .padding(.vertical, 5)
+ .background(
+ RoundedRectangle(cornerRadius: 5, style: .continuous)
+ .fill(isPressed ? theme.primaryText.opacity(0.1)
+ : isHovered ? theme.primaryText.opacity(0.06)
+ : Color.clear)
+ )
+ .scaleEffect(isPressed ? 0.98 : 1.0)
+ .contentShape(Rectangle())
}
- return nil
- }
-
- private var subtitleColor: Color {
- switch session.status {
- case .working: return .green
- case .needsInput: return .orange
- case .error: return .red
- default: return .secondary
+ .buttonStyle(.plain)
+ .padding(.horizontal, 2)
+ .onHover { hovering in
+ withAnimation(.easeOut(duration: 0.12)) { isHovered = hovering }
}
}
private func relativeTime(_ date: Date) -> String {
let seconds = -date.timeIntervalSinceNow
if seconds < 60 { return "now" }
- if seconds < 3600 { return "\(Int(seconds / 60))m" }
- if seconds < 86400 { return "\(Int(seconds / 3600))h" }
- return "\(Int(seconds / 86400))d"
+ if seconds < 3600 { return "\(Int(seconds / 60))m ago" }
+ if seconds < 86400 { return "\(Int(seconds / 3600))h ago" }
+ if seconds < 604800 { return "\(Int(seconds / 86400))d ago" }
+ return "\(Int(seconds / 604800))w ago"
}
}
diff --git a/CodePulse-macOS/Views/SessionTagView.swift b/CodePulse-macOS/Views/SessionTagView.swift
new file mode 100644
index 00000000..e23c1f78
--- /dev/null
+++ b/CodePulse-macOS/Views/SessionTagView.swift
@@ -0,0 +1,17 @@
+import SwiftUI
+
+struct SessionTagView: View {
+ let tag: String
+
+ var body: some View {
+ Text(tag)
+ .font(.system(size: 9, weight: .medium, design: .monospaced))
+ .foregroundStyle(.secondary)
+ .padding(.horizontal, 3)
+ .padding(.vertical, 1)
+ .background(
+ RoundedRectangle(cornerRadius: 3, style: .continuous)
+ .fill(Color.primary.opacity(0.06))
+ )
+ }
+}