From c0c82663c0cd78f4e20de3fcf8d5e2c81835e942 Mon Sep 17 00:00:00 2001 From: Bohdan Triapitsyn Date: Fri, 26 Dec 2025 03:23:58 +0200 Subject: [PATCH] feat: add "Join Discord" menu item and link in AboutDialog --- packages/desktop/src-tauri/src/main.rs | 22 +++++++++++++++++++ packages/ui/src/components/ui/AboutDialog.tsx | 11 +++++++++- packages/vscode/package.json | 1 + 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/packages/desktop/src-tauri/src/main.rs b/packages/desktop/src-tauri/src/main.rs index 4545bb7e..ae96b8a6 100644 --- a/packages/desktop/src-tauri/src/main.rs +++ b/packages/desktop/src-tauri/src/main.rs @@ -89,6 +89,8 @@ const MENU_ITEM_CHECK_FOR_UPDATES_ID: &str = "openchamber_check_for_updates"; const MENU_ITEM_REPORT_BUG_ID: &str = "openchamber_report_bug"; #[cfg(target_os = "macos")] const MENU_ITEM_REQUEST_FEATURE_ID: &str = "openchamber_request_feature"; +#[cfg(target_os = "macos")] +const MENU_ITEM_JOIN_DISCORD_ID: &str = "openchamber_join_discord"; // App menu #[cfg(target_os = "macos")] @@ -132,6 +134,7 @@ const MENU_ITEM_DOWNLOAD_LOGS_ID: &str = "openchamber_download_logs"; const GITHUB_BUG_REPORT_URL: &str = "https://github.com/btriapitsyn/openchamber/issues/new?template=bug_report.yml"; const GITHUB_FEATURE_REQUEST_URL: &str = "https://github.com/btriapitsyn/openchamber/issues/new?template=feature_request.yml"; +const DISCORD_INVITE_URL: &str = "https://discord.gg/ZYRSdnwwKA"; #[derive(Clone)] pub(crate) struct DesktopRuntime { @@ -493,6 +496,14 @@ fn build_macos_menu(app: &tauri::AppHandle) -> tauri::Resu None::<&str>, )?; + let join_discord = MenuItem::with_id( + app, + MENU_ITEM_JOIN_DISCORD_ID, + "Join Discord", + true, + None::<&str>, + )?; + let theme_submenu = Submenu::with_items( app, "Theme", @@ -524,6 +535,8 @@ fn build_macos_menu(app: &tauri::AppHandle) -> tauri::Resu &PredefinedMenuItem::separator(app)?, &report_bug, &request_feature, + &PredefinedMenuItem::separator(app)?, + &join_discord, ], )?; @@ -873,6 +886,15 @@ fn main() { return; } + if event_id == MENU_ITEM_JOIN_DISCORD_ID { + use tauri_plugin_shell::ShellExt; + #[allow(deprecated)] + { + let _ = app.shell().open(DISCORD_INVITE_URL, None); + } + return; + } + // App menu actions if event_id == MENU_ITEM_ABOUT_ID { let _ = app.emit("openchamber:menu-action", "about"); diff --git a/packages/ui/src/components/ui/AboutDialog.tsx b/packages/ui/src/components/ui/AboutDialog.tsx index 32b9ac38..e491bff7 100644 --- a/packages/ui/src/components/ui/AboutDialog.tsx +++ b/packages/ui/src/components/ui/AboutDialog.tsx @@ -4,7 +4,7 @@ import { DialogContent, } from '@/components/ui/dialog'; import { OpenChamberLogo } from '@/components/ui/OpenChamberLogo'; -import { RiGithubFill, RiTwitterXFill } from '@remixicon/react'; +import { RiDiscordFill, RiGithubFill, RiTwitterXFill } from '@remixicon/react'; declare const __APP_VERSION__: string | undefined; @@ -80,6 +80,15 @@ export const AboutDialog: React.FC = ({ GitHub + + + Discord +