Added install instructions, and version check
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user