style: compact remote setup card and move advanced ssh fields

main
Peter Steinberger 2025-12-07 18:37:28 +01:00
parent 6c2a8d6047
commit 855976df84
1 changed files with 22 additions and 15 deletions

View File

@ -124,7 +124,7 @@ struct OnboardingView: View {
.frame(maxWidth: 520) .frame(maxWidth: 520)
.fixedSize(horizontal: false, vertical: true) .fixedSize(horizontal: false, vertical: true)
self.onboardingCard { self.onboardingCard(spacing: 10, padding: 12) {
Picker("Mode", selection: self.$state.connectionMode) { Picker("Mode", selection: self.$state.connectionMode) {
Text("Local (this Mac)").tag(AppState.ConnectionMode.local) Text("Local (this Mac)").tag(AppState.ConnectionMode.local)
Text("Remote over SSH").tag(AppState.ConnectionMode.remote) Text("Remote over SSH").tag(AppState.ConnectionMode.remote)
@ -133,22 +133,29 @@ struct OnboardingView: View {
.frame(width: 320) .frame(width: 320)
if self.state.connectionMode == .remote { if self.state.connectionMode == .remote {
VStack(alignment: .leading, spacing: 10) { VStack(alignment: .leading, spacing: 8) {
LabeledContent("SSH target") { LabeledContent("SSH target") {
TextField("user@host[:22]", text: self.$state.remoteTarget) TextField("user@host[:22]", text: self.$state.remoteTarget)
.textFieldStyle(.roundedBorder) .textFieldStyle(.roundedBorder)
.frame(width: 280) .frame(width: 260)
} }
LabeledContent("Identity file") {
TextField("/Users/you/.ssh/id_ed25519", text: self.$state.remoteIdentity) DisclosureGroup("Advanced") {
.textFieldStyle(.roundedBorder) VStack(alignment: .leading, spacing: 8) {
.frame(width: 280) LabeledContent("Identity file") {
} TextField("/Users/you/.ssh/id_ed25519", text: self.$state.remoteIdentity)
LabeledContent("Project root") { .textFieldStyle(.roundedBorder)
TextField("/home/you/Projects/clawdis", text: self.$state.remoteProjectRoot) .frame(width: 260)
.textFieldStyle(.roundedBorder) }
.frame(width: 320) LabeledContent("Project root") {
TextField("/home/you/Projects/clawdis", text: self.$state.remoteProjectRoot)
.textFieldStyle(.roundedBorder)
.frame(width: 260)
}
}
.padding(.top, 4)
} }
Text("Tip: keep a Tailscale IP here so the agent stays reachable off-LAN.") Text("Tip: keep a Tailscale IP here so the agent stays reachable off-LAN.")
.font(.footnote) .font(.footnote)
.foregroundStyle(.secondary) .foregroundStyle(.secondary)
@ -349,11 +356,11 @@ struct OnboardingView: View {
.frame(width: self.pageWidth, alignment: .top) .frame(width: self.pageWidth, alignment: .top)
} }
private func onboardingCard(@ViewBuilder _ content: () -> some View) -> some View { private func onboardingCard(spacing: CGFloat = 12, padding: CGFloat = 16, @ViewBuilder _ content: () -> some View) -> some View {
VStack(alignment: .leading, spacing: 12) { VStack(alignment: .leading, spacing: spacing) {
content() content()
} }
.padding(16) .padding(padding)
.frame(maxWidth: .infinity, alignment: .leading) .frame(maxWidth: .infinity, alignment: .leading)
.background( .background(
RoundedRectangle(cornerRadius: 16, style: .continuous) RoundedRectangle(cornerRadius: 16, style: .continuous)