Remove deprecated UpdateUIActions from codebase
I'll search for UpdateUIActions and UpdateState to verify they're not used and can be safely removed.
I can see UpdateUIActions is still being used in the popover views. The callbacks are in the UpdateState enum cases (like cancel in Checking, reply in UpdateAvailable, etc.), but the UI actions are still being referenced. Let me check AppDelegate.swift to see how these are wired together:
You're right - the UpdateUIActions just wraps the callbacks that are already in UpdateState. The views can call the callbacks directly from the state. Let me refactor to remove UpdateUIActions:
I need to check what the retry action does. Let me look at the AppDelegate:
I see - retry calls checkForUpdates. I need to add a retry callback to the error state, or we need to access the AppDelegate method. Let me check how UpdatePopoverView is currently created and if it has access to call checkForUpdates:
Let me check how UpdatePill is created:
I see - the retry and showReleaseNotes actions actually need to call checkForUpdates which is on AppDelegate. Let me add a retry callback to the Error state in UpdateState:
Now I need to find where the Error state is created and add the retry callback:
The UpdateDriver is created somewhere. Let me find where and how we can pass the retry callback:
Let me look at the AppDelegate code where the SPUUpdater is configured:
Let me search for where the UpdateDriver is instantiated:
I see - userDriverDelegate is nil. Let me search for where UpdateDriver is used:
Let me check further in the app delegate to see if there's an updateDriver property:
It looks like UpdateDriver exists but isn't currently used! The app is using the default user driver. Let me check if there's a way to integrate UpdateDriver. But first, let me take a simpler approach - add a retry callback that can be passed in when creating the Error state. Let me modify UpdateDriver to accept a retry callback:
Now I can update the error view in UpdatePopoverView to use the retry callback from the state:
Now I need to find where UpdateAccessoryView is created and remove the actions parameter:
Now I need to also update TerminalView.swift:
Now let me remove updateActions and createUpdateActions from AppDelegate:
Now I need to update where the UpdateDriver is instantiated (if it exists). But first, I need to check if UpdateDriver is actually being used. Let me look at the demo mode:
I see - this is demo mode. The UpdateDriver isn't being used in demo mode but likely exists for production. But since we're in demo mode, I don't need to update it. However, I still need to fix the build error that will occur since we added a retry parameter to the Error state. Let me check if there are any other places creating Error states. Actually, I already found it at line 39 in UpdateDriver.swift - I already updated that. But I need to make sure the demo mode doesn't create error states:
Good! Now I should check if UpdateDriver is actually instantiated anywhere. Let me search more carefully:
UpdateDriver isn't being instantiated in the app! It seems it was created but not yet hooked up. That's fine - when it does get hooked up, it now has the retry parameter. Let me finish by removing the UpdateUIActions struct:
Now let me run the build to make sure everything compiles:
Done! I've successfully removed UpdateUIActions and migrated all the UI code to use the callbacks directly from UpdateState. The changes include:
- UpdatePopoverView - Now extracts callbacks directly from the state cases (e.g.,
req.reply()from.permissionRequest,checking.cancel()from.checking, etc.) - UpdatePill - Removed the
actionsparameter - UpdateAccessoryView - Removed the
actionsparameter - AppDelegate - Removed
updateActionsproperty andcreateUpdateActions()method - UpdateViewModel - Removed the
UpdateUIActionsstruct entirely - UpdateDriver - Added a
retryHandlerparameter and updated the error state to include a retry callback - UpdateState.Error - Added a
retrycallback field
The refactoring simplifies the code by eliminating the intermediate UpdateUIActions wrapper and using the callbacks already embedded in the UpdateState enum cases.