Implement overlay update notice in terminal
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:
- Find the update system code in @macos/Sources/Features/Update
- Understand how it currently works (likely as an accessory view)
- 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.
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:
Thread
Reference Thread
T-69675325-c5e3-497a-b692-0176744069e9