Simplify permissions UI in welcome screen

- Removed white bordered containers
- Simplified explanation text to be more concise
- Removed redundant labels and icons
- Made layout more compact
- Cleaner, more minimal design
This commit is contained in:
Peter Steinberger 2025-06-17 22:17:16 +02:00
parent 0e4d202d71
commit 042163d3ab

View file

@ -255,7 +255,7 @@ private struct RequestPermissionsPageView: View {
.fontWeight(.semibold) .fontWeight(.semibold)
Text( Text(
"VibeTunnel needs permissions to launch terminal sessions and send commands to certain terminals." "VibeTunnel needs AppleScript to launch and manage terminal sessions\nand accessibility to send commands to certain terminals."
) )
.font(.body) .font(.body)
.foregroundColor(.secondary) .foregroundColor(.secondary)
@ -263,77 +263,41 @@ private struct RequestPermissionsPageView: View {
.frame(maxWidth: 480) .frame(maxWidth: 480)
.fixedSize(horizontal: false, vertical: true) .fixedSize(horizontal: false, vertical: true)
// Permissions list // Permissions buttons
VStack(spacing: 20) { VStack(spacing: 16) {
// AppleScript permission // Automation permission
VStack(spacing: 12) { if appleScriptManager.hasPermission {
HStack { HStack {
Image(systemName: "applescript") Image(systemName: "checkmark.circle.fill")
.font(.title2) .foregroundColor(.green)
VStack(alignment: .leading, spacing: 4) { Text("Automation permission granted")
Text("Automation Permission") .foregroundColor(.secondary)
.font(.headline)
Text("Required to launch and control terminal applications")
.font(.caption)
.foregroundColor(.secondary)
}
Spacer()
} }
.font(.body)
if appleScriptManager.hasPermission { } else {
HStack { Button("Grant Automation Permission") {
Image(systemName: "checkmark.circle.fill") appleScriptManager.requestPermission()
.foregroundColor(.green)
Text("Automation permission granted")
.foregroundColor(.secondary)
}
.font(.body)
} else {
Button("Grant Automation Permission") {
appleScriptManager.requestPermission()
}
.buttonStyle(.borderedProminent)
.controlSize(.large)
} }
.buttonStyle(.borderedProminent)
.controlSize(.large)
} }
.padding()
.background(Color(NSColor.controlBackgroundColor))
.cornerRadius(8)
// Accessibility permission // Accessibility permission
VStack(spacing: 12) { if hasAccessibilityPermission {
HStack { HStack {
Image(systemName: "accessibility") Image(systemName: "checkmark.circle.fill")
.font(.title2) .foregroundColor(.green)
VStack(alignment: .leading, spacing: 4) { Text("Accessibility permission granted")
Text("Accessibility Permission") .foregroundColor(.secondary)
.font(.headline)
Text("Required for terminals like Ghostty that need keystroke input")
.font(.caption)
.foregroundColor(.secondary)
}
Spacer()
} }
.font(.body)
if hasAccessibilityPermission { } else {
HStack { Button("Grant Accessibility Permission") {
Image(systemName: "checkmark.circle.fill") AccessibilityPermissionManager.shared.requestPermission()
.foregroundColor(.green)
Text("Accessibility permission granted")
.foregroundColor(.secondary)
}
.font(.body)
} else {
Button("Grant Accessibility Permission") {
AccessibilityPermissionManager.shared.requestPermission()
}
.buttonStyle(.bordered)
.controlSize(.large)
} }
.buttonStyle(.bordered)
.controlSize(.large)
} }
.padding()
.background(Color(NSColor.controlBackgroundColor))
.cornerRadius(8)
} }
} }
} }