Skip to content

Commit da59123

Browse files
authored
Settings: add explanatory footers and split social keyboard, streaming and timeline fetch into sections (#2411)
1 parent 7e6d152 commit da59123

File tree

1 file changed

+41
-5
lines changed

1 file changed

+41
-5
lines changed

IceCubesApp/App/Tabs/Settings/SettingsTab.swift

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ struct SettingsTabs: View {
3838
appSection
3939
accountsSection
4040
generalSection
41+
socialKeyboardSection
42+
streamHomeTimelineSection
43+
timelineFetchSection
4144
otherSections
4245
cacheSection
4346
}
@@ -228,22 +231,55 @@ struct SettingsTabs: View {
228231
}
229232
.disabled(preferences.preferredBrowser != PreferredBrowser.inAppSafari)
230233
#endif
231-
Toggle(isOn: $preferences.isSocialKeyboardEnabled) {
232-
Label("settings.other.social-keyboard", systemImage: "keyboard")
233-
}
234234
Toggle(isOn: $preferences.soundEffectEnabled) {
235235
Label("settings.other.sound-effect", systemImage: "hifispeaker")
236236
}
237+
} header: {
238+
Text("settings.section.other")
239+
}
240+
#if !os(visionOS)
241+
.listRowBackground(theme.primaryBackgroundColor)
242+
#endif
243+
}
244+
245+
private var socialKeyboardSection: some View {
246+
@Bindable var preferences = preferences
247+
return Section {
248+
Toggle(isOn: $preferences.isSocialKeyboardEnabled) {
249+
Label("settings.other.social-keyboard", systemImage: "keyboard")
250+
}
251+
} footer: {
252+
Text("Adds @ and # keys directly on the keyboard for faster mentions and hashtags.")
253+
}
254+
#if !os(visionOS)
255+
.listRowBackground(theme.primaryBackgroundColor)
256+
#endif
257+
}
258+
259+
private var streamHomeTimelineSection: some View {
260+
@Bindable var preferences = preferences
261+
return Section {
237262
Toggle(isOn: $preferences.streamHomeTimeline) {
238263
Label("Stream home timeline", systemImage: "antenna.radiowaves.left.and.right")
239264
.symbolVariant(preferences.streamHomeTimeline ? .none : .slash)
240265
}
266+
} footer: {
267+
Text("Keeps your home timeline up to date in real time using streaming when available. Disable in case of performance issues.")
268+
}
269+
#if !os(visionOS)
270+
.listRowBackground(theme.primaryBackgroundColor)
271+
#endif
272+
}
273+
274+
private var timelineFetchSection: some View {
275+
@Bindable var preferences = preferences
276+
return Section {
241277
Toggle(isOn: $preferences.fullTimelineFetch) {
242278
Label("Full timeline fetch", systemImage: "arrow.triangle.2.circlepath")
243279
.symbolVariant(preferences.fullTimelineFetch ? .none : .slash)
244280
}
245-
} header: {
246-
Text("settings.section.other")
281+
} footer: {
282+
Text("Fetches all new timeline posts (up to 800) instead of only the latest 40 + manually loading the gap.")
247283
}
248284
#if !os(visionOS)
249285
.listRowBackground(theme.primaryBackgroundColor)

0 commit comments

Comments
 (0)