From 7cba3b786d1729f99b77ad638619be78e5c22a8f Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 3 Dec 2026 09:36:33 -0800 Subject: [PATCH] Links: clicking a link on desktop opens it in the browser again The desktop app sends every link it opens (Help menu community links, the app bar's Discord button, Home's Community links, About and credits, help links in dialogs, the updater's Open URL, an object's URL attribute) as egui's OpenUrl output. The app built eframe without its `links` feature, so egui-winit only logged "Cannot open url - feature \"links\" not enabled." and nothing opened. Turn on eframe's `links` feature in apps/vectorcraft. Cargo.lock adds webbrowser 1.2.8. The web build does not use egui-winit and is unchanged. The feature can be removed once the craft-libs pin includes storytold/craft-libs#5083, which opens links in the shared app setup. --- Cargo.lock | 17 +++++++++++++++++ apps/vectorcraft/Cargo.toml | 5 ++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 75c87011b4..be4b734a08 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2900,6 +2900,7 @@ dependencies = [ "raw-window-handle", "smithay-clipboard", "web-time", + "webbrowser", "windows-sys 0.61.2", "winit", ] @@ -9642,6 +9643,22 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webbrowser" +version = "1.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13b31216ad837f3f4062538be333d8431d37c11832ef86924a3d0ad50defdc2f" +dependencies = [ + "jni", + "log", + "ndk-context", + "objc2 0.6.5", + "objc2-app-kit 0.3.2", + "objc2-foundation 0.3.2", + "url", + "web-sys", +] + [[package]] name = "webpki-root-certs" version = "1.0.11" diff --git a/apps/vectorcraft/Cargo.toml b/apps/vectorcraft/Cargo.toml index bc000f0bd6..d4d2659b3e 100644 --- a/apps/vectorcraft/Cargo.toml +++ b/apps/vectorcraft/Cargo.toml @@ -23,7 +23,10 @@ vectorcraft-text = { workspace = true } # the update client. craft = { workspace = true, features = ["ui", "ui-app", "settings", "automation", "platform", "window", "dialogs", "print", "update"] } craft-nightly = { workspace = true } -eframe = { workspace = true, features = ["clipboard", "default_fonts", "wayland", "x11"] } +# `links` makes egui's OpenUrl output (every link the app opens) start the system browser; without it egui-winit only +# logs the request. Remove it when the craft-libs pin includes storytold/craft-libs#5083, which opens links in the +# shared app setup. +eframe = { workspace = true, features = ["clipboard", "default_fonts", "links", "wayland", "x11"] } egui = { workspace = true } egui_extras = { workspace = true } serde_json = { workspace = true }