Merge pull request 'fix(about): About Outpost opens Settings' About section, no popup window' (#10) from fix/about-menu-no-popup into main

Reviewed-on: #10
This commit was merged in pull request #10.
This commit is contained in:
2026-08-19 14:22:40 +01:00
committed by PSM Git
2 changed files with 8 additions and 36 deletions
+3 -25
View File
@@ -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
+2 -8
View File
@@ -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()