Move update view model to AppDelegate

Move the update view model data to AppDelegate since the update information will be app-global.

I'll help you move the update view model data to AppDelegate. Let me first locate the relevant files.

Searched codebase
Searched codebase
Explored 3 files, 1 search

Now I can see the structure. The UpdateViewModel is currently instantiated in TerminalWindow (line 20), but it should be app-global in AppDelegate. Let me check how it's being used in other places:

Explored 3 files, 2 searches

Now I understand the structure. I need to:

  1. Move updateUIModel from TerminalWindow to AppDelegate
  2. Update references to access it from AppDelegate instead
  3. Update the createUpdateActions() method to work with the app-global model

Let me make these changes:

Edited AppDelegate.swift
+3
Edited TerminalWindow.swift
+41
-31

Now I need to update the checkForUpdates method in AppDelegate to use the app-global model:

Edited AppDelegate.swift
+6
-14

Now let me verify the build to ensure everything compiles correctly:

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:

  1. AppDelegate.swift

    • Added @Published private(set) var updateUIModel = UpdateViewModel() to make it a global, observable property
  2. [TerminalWindow.swift](file:///Users/mitchellh/Documents/ghostty/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift#L19)

    • Removed the instance-level updateUIModel property
    • Updated the update accessory view initialization to use appDelegate.updateUIModel instead
    • Refactored createUpdateActions() to access the model via AppDelegate instead of self
  3. AppDelegate.swift checkForUpdates method

    • Simplified to use the app-global updateUIModel directly instead of getting it from the terminal window

The update information is now app-global and shared across all windows, which makes sense since updates affect the entire application.