mirror of
https://github.com/hanzoai/bot.git
synced 2026-10-30 17:24:26 +00:00
Squash merge of 1,462 upstream commits with openclaw→hanzo-bot naming transforms applied. Conflicts resolved favoring our main branch to preserve existing customizations. Key upstream additions: - iOS Security Stack (concurrency locks, runtime guards, TTS fallback) - Discord CDN hostname allowlisting for SSRF protection - Discord mention handling improvements - Various bug fixes and stability improvements
41 lines
1.3 KiB
Swift
41 lines
1.3 KiB
Swift
import SwiftUI
|
|
|
|
struct SelectionStateIndicator: View {
|
|
let selected: Bool
|
|
|
|
var body: some View {
|
|
Group {
|
|
if self.selected {
|
|
Image(systemName: "checkmark.circle.fill")
|
|
.foregroundStyle(Color.accentColor)
|
|
} else {
|
|
Image(systemName: "arrow.right.circle")
|
|
.foregroundStyle(.secondary)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
extension View {
|
|
func botSelectableRowChrome(selected: Bool, hovered: Bool = false) -> some View {
|
|
self
|
|
.padding(.horizontal, 10)
|
|
.padding(.vertical, 8)
|
|
.frame(maxWidth: .infinity, alignment: .leading)
|
|
.background(
|
|
RoundedRectangle(cornerRadius: 10, style: .continuous)
|
|
.fill(self.botRowBackground(selected: selected, hovered: hovered)))
|
|
.overlay(
|
|
RoundedRectangle(cornerRadius: 10, style: .continuous)
|
|
.strokeBorder(
|
|
selected ? Color.accentColor.opacity(0.45) : Color.clear,
|
|
lineWidth: 1))
|
|
}
|
|
|
|
private func botRowBackground(selected: Bool, hovered: Bool) -> Color {
|
|
if selected { return Color.accentColor.opacity(0.12) }
|
|
if hovered { return Color.secondary.opacity(0.08) }
|
|
return Color.clear
|
|
}
|
|
}
|