Fix permission UI layout jumping and center footer text

- Added fixed height and padding to "Granted" labels to match button sizes
- Prevents layout jumping when transitioning between button and granted state
- Small buttons use height 22px, large buttons use height 38px
- Centered the footer text in DashboardSettingsView permissions section
- Consistent visual appearance across all permission UI elements
This commit is contained in:
Peter Steinberger 2025-06-17 23:03:00 +02:00
parent 322658d9a9
commit 30e8b86f27
2 changed files with 14 additions and 0 deletions

View file

@ -854,6 +854,9 @@ private struct PermissionsSection: View {
.foregroundColor(.secondary) .foregroundColor(.secondary)
} }
.font(.caption) .font(.caption)
.padding(.horizontal, 10)
.padding(.vertical, 2)
.frame(height: 22) // Match small button height
} else { } else {
Button("Grant Permission") { Button("Grant Permission") {
appleScriptManager.requestPermission() appleScriptManager.requestPermission()
@ -885,6 +888,9 @@ private struct PermissionsSection: View {
.foregroundColor(.secondary) .foregroundColor(.secondary)
} }
.font(.caption) .font(.caption)
.padding(.horizontal, 10)
.padding(.vertical, 2)
.frame(height: 22) // Match small button height
} else { } else {
Button("Grant Permission") { Button("Grant Permission") {
AccessibilityPermissionManager.shared.requestPermission() AccessibilityPermissionManager.shared.requestPermission()
@ -900,6 +906,8 @@ private struct PermissionsSection: View {
} footer: { } footer: {
Text("Terminal automation is required for all terminals. Accessibility is only needed for terminals that simulate keyboard input.") Text("Terminal automation is required for all terminals. Accessibility is only needed for terminals that simulate keyboard input.")
.font(.caption) .font(.caption)
.frame(maxWidth: .infinity)
.multilineTextAlignment(.center)
} }
.task { .task {
_ = await appleScriptManager.checkPermission() _ = await appleScriptManager.checkPermission()

View file

@ -280,6 +280,9 @@ private struct RequestPermissionsPageView: View {
.foregroundColor(.secondary) .foregroundColor(.secondary)
} }
.font(.body) .font(.body)
.padding(.horizontal, 16)
.padding(.vertical, 8)
.frame(height: 38) // Match large button height
} else { } else {
Button("Grant Automation Permission") { Button("Grant Automation Permission") {
appleScriptManager.requestPermission() appleScriptManager.requestPermission()
@ -297,6 +300,9 @@ private struct RequestPermissionsPageView: View {
.foregroundColor(.secondary) .foregroundColor(.secondary)
} }
.font(.body) .font(.body)
.padding(.horizontal, 16)
.padding(.vertical, 8)
.frame(height: 38) // Match large button height
} else { } else {
Button("Grant Accessibility Permission") { Button("Grant Accessibility Permission") {
AccessibilityPermissionManager.shared.requestPermission() AccessibilityPermissionManager.shared.requestPermission()