mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-23 16:18:09 +00:00
* feat(ios): expand iPad layout support Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat: improve iPad and iPhone control surfaces * fix: preserve workboard dispatch compatibility * fix: keep Talk reachable on iPad * fix: add universal iPad app icons * fix: address ready-review iOS feedback * fix: avoid workboard board id shadowing * fix ios sidebar separators --------- Co-authored-by: Solvely-Colin <211764741+Solvely-Colin@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: joshavant <830519+joshavant@users.noreply.github.com>
72 lines
2.3 KiB
Swift
72 lines
2.3 KiB
Swift
import SwiftUI
|
|
|
|
struct IPadSidebarScreenChrome<Content: View>: View {
|
|
@Environment(\.verticalSizeClass) private var verticalSizeClass
|
|
let title: String
|
|
let subtitle: String
|
|
let headerLeadingAction: OpenClawSidebarHeaderAction?
|
|
let gatewayAction: (() -> Void)?
|
|
@ViewBuilder var content: Content
|
|
|
|
init(
|
|
title: String,
|
|
subtitle: String,
|
|
headerLeadingAction: OpenClawSidebarHeaderAction? = nil,
|
|
gatewayAction: (() -> Void)? = nil,
|
|
@ViewBuilder content: () -> Content)
|
|
{
|
|
self.title = title
|
|
self.subtitle = subtitle
|
|
self.headerLeadingAction = headerLeadingAction
|
|
self.gatewayAction = gatewayAction
|
|
self.content = content()
|
|
}
|
|
|
|
var body: some View {
|
|
ZStack {
|
|
OpenClawProBackground()
|
|
ScrollView {
|
|
VStack(alignment: .leading, spacing: self.isCompactHeight ? 10 : 16) {
|
|
OpenClawAdaptiveHeaderRow(
|
|
title: self.title,
|
|
subtitle: self.subtitle,
|
|
titleFont: self.isCompactHeight ? .headline.weight(.semibold) : .title2.weight(.semibold),
|
|
subtitleLineLimit: self.isCompactHeight ? 1 : 2)
|
|
{
|
|
if let headerLeadingAction {
|
|
OpenClawSidebarHeaderLeadingSlot(action: headerLeadingAction)
|
|
}
|
|
} accessory: {
|
|
self.gatewayPill
|
|
}
|
|
.padding(.horizontal, OpenClawProMetric.pagePadding)
|
|
self.content
|
|
}
|
|
.padding(.vertical, self.isCompactHeight ? 10 : 18)
|
|
}
|
|
.safeAreaPadding(.bottom, self.bottomScrollInset)
|
|
}
|
|
}
|
|
|
|
private var isCompactHeight: Bool {
|
|
self.verticalSizeClass == .compact
|
|
}
|
|
|
|
@ViewBuilder
|
|
private var gatewayPill: some View {
|
|
if let gatewayAction {
|
|
Button(action: gatewayAction) {
|
|
OpenClawGatewayCompactPill()
|
|
}
|
|
.buttonStyle(.plain)
|
|
.accessibilityHint("Opens Settings / Gateway")
|
|
} else {
|
|
OpenClawGatewayCompactPill()
|
|
}
|
|
}
|
|
|
|
private var bottomScrollInset: CGFloat {
|
|
self.isCompactHeight ? 150 : OpenClawProMetric.bottomScrollInset
|
|
}
|
|
}
|