import SwiftUI // 🤖 The in-place offer for an app whose code changed while its surface was // on screen (FeedWebCache.handleAppsChanged): a page can't swap app code in // place, and reloading it out from under someone is worse than asking — so // the pane grows this bar inline, occupying layout space above the webview // (never a floating overlay), with the web sidebar banner's copy and // choices. Reload picks the new version up now; Later hides the bar, and the // page still reloads on its next return from parked. struct AppUpdateBar: View { @ObservedObject var bridge: WebBridge var body: some View { if let kind = bridge.appUpdateKind, !bridge.appUpdateDismissed { HStack(spacing: 16) { Text(kind == "updated" ? "App updated." : "Apps changed.") .font(.subheadline) Spacer(minLength: 0) Button("Reload") { bridge.reloadForAppUpdate() } .font(.subheadline.weight(.semibold)) Button("Later") { bridge.appUpdateDismissed = true } .font(.subheadline) } .padding(.horizontal, 14) .padding(.vertical, 10) .background(.bar) .overlay(Divider(), alignment: .bottom) } } }