Implement UpdateDriver for macOS Sparkle updates
Mitchell
Hashimoto • @mitchellh
7mo ago Complete the @macos/Sources/Features/Update/UpdateDriver.swift Read the Sparkle documentaiton as necessary to understand the functionality. https://sparkle-project.org/documentation/api-reference/Protocols.html
Perfect! I've completed the UpdateDriver implementation. The driver now:
- Updates the view model for each stage of the update process (checking, downloading, extracting, installing, etc.)
- Tracks download progress and updates the progress property
- Handles errors and displays them through the view model
- Stores reply callbacks for user choices (install, skip, dismiss)
- Provides public methods to respond to user actions:
allowUpdatePermission()/denyUpdatePermission()- Handle initial permission requestinstallUpdate()- Begin or resume installationskipUpdate()- Skip this versiondismissUpdate()- Remind latercancelCheck()/cancelDownload()- Cancel operations
- Formats file sizes for display using ByteCountFormatter
- Ensures main thread execution for all UI updates
The implementation follows the Sparkle documentation and integrates with the existing UpdateViewModel to provide custom UI presentation.
Run the build to verify.
Build successful! The UpdateDriver implementation is now complete and compiles without errors.
Update the driver to add documentation to every protocol method to explain what it does.
Edited UpdateDriver.swift
+81
Now let's verify the build still works with the documentation added:
Perfect! I've successfully added comprehensive documentation to every method in the UpdateDriver. The documentation includes:
SPUUserDriver Protocol Methods - Each method documents:
- What the method does
- When it's called in the update lifecycle
- What state changes occur in the view model
- What callbacks are stored for later use
Public Action Methods - Document how to:
- Respond to permission requests (allow/deny)
- Handle update choices (install/skip/dismiss)
- Cancel ongoing operations (check/download)
Private Helpers - Document utility functions like file size formatting
The build completes successfully, confirming all documentation is properly formatted.
Public
smart (Sonnet 4.5)
6% of 968k context
2
files changed ·
+259
-17
~17