Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>
This commit is contained in:
parent
845abfd24d
commit
e64bbf57e1
@ -10,7 +10,6 @@ struct AppSettingsData: PersistableData {
|
|||||||
var reminderMinute: Int = 0
|
var reminderMinute: Int = 0
|
||||||
var hapticsEnabled: Bool = true
|
var hapticsEnabled: Bool = true
|
||||||
var soundEnabled: Bool = true
|
var soundEnabled: Bool = true
|
||||||
var focusStyle: FocusStyle = .gentle
|
|
||||||
var ritualLengthDays: Int = 28
|
var ritualLengthDays: Int = 28
|
||||||
var lastModified: Date = .now
|
var lastModified: Date = .now
|
||||||
|
|
||||||
@ -24,33 +23,3 @@ struct AppSettingsData: PersistableData {
|
|||||||
return components
|
return components
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Defines the intensity of ritual pacing.
|
|
||||||
///
|
|
||||||
/// - `gentle`: Relaxed approach with softer reminders. Good for building habits slowly.
|
|
||||||
/// - `steady`: Balanced default for most users. Consistent daily check-ins.
|
|
||||||
/// - `intense`: More focused approach with more frequent engagement. For users who want accountability.
|
|
||||||
enum FocusStyle: String, CaseIterable, Codable, Identifiable {
|
|
||||||
case gentle
|
|
||||||
case steady
|
|
||||||
case intense
|
|
||||||
|
|
||||||
var id: String { rawValue }
|
|
||||||
|
|
||||||
var title: String {
|
|
||||||
switch self {
|
|
||||||
case .gentle: return String(localized: "Gentle")
|
|
||||||
case .steady: return String(localized: "Steady")
|
|
||||||
case .intense: return String(localized: "Intense")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Description of what this focus style means for the user.
|
|
||||||
var description: String {
|
|
||||||
switch self {
|
|
||||||
case .gentle: return String(localized: "A relaxed pace for building habits slowly")
|
|
||||||
case .steady: return String(localized: "Balanced daily check-ins")
|
|
||||||
case .intense: return String(localized: "Focused approach with more accountability")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@ -64,11 +64,6 @@ final class SettingsStore: CloudSyncable {
|
|||||||
set { update { $0.soundEnabled = newValue } }
|
set { update { $0.soundEnabled = newValue } }
|
||||||
}
|
}
|
||||||
|
|
||||||
var focusStyle: FocusStyle {
|
|
||||||
get { cloudSync.data.focusStyle }
|
|
||||||
set { update { $0.focusStyle = newValue } }
|
|
||||||
}
|
|
||||||
|
|
||||||
var ritualLengthDays: Double {
|
var ritualLengthDays: Double {
|
||||||
get { Double(cloudSync.data.ritualLengthDays) }
|
get { Double(cloudSync.data.ritualLengthDays) }
|
||||||
set { update { $0.ritualLengthDays = Int(newValue) } }
|
set { update { $0.ritualLengthDays = Int(newValue) } }
|
||||||
|
|||||||
@ -6,8 +6,6 @@ struct SettingsView: View {
|
|||||||
@Bindable var store: SettingsStore
|
@Bindable var store: SettingsStore
|
||||||
var ritualStore: RitualStore?
|
var ritualStore: RitualStore?
|
||||||
|
|
||||||
private let focusOptions: [(String, FocusStyle)] = FocusStyle.allCases.map { ($0.title, $0) }
|
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
ScrollView(.vertical, showsIndicators: false) {
|
ScrollView(.vertical, showsIndicators: false) {
|
||||||
VStack(alignment: .leading, spacing: Design.Spacing.large) {
|
VStack(alignment: .leading, spacing: Design.Spacing.large) {
|
||||||
@ -79,14 +77,6 @@ struct SettingsView: View {
|
|||||||
)
|
)
|
||||||
|
|
||||||
SettingsCard(backgroundColor: AppSurface.card, borderColor: AppBorder.subtle) {
|
SettingsCard(backgroundColor: AppSurface.card, borderColor: AppBorder.subtle) {
|
||||||
SettingsSegmentedPicker(
|
|
||||||
title: String(localized: "Focus style"),
|
|
||||||
subtitle: String(localized: "Choose the intensity of your arc"),
|
|
||||||
options: focusOptions,
|
|
||||||
selection: $store.focusStyle,
|
|
||||||
accentColor: AppAccent.primary
|
|
||||||
)
|
|
||||||
|
|
||||||
SettingsSlider(
|
SettingsSlider(
|
||||||
title: String(localized: "Ritual length"),
|
title: String(localized: "Ritual length"),
|
||||||
subtitle: String(localized: "Adjust arc duration"),
|
subtitle: String(localized: "Adjust arc duration"),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user