Added install instructions, and version check

This commit is contained in:
2026-02-20 09:55:30 +01:00
parent 979747c1ea
commit 4acf538d8f
4 changed files with 162 additions and 4 deletions

View File

@@ -80,6 +80,11 @@ struct FooterView: View {
)
}
// Update available badge
#if os(macOS)
UpdateBadge()
#endif
// Shortcuts hint
#if os(macOS)
Text("⌘N New • ⌘M Model • ⌘⇧S Save")
@@ -254,6 +259,32 @@ struct SyncStatusFooter: View {
}
}
struct UpdateBadge: View {
private let updater = UpdateCheckService.shared
private let currentVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "?"
var body: some View {
if updater.updateAvailable {
Button(action: { updater.openReleasesPage() }) {
HStack(spacing: 4) {
Image(systemName: "arrow.up.circle.fill")
.font(.system(size: 10))
Text("Update Available\(updater.latestVersion.map { " (v\($0))" } ?? "")")
.font(.caption2)
.fontWeight(.medium)
}
.foregroundColor(.green)
}
.buttonStyle(.plain)
.help("A new version is available — click to open the releases page")
} else {
Text("v\(currentVersion)")
.font(.caption2)
.foregroundColor(.oaiSecondary)
}
}
}
#Preview {
let stats = SessionStats(
totalInputTokens: 1250,