fix(apple): polish the merged Network settings

Move the relay-mode picker's Network title into a Section header (the inline
picker label rendered as a stray row on iOS) and hide the picker label. Use a
verbatim prompt for the relay URL placeholder so macOS stops markdown-linkifying
the URL-shaped text into a purple link.
This commit is contained in:
2026-07-24 17:54:59 +02:00
parent c23f7916bb
commit 9b15a388d8

View File

@@ -80,7 +80,7 @@ struct NetworkSettings: View {
var body: some View { var body: some View {
Section { Section {
Picker( Picker(
String(localized: "settings_network_title"), "",
selection: Binding(get: { model.state.relayMode }, set: { model.setRelayMode($0) }) selection: Binding(get: { model.state.relayMode }, set: { model.setRelayMode($0) })
) { ) {
ForEach(RelayPreferenceMode.allCases, id: \.self) { mode in ForEach(RelayPreferenceMode.allCases, id: \.self) { mode in
@@ -88,7 +88,10 @@ struct NetworkSettings: View {
} }
} }
.pickerStyle(.inline) .pickerStyle(.inline)
.labelsHidden()
.disabled(model.state.isApplyingRelayConfiguration) .disabled(model.state.isApplyingRelayConfiguration)
} header: {
Text(String(localized: L10n.Settings.networkTitle))
} footer: { } footer: {
Text(LocalizedStringKey(relayModeDescriptionKey(model.state.relayMode))) Text(LocalizedStringKey(relayModeDescriptionKey(model.state.relayMode)))
} }
@@ -127,7 +130,7 @@ struct NetworkSettings: View {
VStack(alignment: .leading, spacing: 6) { VStack(alignment: .leading, spacing: 6) {
HStack { HStack {
TextField( TextField(
"https://relay.example.com", "",
text: Binding( text: Binding(
get: { get: {
model.state.relayURLs.indices.contains(index) model.state.relayURLs.indices.contains(index)
@@ -135,8 +138,12 @@ struct NetworkSettings: View {
: "" : ""
}, },
set: { model.setRelayURL($0, at: index) } set: { model.setRelayURL($0, at: index) }
),
// `Text(verbatim:)` avoids macOS markdown-linkifying the
// URL-shaped placeholder into a purple link.
prompt: Text(verbatim: "https://relay.example.com")
) )
) .labelsHidden()
#if os(iOS) #if os(iOS)
.keyboardType(.URL) .keyboardType(.URL)
.textInputAutocapitalization(.never) .textInputAutocapitalization(.never)