fix(about): About Outpost opens Settings' About section, no popup window
"About Outpost" in the app menu used to open a separate standalone window (Window(id: "about") wrapping AboutView). Now just opens Settings and jumps straight to the About section instead — same content (AboutInfoView, unchanged), one less window/code path to maintain. Also removed the "Check for Updates…" button — deferred per explicit instruction, not deleted for a real reason beyond "not now." A simple button can come back later; no update-checking logic was ever built; , nothing else to clean up alongside it.
This commit is contained in:
@@ -2,13 +2,11 @@
|
|||||||
import AppKit
|
import AppKit
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
/// Bare content (icon, name, version, links) with no window chrome — reused
|
/// Bare content (icon, name, version, links) with no window chrome — the
|
||||||
/// by both the standalone "About Outpost" window (`AboutView`, the standard
|
/// macOS "About Outpost" app-menu command now opens Settings' own About
|
||||||
/// macOS app-menu affordance) and the Settings page's own About section, so
|
/// section directly (no separate popup window), so this is its only caller.
|
||||||
/// the two can't drift out of sync.
|
|
||||||
struct AboutInfoView: View {
|
struct AboutInfoView: View {
|
||||||
private let repositoryURL = URL(string: "https://git.psmattas.com/psmattas/Outpost")!
|
private let repositoryURL = URL(string: "https://git.psmattas.com/psmattas/Outpost")!
|
||||||
private let releasesURL = URL(string: "https://git.psmattas.com/psmattas/Outpost/releases")!
|
|
||||||
|
|
||||||
var appName: String {
|
var appName: String {
|
||||||
Bundle.main.object(forInfoDictionaryKey: "CFBundleName") as? String ?? "Outpost"
|
Bundle.main.object(forInfoDictionaryKey: "CFBundleName") as? String ?? "Outpost"
|
||||||
@@ -45,35 +43,15 @@ struct AboutInfoView: View {
|
|||||||
.fixedSize(horizontal: false, vertical: true)
|
.fixedSize(horizontal: false, vertical: true)
|
||||||
.frame(maxWidth: .infinity)
|
.frame(maxWidth: .infinity)
|
||||||
|
|
||||||
VStack(spacing: 10) {
|
|
||||||
Link(destination: repositoryURL) {
|
Link(destination: repositoryURL) {
|
||||||
Label("View Source on Git", systemImage: "link")
|
Label("View Source on Git", systemImage: "link")
|
||||||
}
|
}
|
||||||
.font(.callout)
|
.font(.callout)
|
||||||
|
|
||||||
Button("Check for Updates…") {
|
|
||||||
checkForUpdates()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Text("© \(copyrightYear) Puranjay Savar Mattas")
|
Text("© \(copyrightYear) Puranjay Savar Mattas")
|
||||||
.font(.caption2)
|
.font(.caption2)
|
||||||
.foregroundStyle(.tertiary)
|
.foregroundStyle(.tertiary)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// No Sparkle-style in-app updater yet — this just opens the releases page
|
|
||||||
// on the self-hosted Gitea instance so the user can check/download manually.
|
|
||||||
private func checkForUpdates() {
|
|
||||||
NSWorkspace.shared.open(releasesURL)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
struct AboutView: View {
|
|
||||||
var body: some View {
|
|
||||||
AboutInfoView()
|
|
||||||
.padding(32)
|
|
||||||
.frame(width: 320)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ struct OutpostApp: App {
|
|||||||
@AppStorage("outpost.appearance") private var appearance: AppAppearance = .system
|
@AppStorage("outpost.appearance") private var appearance: AppAppearance = .system
|
||||||
|
|
||||||
#if os(macOS)
|
#if os(macOS)
|
||||||
@Environment(\.openWindow) private var openWindow
|
|
||||||
@State private var isShowingLogoutConfirmation = false
|
@State private var isShowingLogoutConfirmation = false
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -40,7 +39,8 @@ struct OutpostApp: App {
|
|||||||
.commands {
|
.commands {
|
||||||
CommandGroup(replacing: .appInfo) {
|
CommandGroup(replacing: .appInfo) {
|
||||||
Button("About Outpost") {
|
Button("About Outpost") {
|
||||||
openWindow(id: "about")
|
navigation.selectedSettingsSection = .about
|
||||||
|
navigation.isShowingSettings = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// No `Settings {}` scene anymore — Settings renders inside the
|
// No `Settings {}` scene anymore — Settings renders inside the
|
||||||
@@ -64,12 +64,6 @@ struct OutpostApp: App {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if os(macOS)
|
#if os(macOS)
|
||||||
Window("About Outpost", id: "about") {
|
|
||||||
AboutView()
|
|
||||||
.disablesFullScreen()
|
|
||||||
}
|
|
||||||
.windowResizability(.contentSize)
|
|
||||||
|
|
||||||
Window("Keyboard Shortcuts", id: "keyboard-shortcuts") {
|
Window("Keyboard Shortcuts", id: "keyboard-shortcuts") {
|
||||||
KeyboardShortcutsView()
|
KeyboardShortcutsView()
|
||||||
.disablesFullScreen()
|
.disablesFullScreen()
|
||||||
|
|||||||
Reference in New Issue
Block a user