Sign In Sign Up

Implement overlay update notice in terminal

Augment the @macos/Sources/Features/Update system to also support an overlay approach in @macos/Sources/Features/Terminal/TerminalView.swift The update notice should appear at the bottom of the window. It should go over the text (so it doesn't resize the terminal view). All clicking behaviors should otherwise be the same as the accessory view.

The user wants me to augment the update system to support an overlay approach in TerminalView.swift. The update notice should appear at the bottom of the window and overlay the terminal text without resizing it. I should preserve all clicking behaviors from the accessory view.

Let me first explore the existing update system to understand how it currently works.

I'll need to:

  1. Find the update system code in @macos/Sources/Features/Update
  2. Understand how it currently works (likely as an accessory view)
  3. Add an overlay approach to TerminalView.swift that appears at the bottom

Let me start by exploring the Update directory structure and existing implementation.

I'll help you add an overlay update notice to TerminalView. Let me first explore the existing Update system to understand its current implementation.

macos/Sources/Features/Update/**/*.swift 5 files found
UpdatePill 2 matches

Now I'll create an overlay view for the update notice and integrate it into TerminalView. Let me create a new file for the overlay component:

@@ -1,0 +1,55 @@
import SwiftUI

/// An overlay view that displays update status at the bottom of the terminal window.
/// Unlike the pill accessory view, this appears as an overlay that doesn't resize the terminal.
struct UpdateOverlay: View {
    @ObservedObject var model: UpdateViewModel
    let actions: UpdateUIActions
    
    @State private var showPopover = false
    
    var body: some View {
        if model.state != .idle {
            VStack {
                Spacer()
                
                HStack {
                    Spacer()
                    
                    overlayButton
                        .padding(.bottom, 12)
                        .padding(.trailing, 12)
                }
            }
            .popover(isPresented: $showPopover, arrowEdge: .bottom) {
                UpdatePopoverView(model: model, actions: actions)
            }
            .transition(.opacity.combined(with: .move(edge: .bottom)))
        }
    }
    
    @ViewBuilder
    private var overlayButton: some View {
        Button(action: { showPopover.toggle() }) {
            HStack(spacing: 6) {
                UpdateBadge(model: model)
                    .frame(width: 14, height: 14)
                
                Text(model.text)
                    .font(.system(size: 11, weight: .medium))
                    .lineLimit(1)
            }
            .padding(.horizontal, 10)
            .padding(.vertical, 6)
            .background(
                Capsule()
                    .fill(model.backgroundColor)
                    .shadow(color: Color.black.opacity(0.3), radius: 4, x: 0, y: 2)
            )
            .foregroundColor(model.foregroundColor)
            .contentShape(Capsule())
        }
        .buttonStyle(.plain)
        .help(model.stateTooltip)
    }
}

Now I need to integrate this into TerminalView. First, let me check how the view model is structured to see if we need to pass the update model and actions:

TerminalViewModel 3 matches