Skip to content

Commit eda59c3

Browse files
committed
fix(tauri): scope About update links by platform
Only include website metadata in the native Linux About dialog, where Tauri renders it as an actionable link. Windows renders the same metadata as inert text and macOS ignores it, so those platforms now rely exclusively on the functional Get Updates menu command. Cover both supported and unsupported metadata modes and keep the application version available in every native About dialog. Validated with all 22 Tauri Rust tests, cargo check, git diff checks, and a follow-up gatekeeper review.
1 parent 705f102 commit eda59c3

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

  • packages/tauri-app/src-tauri/src

packages/tauri-app/src-tauri/src/main.rs

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,10 @@ fn build_menu(app: &AppHandle) -> tauri::Result<()> {
835835
let about_item = PredefinedMenuItem::about(
836836
app,
837837
Some("About CodeNomad"),
838-
Some(build_about_metadata(&app.package_info().version.to_string())),
838+
Some(build_about_metadata(
839+
&app.package_info().version.to_string(),
840+
cfg!(target_os = "linux"),
841+
)),
839842
)?;
840843
let get_updates_item = MenuItem::with_id(
841844
app,
@@ -1007,15 +1010,15 @@ fn build_menu(app: &AppHandle) -> tauri::Result<()> {
10071010
Ok(())
10081011
}
10091012

1010-
fn build_about_metadata(version: &str) -> AboutMetadata<'static> {
1013+
fn build_about_metadata(version: &str, include_update_link: bool) -> AboutMetadata<'static> {
10111014
AboutMetadata {
10121015
name: Some("CodeNomad".to_string()),
10131016
version: Some(version.to_string()),
10141017
authors: Some(vec!["Neural Nomads AI".to_string()]),
10151018
comments: Some("A desktop workspace for OpenCode.".to_string()),
10161019
license: Some("MIT".to_string()),
1017-
website: Some(RELEASES_URL.to_string()),
1018-
website_label: Some("Get updates".to_string()),
1020+
website: include_update_link.then(|| RELEASES_URL.to_string()),
1021+
website_label: include_update_link.then(|| "Get updates".to_string()),
10191022
..Default::default()
10201023
}
10211024
}
@@ -1025,12 +1028,20 @@ mod about_tests {
10251028
use super::{build_about_metadata, RELEASES_URL};
10261029

10271030
#[test]
1028-
fn about_metadata_includes_version_and_update_link() {
1029-
let metadata = build_about_metadata("1.2.3");
1031+
fn about_metadata_includes_version_and_supported_update_link() {
1032+
let metadata = build_about_metadata("1.2.3", true);
10301033

10311034
assert_eq!(metadata.name.as_deref(), Some("CodeNomad"));
10321035
assert_eq!(metadata.version.as_deref(), Some("1.2.3"));
10331036
assert_eq!(metadata.website.as_deref(), Some(RELEASES_URL));
10341037
assert_eq!(metadata.website_label.as_deref(), Some("Get updates"));
10351038
}
1039+
1040+
#[test]
1041+
fn about_metadata_omits_unsupported_update_link() {
1042+
let metadata = build_about_metadata("1.2.3", false);
1043+
1044+
assert_eq!(metadata.website, None);
1045+
assert_eq!(metadata.website_label, None);
1046+
}
10361047
}

0 commit comments

Comments
 (0)