Skip to content

feat: upgrade Sparkle from 1.27.1 to 2.9.0#235

Merged
2ndalpha merged 3 commits intomasterfrom
feat/upgrade-sparkle-2
Mar 1, 2026
Merged

feat: upgrade Sparkle from 1.27.1 to 2.9.0#235
2ndalpha merged 3 commits intomasterfrom
feat/upgrade-sparkle-2

Conversation

@2ndalpha
Copy link
Owner

Summary

  • Upgrade Sparkle from 1.27.1 to 2.9.0, replacing the deprecated SUUpdater singleton API with the modern SPUStandardUpdaterController/SPUUpdater architecture
  • Create the updater controller programmatically in ApplicationController.init instead of via XIB
  • Rewrite SparkleObserver to use Combine publishers (canCheckForUpdates, lastUpdateCheckDate)
  • Add SUPublicEDKey placeholder in Info.plist for EdDSA signature transition

Before release

  • Run generate_keys from Sparkle 2 to create an EdDSA keypair
  • Replace REPLACE_WITH_EDDSA_PUBLIC_KEY in Info.plist with the real public key
  • Update appcast server to serve EdDSA signatures alongside DSA

Test plan

  • Launch app — no crashes on startup
  • Preferences → Update tab — toggle, date, and button render correctly
  • Click "Check Now" — update check initiates
  • Toggle "Automatically check for updates" — preference persists across restart
  • "Check for Updates..." in app menu — update check initiates
  • "Check Now" is only disabled while a check is in progress (not when auto-check is off)

Replace the deprecated SUUpdater singleton API with Sparkle 2's
SPUStandardUpdaterController/SPUUpdater architecture:

- Create SPUStandardUpdaterController programmatically in
  ApplicationController.init instead of XIB-based SUUpdater
- Wire "Check for Updates..." menu item via IBOutlet + target/action
- Rewrite SparkleObserver to use Combine publishers for
  canCheckForUpdates and lastUpdateCheckDate
- Use SPUUpdater.automaticallyChecksForUpdates property directly
  instead of writing to UserDefaults
- Update "Check Now" button to use canCheckForUpdates (allows manual
  checks even when auto-check is disabled)
- Add SUPublicEDKey placeholder in Info.plist for EdDSA transition
  (retain SUPublicDSAKeyFile during transition period)
- Skip updater initialization in test environment to prevent timeout
2ndalpha added a commit that referenced this pull request Feb 28, 2026
Replace the XIB-bound right pane (HostsTextView + NSPredicateEditor)
with SwiftUI views while keeping the Editor.xib window shell intact.

New files:
- HostsTextViewRepresentable: NSViewRepresentable wrapping HostsTextView
  with bidirectional content sync and syntax highlighting preference
- CombinedHostsPickerView: SwiftUI toggle list replacing NSPredicateEditor
  for selecting which hosts files to combine
- ContentView: Composes picker (for CombinedHosts) + text editor
- ContentInstaller: @objc bridge installing SwiftUI into XIB split view

Changes:
- HostsTextView: Add createForProgrammaticUse factory method, extract
  setupColors from initWithCoder for reuse
- EditorController: Call ContentInstaller after SidebarInstaller
- Bridging header: Add HostsTextView.h import
- Xcode project: Add 4 new Swift source files

The old controllers (HostsTextController, CombinedHostsPredicateController,
CombinedHostsPredicateEditorRowTemplate) remain XIB-instantiated but their
views are detached from the hierarchy. Deferred to PR 3 for deletion.

This is PR 2 of 3 in the Editor.xib modernization plan.
2ndalpha and others added 2 commits February 28, 2026 19:47
…erver

Replace sink+cancellables with assign(to: &$property) for
lastUpdateCheckDate, matching the pattern already used for
canCheckForUpdates. Add reactive observation of
automaticallyChecksForUpdates so external changes (e.g. Sparkle's
first-launch dialog) propagate to the UI.
@2ndalpha 2ndalpha merged commit 1d158c1 into master Mar 1, 2026
18 checks passed
@2ndalpha 2ndalpha deleted the feat/upgrade-sparkle-2 branch March 1, 2026 05:17
2ndalpha added a commit that referenced this pull request Mar 1, 2026
* feat: replace editor right pane with SwiftUI content area (#235)

Replace the XIB-bound right pane (HostsTextView + NSPredicateEditor)
with SwiftUI views while keeping the Editor.xib window shell intact.

New files:
- HostsTextViewRepresentable: NSViewRepresentable wrapping HostsTextView
  with bidirectional content sync and syntax highlighting preference
- CombinedHostsPickerView: SwiftUI toggle list replacing NSPredicateEditor
  for selecting which hosts files to combine
- ContentView: Composes picker (for CombinedHosts) + text editor
- ContentInstaller: @objc bridge installing SwiftUI into XIB split view

Changes:
- HostsTextView: Add createForProgrammaticUse factory method, extract
  setupColors from initWithCoder for reuse
- EditorController: Call ContentInstaller after SidebarInstaller
- Bridging header: Add HostsTextView.h import
- Xcode project: Add 4 new Swift source files

The old controllers (HostsTextController, CombinedHostsPredicateController,
CombinedHostsPredicateEditorRowTemplate) remain XIB-instantiated but their
views are detached from the hierarchy. Deferred to PR 3 for deletion.

This is PR 2 of 3 in the Editor.xib modernization plan.

* fix: resolve compile errors in HostsTextViewRepresentable and CombinedHostsPickerView

- Unwrap optional return from HostsTextView.createForProgrammaticUse
  (ObjC factory methods return nullable in Swift)
- Add @ViewBuilder to pickerContent(for:) to fix opaque return type
  inference with local let bindings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant