From 1ef83d2f20daa90ea34cb6867ea08d122c1be074 Mon Sep 17 00:00:00 2001 From: Dustin Mierau Date: Thu, 18 Jan 2024 11:33:54 -0800 Subject: Add Request Feature and Report Bug menu items to Help menu in macOS that link to GitHub issues with appropriate labels preselected. --- Hotline/Application.swift | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Hotline') diff --git a/Hotline/Application.swift b/Hotline/Application.swift index a8b4098..bf484ba 100644 --- a/Hotline/Application.swift +++ b/Hotline/Application.swift @@ -10,6 +10,7 @@ struct Application: App { #if os(macOS) @Environment(\.openWindow) private var openWindow + @Environment(\.openURL) private var openURL #endif @State private var preferences = Prefs() @@ -55,6 +56,19 @@ struct Application: App { } .keyboardShortcut(.init("K"), modifiers: .command) } + CommandGroup(after: .help) { + Divider() + Button("Request Feature...") { + if let url = URL(string: "https://github.com/mierau/hotline/issues/new?labels=enhancement") { + openURL(url) + } + } + Button("Report Bug...") { + if let url = URL(string: "https://github.com/mierau/hotline/issues/new?labels=bug") { + openURL(url) + } + } + } CommandMenu("Server") { Button("Disconnect") { activeHotline?.disconnect() -- cgit