Implement overlay update notice in terminal
Perfect! I've successfully augmented the update system to support an overlay approach. Here's what I implemented:
Summary
Created UpdateOverlay.swift - A new component that displays the update notice at the bottom of the window as an overlay
Updated TerminalView.swift to:
- Accept optional
updateModelandupdateActionsparameters - Render the
UpdateOverlayin the ZStack, appearing at the bottom over the terminal text
- Accept optional
Modified TerminalController.swift to pass the update model and actions from the AppDelegate
Exposed a public method in [TerminalWindow.swift](file:///Users/mitchellh/Documents/ghostty/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift) to create update actions
Key Features
- Overlay positioning: Appears at bottom-right with padding
- Non-intrusive: Doesn't resize the terminal view (uses ZStack overlay)
- Same behavior: All clicking behaviors preserved from UpdatePill (shows same popover with all actions)
- Consistent styling: Uses same UpdateBadge, UpdatePopoverView, and styling as the titlebar accessory
- Shadow effect: Added subtle shadow to make overlay stand out over terminal text
The build completed successfully!
Perfect! I've successfully refactored the update system. Here's what changed:
Summary of Changes
-
- Added
updateActionsas a lazy global property - Moved
createUpdateActions()implementation to AppDelegate (centralized)
- Added
-
- Removed optional
updateModelandupdateActionsparameters - Now directly accesses
AppDelegateviaNSApp.delegateto get global update state
- Removed optional
-
- Removed parameter passing since TerminalView gets values directly from AppDelegate
[TerminalWindow.swift](file:///Users/mitchellh/Documents/ghostty/macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift):
- Removed all
createUpdateActions()methods - Now uses
appDelegate.updateActionsdirectly
- Removed all
Benefits
- Single source of truth: Update actions are defined once in AppDelegate
- Simpler: No need to pass parameters through multiple layers
- Global access: Both titlebar accessory and overlay access the same global state
- Cleaner: Removed 100+ lines of duplicate code from TerminalWindow
Build completed successfully!