Skip to content

SettingsState: reduce repetitive UserDefaults read/write boilerplate #69

@2witstudios

Description

@2witstudios

Problem

Every property in SettingsState has a didSet that writes to UserDefaults and an init() that reads from it. The pattern is identical across 7 properties but cannot use @AppStorage because @Observable is incompatible with property wrappers.

Location

apps/purepoint-macos/purepoint-macos/State/SettingsState.swift

Suggested Fix

Either:

  1. A small helper like func load<T>(_ key: String, default: T) -> T to reduce init boilerplate
  2. A @Persisted property wrapper compatible with @ObservationIgnored if more settings are added

Low priority — the current approach works and all 7 properties are in one file.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions