diff --git a/Cargo.lock b/Cargo.lock index 73d4d60fb..6714be11b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1547,6 +1547,7 @@ dependencies = [ "raw-window-handle", "smithay-clipboard", "web-time", + "webbrowser", "windows-sys 0.61.2", "winit", ] diff --git a/apps/figcraft/Cargo.toml b/apps/figcraft/Cargo.toml index f2ea73ba8..386cb1f33 100644 --- a/apps/figcraft/Cargo.toml +++ b/apps/figcraft/Cargo.toml @@ -23,7 +23,9 @@ craft-window = { workspace = true } # The suite's settings folder: `FIGCRAFT_CONFIG_DIR`, a portable marker, then the platform folder. craft-settings = { workspace = true } egui = { workspace = true } -eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit", "clipboard", "wayland", "x11"] } +# `links`: without it eframe drops every `ctx.open_url` and hyperlink click (the update prompt's +# What's new and Download, About, Credits) with only a log warning. +eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit", "clipboard", "links", "wayland", "x11"] } serde_json = { workspace = true } log = { workspace = true } rfd = { workspace = true } diff --git a/apps/figcraft/src/services_tests.rs b/apps/figcraft/src/services_tests.rs index 970f1729e..0d197f5ce 100644 --- a/apps/figcraft/src/services_tests.rs +++ b/apps/figcraft/src/services_tests.rs @@ -142,3 +142,13 @@ fn the_next_dialog_starts_in_the_folder_of_the_last_pick() { let _ = std::fs::remove_dir_all(&dir); assert_eq!(start_folder(Some(dir)), None, "a folder deleted since: the system's own"); } + +/// The update prompt's What's new and Download, and the About and Credits links, open through +/// `ctx.open_url`. eframe drops those with only a log warning unless it is built with `links`. +#[test] +fn links_in_the_interface_open_in_the_browser() { + let manifest = include_str!("../Cargo.toml"); + let eframe: Vec<&str> = manifest.lines().filter(|l| l.trim_start().starts_with("eframe =")).collect(); + assert!(!eframe.is_empty(), "the app depends on eframe"); + assert!(eframe.iter().any(|l| l.contains("\"links\"")), "eframe is built with `links`: {eframe:?}"); +}