Skip to content

feat(ui): update channel preference (Stable/Beta) missing from General Settings #213

@bocan

Description

@bocan

Update channel preference (Stable/Beta) missing from General Settings

Problem

There is no user-facing toggle or picker to choose between the stable and beta Sparkle update channels. Phase 16 spec §12 requires a Stable/Beta channel preference. Currently there is no updates.betaChannel UserDefaults key, no UI to set it, and UpdateController.feedURLString(for:) (once Sparkle is added — see #205) won't know which channel to return.

Required changes

1. Register default

In BocanApp.registerDefaults():

"updates.betaChannel": false,

2. Add to General Settings

In Modules/UI/Sources/UI/Settings/GeneralSettingsView.swift, add a new section:

Section("Software Updates") {
    Toggle(isOn: Binding(
        get: { UserDefaults.standard.bool(forKey: "updates.betaChannel") },
        set: { UserDefaults.standard.set($0, forKey: "updates.betaChannel") }
    )) {
        VStack(alignment: .leading, spacing: 2) {
            Text("Receive beta updates")
            Text("Opt in to early-access releases. Betas may have bugs.")
                .font(.caption)
                .foregroundStyle(.secondary)
        }
    }
    .help("When enabled, Bòcan will offer beta (pre-release) versions in addition to stable releases.")
}

3. Wire in UpdateController

UpdateController.feedURLString(for:) (see #205) already reads UserDefaults.standard.bool(forKey: "updates.betaChannel"). No additional wiring needed once Sparkle is integrated.

4. Localization

Add the new strings to Modules/UI/Sources/UI/Resources/Localizable.xcstrings:

  • "Software Updates" (settings section header)
  • "Receive beta updates" (toggle label)
  • "Opt in to early-access releases. Betas may have bugs." (caption)

Acceptance criteria

  • General Settings has a "Software Updates" section with "Receive beta updates" toggle
  • Default is off (false)
  • Toggling on causes UpdateController to return https://bocan.app/appcast-beta.xml as the feed URL
  • Toggling off returns to https://bocan.app/appcast.xml
  • Toggle has a .help() modifier
  • All strings added to Localizable.xcstrings

Dependencies

Blocked by #205 (Sparkle not yet integrated).

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