diff --git a/Xcodes/Frontend/About/AboutView.swift b/Xcodes/Frontend/About/AboutView.swift index d463f42..a34a817 100644 --- a/Xcodes/Frontend/About/AboutView.swift +++ b/Xcodes/Frontend/About/AboutView.swift @@ -2,6 +2,7 @@ import SwiftUI struct AboutView: View { let showAcknowledgementsWindow: () -> Void + @SwiftUI.Environment(\.openURL) var openURL: OpenURLAction var body: some View { HStack { @@ -18,7 +19,7 @@ struct AboutView: View { HStack(spacing: 32) { Button(action: { - NSWorkspace.shared.open(URL(string: "https://github.com/RobotsAndPencils/XcodesApp/")!) + openURL(URL(string: "https://github.com/RobotsAndPencils/XcodesApp/")!) }) { Label("GitHub Repo", systemImage: "link") } diff --git a/Xcodes/XcodesApp.swift b/Xcodes/XcodesApp.swift index 85b0569..4a8ab64 100644 --- a/Xcodes/XcodesApp.swift +++ b/Xcodes/XcodesApp.swift @@ -7,6 +7,7 @@ import SwiftUI struct XcodesApp: App { @NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate: AppDelegate @SwiftUI.Environment(\.scenePhase) private var scenePhase: ScenePhase + @SwiftUI.Environment(\.openURL) var openURL: OpenURLAction @StateObject private var appState = AppState() var body: some Scene { @@ -51,6 +52,25 @@ struct XcodesApp: App { } XcodeCommands(appState: appState) + + CommandGroup(replacing: CommandGroupPlacement.help) { + Button("Xcodes GitHub Repo") { + let xcodesRepoURL = URL(string: "https://github.com/RobotsAndPencils/XcodesApp/")! + openURL(xcodesRepoURL) + } + + Divider() + + Button("Report a Bug") { + let bugReportURL = URL(string: "https://github.com/RobotsAndPencils/XcodesApp/issues/new?assignees=&labels=bug&template=bug_report.md&title=")! + openURL(bugReportURL) + } + + Button("Request a New Feature") { + let featureRequestURL = URL(string: "https://github.com/RobotsAndPencils/XcodesApp/issues/new?assignees=&labels=enhancement&template=feature_request.md&title=")! + openURL(featureRequestURL) + } + } } }