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: add unified GlassTheme protocol and .glassCard() modifier in CodyncShared

libokai1ccffdb4b637
diff --git a/CodyncShared/Sources/Theme/GlassTheme.swift b/CodyncShared/Sources/Theme/GlassTheme.swift
index d60229b0..15f7341d 100644
--- a/CodyncShared/Sources/Theme/GlassTheme.swift
+++ b/CodyncShared/Sources/Theme/GlassTheme.swift
@@ -35,7 +35,7 @@ public protocol GlassThemeProvider: Sendable {
// Semantic
var accent: Color { get }
- func waitingColor(for reason: WaitingReason) -> Color
+ func waitingColor(for reason: WaitingReason?) -> Color
}
// MARK: - Default glass token implementations
@@ -150,50 +150,31 @@ public struct GlassCardModifier: ViewModifier {
: Color.white.opacity(0.75)
}
- public func body(content: Content) -> some View {
- switch style {
- case .normal:
- content
- .background(resolvedBackground)
- .overlay(
- RoundedRectangle(cornerRadius: 12, style: .continuous)
- .stroke(resolvedBorderColor, lineWidth: resolvedBorderWidth)
- )
- .scaleEffect(resolvedScale)
- .opacity(resolvedOpacity)
-
- case .elevated:
- content
- .background(resolvedBackground)
- .overlay(
- // Subtle inner top highlight using a gradient mask
- GeometryReader { proxy in
- LinearGradient(
- colors: [innerHighlight, Color.clear],
- startPoint: .top,
- endPoint: .center
- )
- .frame(height: proxy.size.height)
- }
- )
- .overlay(
- RoundedRectangle(cornerRadius: 12, style: .continuous)
- .stroke(resolvedBorderColor, lineWidth: resolvedBorderWidth)
- )
- .shadow(color: shadowColor, radius: shadowRadius, x: 0, y: 4)
- .scaleEffect(resolvedScale)
- .opacity(resolvedOpacity)
+ private let cornerRadius: CGFloat = 14
- case .receded:
- content
- .background(resolvedBackground)
- .overlay(
- RoundedRectangle(cornerRadius: 12, style: .continuous)
- .stroke(resolvedBorderColor, lineWidth: resolvedBorderWidth)
- )
- .scaleEffect(resolvedScale)
- .opacity(resolvedOpacity)
- }
+ public func body(content: Content) -> some View {
+ let shape = RoundedRectangle(cornerRadius: cornerRadius, style: .continuous)
+
+ content
+ .background(resolvedBackground, in: shape)
+ .overlay {
+ if style == .elevated {
+ LinearGradient(
+ colors: [innerHighlight, Color.clear],
+ startPoint: .top,
+ endPoint: .center
+ )
+ .clipShape(shape)
+ }
+ }
+ .overlay(shape.stroke(resolvedBorderColor, lineWidth: resolvedBorderWidth))
+ .shadow(
+ color: style == .elevated ? shadowColor : .clear,
+ radius: style == .elevated ? shadowRadius : 0,
+ x: 0, y: 4
+ )
+ .scaleEffect(resolvedScale)
+ .opacity(resolvedOpacity)
}
}