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