Skip to content

Commit a3453a2

Browse files
koki-developclaude
andcommitted
fix(menu): stop About panel from showing a duplicated version string
macOS's native About panel falls back to Info.plist for any AboutMetadata key that's left unset, and Tauri writes CFBundleShortVersionString and CFBundleVersion to the same value — so `.about(None)` rendered "Version 0.21.0 (0.21.0)". Pass an explicit empty short_version to blank out the parenthetical build number instead of falling back to the duplicate. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent afe89ec commit a3453a2

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

src-tauri/src/menu.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use tauri::menu::{MenuBuilder, MenuItemBuilder, SubmenuBuilder};
1+
use tauri::menu::{AboutMetadataBuilder, MenuBuilder, MenuItemBuilder, SubmenuBuilder};
22
use tauri::{App, Emitter, EventTarget, Manager};
33

44
/// Pick the WebviewWindow that currently has keyboard focus, if any. Tauri
@@ -15,6 +15,17 @@ fn focused_webview_window(app: &tauri::AppHandle) -> Option<tauri::WebviewWindow
1515
}
1616

1717
pub fn setup(app: &mut App) -> tauri::Result<()> {
18+
// macOS's native About panel shows "Version {ApplicationVersion} ({Version})".
19+
// Both keys fall back to the same Info.plist value (Tauri sets
20+
// CFBundleShortVersionString and CFBundleVersion identically, since Cork has
21+
// no separate build-number concept), which is what produces the duplicated
22+
// "Version 0.21.0 (0.21.0)". Passing an explicit empty `short_version` blanks
23+
// out the parenthetical instead of falling back to that duplicate value.
24+
let about_metadata = AboutMetadataBuilder::new()
25+
.version(Some(app.package_info().version.to_string()))
26+
.short_version(Some(String::new()))
27+
.build();
28+
1829
let check_for_updates_item =
1930
MenuItemBuilder::with_id("check_for_updates", "Check for Updates...").build(app)?;
2031

@@ -35,7 +46,7 @@ pub fn setup(app: &mut App) -> tauri::Result<()> {
3546
.build(app)?;
3647

3748
let app_menu = SubmenuBuilder::new(app, "Cork")
38-
.about(None)
49+
.about(Some(about_metadata))
3950
.item(&check_for_updates_item)
4051
.separator()
4152
.item(&settings_item)

0 commit comments

Comments
 (0)