style: compact remote setup card and move advanced ssh fields
parent
6c2a8d6047
commit
855976df84
|
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DisclosureGroup("Advanced") {
|
||||||
|
VStack(alignment: .leading, spacing: 8) {
|
||||||
LabeledContent("Identity file") {
|
LabeledContent("Identity file") {
|
||||||
TextField("/Users/you/.ssh/id_ed25519", text: self.$state.remoteIdentity)
|
TextField("/Users/you/.ssh/id_ed25519", text: self.$state.remoteIdentity)
|
||||||
.textFieldStyle(.roundedBorder)
|
.textFieldStyle(.roundedBorder)
|
||||||
.frame(width: 280)
|
.frame(width: 260)
|
||||||
}
|
}
|
||||||
LabeledContent("Project root") {
|
LabeledContent("Project root") {
|
||||||
TextField("/home/you/Projects/clawdis", text: self.$state.remoteProjectRoot)
|
TextField("/home/you/Projects/clawdis", text: self.$state.remoteProjectRoot)
|
||||||
.textFieldStyle(.roundedBorder)
|
.textFieldStyle(.roundedBorder)
|
||||||
.frame(width: 320)
|
.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)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue