Move the update view model data to AppDelegate since the update information will be app-global.
Move update view model to AppDelegate
Unlisted
Perfect! The build succeeded. Let me create a summary of the changes:
Summary
I've successfully moved the update view model data from TerminalWindow to AppDelegate to make it app-global. Here's what was changed:
Changes Made:
-
- Added
@Published private(set) var updateUIModel = UpdateViewModel()to make it a global, observable property
- Added
[TerminalWindow.swift](file:///Users/mitchellh/Documents/ghostty/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift#L19)
- Removed the instance-level
updateUIModelproperty - Updated the update accessory view initialization to use
appDelegate.updateUIModelinstead - Refactored
createUpdateActions()to access the model viaAppDelegateinstead ofself
- Removed the instance-level
AppDelegate.swift
checkForUpdatesmethod- Simplified to use the app-global
updateUIModeldirectly instead of getting it from the terminal window
- Simplified to use the app-global
The update information is now app-global and shared across all windows, which makes sense since updates affect the entire application.