fix(mac): tighten onboarding layout
This commit is contained in:
@@ -243,9 +243,7 @@ struct OnboardingView: View {
|
||||
VStack(spacing: 22) {
|
||||
Text("Welcome to Clawdis")
|
||||
.font(.largeTitle.weight(.semibold))
|
||||
Text(
|
||||
"Your macOS menu bar companion for notifications, screenshots, and agent automation. " +
|
||||
"Setup takes a few minutes.")
|
||||
Text("Clawdis is a powerful personal AI assistant that can connect to WhatsApp or Telegram.")
|
||||
.font(.body)
|
||||
.foregroundStyle(.secondary)
|
||||
.multilineTextAlignment(.center)
|
||||
@@ -735,9 +733,13 @@ struct OnboardingView: View {
|
||||
.frame(maxWidth: 520)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
|
||||
self.onboardingCard {
|
||||
self.onboardingCard(spacing: 8, padding: 12) {
|
||||
ForEach(Capability.allCases, id: \.self) { cap in
|
||||
PermissionRow(capability: cap, status: self.permissionMonitor.status[cap] ?? false) {
|
||||
PermissionRow(
|
||||
capability: cap,
|
||||
status: self.permissionMonitor.status[cap] ?? false,
|
||||
compact: true)
|
||||
{
|
||||
Task { await self.request(cap) }
|
||||
}
|
||||
}
|
||||
@@ -1050,7 +1052,7 @@ struct OnboardingView: View {
|
||||
}
|
||||
|
||||
private func onboardingPage(@ViewBuilder _ content: () -> some View) -> some View {
|
||||
VStack(spacing: 22) {
|
||||
VStack(spacing: 16) {
|
||||
content()
|
||||
Spacer()
|
||||
}
|
||||
|
||||
@@ -58,13 +58,21 @@ struct PermissionStatusList: View {
|
||||
struct PermissionRow: View {
|
||||
let capability: Capability
|
||||
let status: Bool
|
||||
let compact: Bool
|
||||
let action: () -> Void
|
||||
|
||||
init(capability: Capability, status: Bool, compact: Bool = false, action: @escaping () -> Void) {
|
||||
self.capability = capability
|
||||
self.status = status
|
||||
self.compact = compact
|
||||
self.action = action
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
HStack(spacing: 12) {
|
||||
HStack(spacing: self.compact ? 10 : 12) {
|
||||
ZStack {
|
||||
Circle().fill(self.status ? Color.green.opacity(0.2) : Color.gray.opacity(0.15))
|
||||
.frame(width: 32, height: 32)
|
||||
.frame(width: self.iconSize, height: self.iconSize)
|
||||
Image(systemName: self.icon)
|
||||
.foregroundStyle(self.status ? Color.green : Color.secondary)
|
||||
}
|
||||
@@ -81,9 +89,11 @@ struct PermissionRow: View {
|
||||
.buttonStyle(.bordered)
|
||||
}
|
||||
}
|
||||
.padding(.vertical, 6)
|
||||
.padding(.vertical, self.compact ? 4 : 6)
|
||||
}
|
||||
|
||||
private var iconSize: CGFloat { self.compact ? 28 : 32 }
|
||||
|
||||
private var title: String {
|
||||
switch self.capability {
|
||||
case .appleScript: "Automation (AppleScript)"
|
||||
|
||||
Reference in New Issue
Block a user