From 5324a75e06e814b08642338893624fcc7245cc5d Mon Sep 17 00:00:00 2001 From: Valentin Millet Date: Wed, 25 Nov 2026 16:08:49 +0100 Subject: [PATCH 1/9] macOS: CI, e2e and release builds for Apple Silicon and Intel --- .github/workflows/ci.yml | 9 +++-- crates/app/Cargo.toml | 4 +- crates/app/src/main.rs | 29 +++++++++----- crates/platform/src/instance.rs | 56 +++++++++++++++++++++++++-- crates/platform/src/motion.rs | 10 ++++- crates/platform/src/updater/system.rs | 50 +++++++++++++++++------- crates/platform/src/window.rs | 6 +++ crates/ui/src/keys.rs | 10 ++++- crates/ui/src/state/mod.rs | 9 ++--- deny.toml | 1 + 10 files changed, 144 insertions(+), 40 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1760d1d49..49c39a2b1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -192,7 +192,7 @@ jobs: strategy: fail-fast: true matrix: - os: [ubuntu-22.04, windows-latest] + os: [ubuntu-22.04, windows-latest, macos-latest] steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 @@ -225,7 +225,7 @@ jobs: echo "\`test-rust\` (${{ matrix.os }}) — $(($(date +%s) - start)) s" >> "$GITHUB_STEP_SUMMARY" - name: Test - if: runner.os == 'Windows' + if: runner.os != 'Linux' run: | start=$(date +%s) @@ -313,7 +313,7 @@ jobs: strategy: fail-fast: true matrix: - os: [ubuntu-22.04, windows-latest] + os: [ubuntu-22.04, windows-latest, macos-latest] # The flavour in `target/debug`, where the cache is: nothing else builds `app` in this job. env: @@ -354,7 +354,8 @@ jobs: { echo "\`e2e\` (${{ matrix.os }}) — $(($(date +%s) - start)) s" echo - sed 's/\x1b\[[0-9;]*m//g' "$output" | awk ' + # perl: macOS's sed knows no \x1b. + perl -pe 's/\x1b\[[0-9;]*m//g' "$output" | awk ' match($0, /tests.[0-9a-z_]+\.rs/) { name = substr($0, RSTART + 6, RLENGTH - 9); order[++n] = name; next } /Doc-tests/ { name = "" } /^▶ / { steps[name]++ } diff --git a/crates/app/Cargo.toml b/crates/app/Cargo.toml index f18acd0b7..45471fa24 100644 --- a/crates/app/Cargo.toml +++ b/crates/app/Cargo.toml @@ -72,8 +72,8 @@ profiling = { workspace = true, optional = true } puffin = { workspace = true, optional = true } puffin_http = { workspace = true, optional = true } -[target.'cfg(target_os = "linux")'.dependencies] -# The one eframe uses, for its X11 switch (D15). +[target.'cfg(any(target_os = "linux", target_os = "macos"))'.dependencies] +# The one eframe uses, for its X11 switch (D15) and for macOS's menu bar. winit.workspace = true [dev-dependencies] diff --git a/crates/app/src/main.rs b/crates/app/src/main.rs index 2fc9625bc..f1eb2fa05 100644 --- a/crates/app/src/main.rs +++ b/crates/app/src/main.rs @@ -97,8 +97,9 @@ fn run(locations: Locations, instance: Instance) -> eframe::Result { { log::warn!("Second launches will not be heard: {error}"); } - let desktop = desktop::start(&preferences, &inbox); - let startup = ui::Startup { + // ⚠️ Called with the event loop running: macOS makes no tray icon before. + let startup = move || ui::Startup { + desktop: desktop::start(&preferences, &inbox), paths: engine::Paths { profile: locations.profile, }, @@ -109,18 +110,17 @@ fn run(locations: Locations, instance: Instance) -> eframe::Result { inbox, waker, inputs, - desktop, }; eframe::run_native( METADATA.name, options(restored), #[cfg(not(feature = "e2e"))] - Box::new(move |cc| Ok(Box::new(ui::DevNotesApp::new(cc, startup)?))), + Box::new(move |cc| Ok(Box::new(ui::DevNotesApp::new(cc, startup())?))), #[cfg(feature = "e2e")] Box::new(move |cc| { unpainted::attach(&cc.egui_ctx); - Ok(Box::new(ui::DevNotesApp::new(cc, startup)?)) + Ok(Box::new(ui::DevNotesApp::new(cc, startup())?)) }), ) } @@ -158,7 +158,7 @@ fn options(restored: Option) -> eframe::NativeOptions { viewport, centered: restored.is_none(), persist_window: false, - event_loop_builder: x11_when_possible(), + event_loop_builder: event_loop(), wgpu_options: renderer::options(), ..Default::default() } @@ -167,7 +167,7 @@ fn options(restored: Option) -> eframe::NativeOptions { /// D15: under native Wayland, winit 0.30 delivers no dropped file and cannot hide the window, /// so X11 (`XWayland`) is taken whenever a display offers it. #[cfg(target_os = "linux")] -fn x11_when_possible() -> Option { +fn event_loop() -> Option { use winit::platform::x11::EventLoopBuilderExtX11; std::env::var_os("DISPLAY")?; @@ -176,8 +176,19 @@ fn x11_when_possible() -> Option { })) } -#[cfg(not(target_os = "linux"))] -fn x11_when_possible() -> Option { +/// No menu bar of winit's: its « Quit » ends the process where it stands, with what is typed and +/// unsaved. ⌘Q is the application's own key. +#[cfg(target_os = "macos")] +fn event_loop() -> Option { + use winit::platform::macos::EventLoopBuilderExtMacOS; + + Some(Box::new(|builder| { + builder.with_default_menu(false); + })) +} + +#[cfg(not(any(target_os = "linux", target_os = "macos")))] +fn event_loop() -> Option { None } diff --git a/crates/platform/src/instance.rs b/crates/platform/src/instance.rs index 057bd4fbf..f75099206 100644 --- a/crates/platform/src/instance.rs +++ b/crates/platform/src/instance.rs @@ -50,13 +50,30 @@ pub enum Claim { Taken, } -pub struct Instance(Listener); +pub struct Instance { + listener: Listener, + #[cfg(target_os = "macos")] + _lock: std::fs::File, +} /// Takes the profile's name, or finds it taken. Two profiles never share one. pub fn claim(profile: &Path) -> io::Result { let name = socket_name(profile)?.to_ns_name::()?; - match ListenerOptions::new().name(name).create_sync() { - Ok(listener) => Ok(Claim::First(Instance(listener))), + // ⚠️ macOS names a socket by a file, which a crash leaves behind: there a lock, which goes with + // the process, says who holds the profile, and a name left behind is taken over. + #[cfg(target_os = "macos")] + let Some(lock) = lock(profile)? else { + return Ok(Claim::Taken); + }; + let options = ListenerOptions::new() + .name(name) + .try_overwrite(cfg!(target_os = "macos")); + match options.create_sync() { + Ok(listener) => Ok(Claim::First(Instance { + listener, + #[cfg(target_os = "macos")] + _lock: lock, + })), // ⚠️ Windows answers a named pipe already created with « access denied », not // « address in use ». Err(error) @@ -71,6 +88,21 @@ pub fn claim(profile: &Path) -> io::Result { } } +/// `None` while another process holds it. +#[cfg(target_os = "macos")] +fn lock(profile: &Path) -> io::Result> { + let file = std::fs::File::options() + .create(true) + .truncate(false) + .write(true) + .open(profile.join("instance.lock"))?; + match file.try_lock() { + Ok(()) => Ok(Some(file)), + Err(std::fs::TryLockError::WouldBlock) => Ok(None), + Err(std::fs::TryLockError::Error(error)) => Err(error), + } +} + /// What a second launch does: hand `message` to the profile's instance. pub fn send(profile: &Path, message: &Message) -> io::Result<()> { let name = socket_name(profile)?.to_ns_name::()?; @@ -85,7 +117,9 @@ impl Instance { std::thread::Builder::new() .name("single-instance".to_string()) .spawn(move || { - for connection in self.0.incoming() { + // Whole: naming the listener alone would leave the lock behind, and free it. + let instance = self; + for connection in instance.listener.incoming() { match connection.map(read_message) { Ok(Some(message)) => deliver(message), Ok(None) => log::warn!("A second launch sent nothing readable"), @@ -172,6 +206,20 @@ mod tests { assert_eq!(hearing.recv_timeout(wait).unwrap(), Message::Reveal); } + #[cfg(target_os = "macos")] + #[test] + fn a_name_left_by_a_crash_is_taken_over() { + let profile = tempfile::tempdir().unwrap(); + let name = socket_name(profile.path()) + .unwrap() + .to_ns_name::() + .unwrap(); + let crashed = ListenerOptions::new().name(name).reclaim_name(false); + drop(crashed.create_sync().unwrap()); + + drop(first(profile.path())); + } + #[test] fn two_profiles_never_collide() { let one = tempfile::tempdir().unwrap(); diff --git a/crates/platform/src/motion.rs b/crates/platform/src/motion.rs index 1b19f57fb..b7cc63460 100644 --- a/crates/platform/src/motion.rs +++ b/crates/platform/src/motion.rs @@ -20,7 +20,15 @@ pub fn system_prefers_reduced() -> bool { .is_ok_and(|output| String::from_utf8_lossy(&output.stdout).trim() == "false") } -#[cfg(not(any(windows, target_os = "linux")))] +#[cfg(target_os = "macos")] +pub fn system_prefers_reduced() -> bool { + std::process::Command::new("defaults") + .args(["read", "com.apple.universalaccess", "reduceMotion"]) + .output() + .is_ok_and(|output| String::from_utf8_lossy(&output.stdout).trim() == "1") +} + +#[cfg(not(any(windows, target_os = "linux", target_os = "macos")))] pub fn system_prefers_reduced() -> bool { false } diff --git a/crates/platform/src/updater/system.rs b/crates/platform/src/updater/system.rs index f77a41c47..e500208be 100644 --- a/crates/platform/src/updater/system.rs +++ b/crates/platform/src/updater/system.rs @@ -92,42 +92,64 @@ impl Updater for System { } /// The installer relaunches under Windows (`/R`), and the process has ended by now. -#[cfg(not(target_os = "linux"))] +#[cfg(not(unix))] fn come_back() {} -/// Started only once this process is gone: one that came up beside it would find the profile -/// taken, hand over to it, and leave nothing running. #[cfg(target_os = "linux")] fn come_back() { - const AFTER_US: &str = - r#"while kill -0 "$1" 2>/dev/null; do sleep 0.1; done; shift; exec "$@""#; - let Some(image) = std::env::var_os("APPIMAGE") else { + if let Some(image) = std::env::var_os("APPIMAGE") { + start_once_gone(std::iter::once(image).chain(std::env::args_os().skip(1))); + } +} + +#[cfg(target_os = "macos")] +fn come_back() { + let Ok(exe) = std::env::current_exe() else { return; }; + if let Some(bundle) = bundle_of(&exe) { + start_once_gone(["open".into(), bundle.as_os_str().to_owned()]); + } +} + +/// Started only once this process is gone: one that came up beside it would find the profile +/// taken, hand over to it, and leave nothing running. +#[cfg(unix)] +fn start_once_gone(command: impl IntoIterator) { + const AFTER_US: &str = + r#"while kill -0 "$1" 2>/dev/null; do sleep 0.1; done; shift; exec "$@""#; let started = std::process::Command::new("sh") .args(["-c", AFTER_US, "sh"]) .arg(std::process::id().to_string()) - .arg(image) - .args(std::env::args_os().skip(1)) + .args(command) .spawn(); if let Err(error) = started { log::error!("The application was not started again: {error}"); } } -/// Only what an installer put in place replaces itself: an `AppImage`, or a folder with the NSIS -/// uninstaller in it. A build run from `target/` asks nobody for anything. +/// Only what was put in place replaces itself: an `AppImage`, a macOS application, or a folder with +/// the NSIS uninstaller in it. A build run from `target/` asks nobody for anything. fn installs_itself() -> bool { if cfg!(target_os = "linux") { return std::env::var_os("APPIMAGE").is_some(); } - std::env::current_exe() - .ok() - .as_deref() - .and_then(Path::parent) + let Ok(exe) = std::env::current_exe() else { + return false; + }; + if cfg!(target_os = "macos") { + return bundle_of(&exe).is_some(); + } + exe.parent() .is_some_and(|folder| folder.join("uninstall.exe").is_file()) } +/// The `.app` a macOS executable is in. +fn bundle_of(exe: &Path) -> Option<&Path> { + exe.ancestors() + .find(|folder| folder.extension().is_some_and(|ending| ending == "app")) +} + pub(super) fn built(source: &Source<'_>, can_install: bool) -> Option { let current = Version::parse(source.version).ok()?; let endpoint = Url::parse(source.endpoint).ok()?; diff --git a/crates/platform/src/window.rs b/crates/platform/src/window.rs index ad963da60..909ee35c4 100644 --- a/crates/platform/src/window.rs +++ b/crates/platform/src/window.rs @@ -27,6 +27,12 @@ pub fn is_native_wayland() -> bool { ) } +/// Whether a window put out of sight can be called back. Nothing hides one under native Wayland, and +/// on macOS a click on the Dock brings back a window that is minimised, not one that is hidden. +pub fn can_hide() -> bool { + !cfg!(target_os = "macos") && !is_native_wayland() +} + fn only_wayland(x11: Option<&OsStr>, wayland: Option<&OsStr>) -> bool { x11.is_none() && wayland.is_some() } diff --git a/crates/ui/src/keys.rs b/crates/ui/src/keys.rs index 6bc8190d3..21149a821 100644 --- a/crates/ui/src/keys.rs +++ b/crates/ui/src/keys.rs @@ -32,7 +32,7 @@ pub struct Binding { } /// Every area's key, `Ctrl` and its rank in the switch, read by position. -pub static APPLICATION: [Binding; 5] = [ +pub static APPLICATION: [Binding; 6] = [ area(Key::Num1, Area::Notes), area(Key::Num2, Area::Tools), area(Key::Num3, Area::Http), @@ -51,6 +51,14 @@ pub static APPLICATION: [Binding; 5] = [ while_typing: true, action: Action::Global(crate::action::GlobalAction::PaletteHere), }, + // ⌘ is only ever held on a Mac, where the menu bar that would answer is not there. + Binding { + key: Key::Q, + modifiers: Modifiers::MAC_CMD, + read: Read::Character, + while_typing: true, + action: Action::Global(crate::action::GlobalAction::Quit), + }, ]; /// The notes area's, read while it is on screen. diff --git a/crates/ui/src/state/mod.rs b/crates/ui/src/state/mod.rs index 793d24a7b..db4bbed2e 100644 --- a/crates/ui/src/state/mod.rs +++ b/crates/ui/src/state/mod.rs @@ -197,13 +197,12 @@ pub struct AppState { pub reduced_motion: bool, } -/// Out of sight, for the tray or a key to call back. Nothing hides a window under native -/// Wayland: it minimises there. +/// Out of sight, for the tray, a key or the Dock to call back: minimised where nothing hides it. pub(crate) fn put_away(ctx: &egui::Context) { - ctx.send_viewport_cmd(if platform::window::is_native_wayland() { - egui::ViewportCommand::Minimized(true) - } else { + ctx.send_viewport_cmd(if platform::window::can_hide() { egui::ViewportCommand::Visible(false) + } else { + egui::ViewportCommand::Minimized(true) }); } diff --git a/deny.toml b/deny.toml index f43ffc81b..ae011c0e1 100644 --- a/deny.toml +++ b/deny.toml @@ -3,6 +3,7 @@ targets = [ "x86_64-pc-windows-msvc", "x86_64-unknown-linux-gnu", "aarch64-apple-darwin", + "x86_64-apple-darwin", ] all-features = true From ca190666dee611c05d08d77c3b4ce602b5003ad1 Mon Sep 17 00:00:00 2001 From: Valentin Millet Date: Wed, 25 Nov 2026 16:10:26 +0100 Subject: [PATCH 2/9] macOS packages: a .dmg and the updater's archive per architecture --- .github/actions/package/action.yml | 27 ++++++++++++++++++++++++--- .github/scripts/installed.sh | 16 ++++++++++++++-- .github/workflows/packages.yml | 26 ++++++++++++++++++++++---- .github/workflows/release.yml | 6 ++++++ crates/app/Cargo.toml | 6 ++++++ scripts/latest-json.mjs | 9 +++++++-- scripts/latest-json.test.mjs | 26 +++++++++++++++++++++----- 7 files changed, 100 insertions(+), 16 deletions(-) diff --git a/.github/actions/package/action.yml b/.github/actions/package/action.yml index c1c0d7f04..f26a82996 100644 --- a/.github/actions/package/action.yml +++ b/.github/actions/package/action.yml @@ -1,7 +1,7 @@ name: Package description: >- The packages of the release build already in target/release (NSIS on Windows; deb, AppImage and - rpm on Linux), signed, each checked to hold the application alone, gathered with the standalone + rpm on Linux; a .dmg and the updater's archive on macOS), signed, each checked to hold the application alone, gathered with the standalone executable into a folder. inputs: @@ -43,6 +43,18 @@ runs: rm -rf "$packages" if [ "$RUNNER_OS" = Windows ]; then cargo packager -p app --release -f nsis -o "$packages" + elif [ "$RUNNER_OS" = macOS ]; then + cargo packager -p app --release -f app,dmg -o "$packages" + # One archive an architecture in a release: the packager names it after the application alone. + version=$(cargo metadata --format-version 1 --no-deps \ + | jq -r '.packages[] | select(.name == "app") | .version') + arch=$([ "$RUNNER_ARCH" = ARM64 ] && echo aarch64 || echo x64) + for ending in dmg dmg.sig; do + mv "$packages/DevNotes_${version}_$arch.$ending" "$packages/devnotes_${version}_$arch.$ending" + done + for ending in app.tar.gz app.tar.gz.sig; do + mv "$packages/DevNotes.$ending" "$packages/devnotes_${version}_$arch.$ending" + done else cargo packager -p app --release -f deb,appimage -o "$packages" version=$(cargo metadata --format-version 1 --no-deps \ @@ -75,6 +87,15 @@ runs: pwsh -NoProfile -Command "Start-Process '$(cygpath -w "$scratch/uninstall.exe")' -ArgumentList '/S' -Wait" # The uninstaller leaves the remembered folder behind; a later install would reuse it. reg delete 'HKCU\Software\vmillet-dev\DevNotes' //f > /dev/null 2>&1 || true + elif [ "$RUNNER_OS" = macOS ]; then + codesign --verify --deep --strict "$packages/DevNotes.app" + archive=$(ls "$packages"/*.app.tar.gz) + check archive "$(tar -tzf "$archive" | grep '/Contents/MacOS/[^/]' | xargs -n1 basename)" devnotes + mounted="$RUNNER_TEMP/dmg-check" + # The image shows the licence first. + yes | PAGER=cat hdiutil attach -nobrowse -readonly -mountpoint "$mounted" "$(ls "$packages"/*.dmg)" > /dev/null + check dmg "$(ls "$mounted/DevNotes.app/Contents/MacOS")" devnotes + hdiutil detach "$mounted" > /dev/null else deb=$(ls "$packages"/*.deb) check deb "$(dpkg-deb -c "$deb" | awk '$6 ~ /^\.?\/?usr\/bin\/[^\/]+$/ { n = split($6, p, "/"); print p[n] }')" devnotes @@ -97,11 +118,11 @@ runs: | jq -r '.packages[] | select(.name == "app") | .version') mkdir -p "$OUT" find "$packages" -maxdepth 1 -type f \ - \( -name '*-setup.exe' -o -name '*.deb' -o -name '*.rpm' -o -name '*.AppImage' -o -name '*.sig' \) \ + \( -name '*-setup.exe' -o -name '*.deb' -o -name '*.rpm' -o -name '*.AppImage' -o -name '*.dmg' -o -name '*.app.tar.gz' -o -name '*.sig' \) \ -exec cp {} "$OUT/" \; if [ "$RUNNER_OS" = Windows ]; then cp target/release/devnotes.exe "$OUT/devnotes-$version-windows.exe" - else + elif [ "$RUNNER_OS" = Linux ]; then cp target/release/devnotes "$OUT/devnotes-$version-linux" fi ls -l "$OUT" diff --git a/.github/scripts/installed.sh b/.github/scripts/installed.sh index 501f02d0a..9f253b6a4 100755 --- a/.github/scripts/installed.sh +++ b/.github/scripts/installed.sh @@ -1,7 +1,8 @@ #!/usr/bin/env bash # Whether version $1 is the one installed by `packages.yml`: the AppImage in place is that -# version's file (Linux), or the per-user install says that version (Windows). An update under -# Windows finishes in an installer of its own: waited for, two minutes at most. +# version's file (Linux), the application says that version and is whole (macOS), or the per-user +# install says it (Windows). An update under Windows finishes in an installer of its own: waited for, +# two minutes at most. set -euo pipefail expected=$1 case "$expected" in @@ -22,6 +23,17 @@ if [ "$RUNNER_OS" = Linux ]; then exit 0 fi +if [ "$RUNNER_OS" = macOS ]; then + app="$RUNNER_TEMP/installed/DevNotes.app" + found=$(/usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' "$app/Contents/Info.plist") + if [ "$found" != "$expected" ] || [ ! -x "$app/Contents/MacOS/devnotes" ]; then + echo "::error::the application in place is '$found', expected $expected" + exit 1 + fi + echo "installed: $expected" + exit 0 +fi + # The uninstall entry the NSIS installer writes under HKCU, a field of it. entry() { pwsh -NoProfile -Command "(Get-ItemProperty 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*' -ErrorAction SilentlyContinue | Where-Object DisplayName -eq 'DevNotes').$1" | tr -d '\r"' diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index dfe8febd4..395406212 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -41,7 +41,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-22.04, windows-latest] + os: [ubuntu-22.04, windows-latest, macos-latest, macos-15-intel] env: SERVED: ${{ github.workspace }}/served ORIGIN: http://127.0.0.1:8765 @@ -103,7 +103,7 @@ jobs: mkdir -p "$SERVED/$kind" cp new/* "$SERVED/$kind/" # The manifest script refuses a release without Windows: a stand-in, never fetched. - if [ "$RUNNER_OS" = Linux ]; then + if [ "$RUNNER_OS" != Windows ]; then echo stand-in > "$SERVED/$kind/devnotes_1.0.1_x64-setup.exe" echo stand-in > "$SERVED/$kind/devnotes_1.0.1_x64-setup.exe.sig" fi @@ -112,6 +112,8 @@ jobs: done if [ "$RUNNER_OS" = Windows ]; then package=$(ls "$SERVED/altered" | grep -- '-setup\.exe$') + elif [ "$RUNNER_OS" = macOS ]; then + package=$(ls "$SERVED/altered" | grep '\.app\.tar\.gz$') else package=$(ls "$SERVED/altered" | grep '\.AppImage$') fi @@ -126,6 +128,12 @@ jobs: run: | if [ "$RUNNER_OS" = Windows ]; then pwsh -NoProfile -Command "Start-Process '$(cygpath -w "$(ls old/*-setup.exe)")' -ArgumentList '/S' -Wait" + elif [ "$RUNNER_OS" = macOS ]; then + # Copied from the image, as a person drags it. + mkdir -p "$RUNNER_TEMP/installed" + yes | PAGER=cat hdiutil attach -nobrowse -readonly -mountpoint "$RUNNER_TEMP/image" "$(ls old/*.dmg)" > /dev/null + ditto "$RUNNER_TEMP/image/DevNotes.app" "$RUNNER_TEMP/installed/DevNotes.app" + hdiutil detach "$RUNNER_TEMP/image" > /dev/null else mkdir -p "$RUNNER_TEMP/installed" cp old/*.AppImage "$RUNNER_TEMP/installed/DevNotes.AppImage" @@ -133,10 +141,20 @@ jobs: fi .github/scripts/installed.sh 1.0.0 + # What replaces a macOS application is found beside the executable that runs. + - name: The updater, where it runs from + run: | + updater=target/release/examples/update + if [ "$RUNNER_OS" = macOS ]; then + cp "$updater" "$RUNNER_TEMP/installed/DevNotes.app/Contents/MacOS/update" + updater="$RUNNER_TEMP/installed/DevNotes.app/Contents/MacOS/update" + fi + echo "UPDATER=$updater" >> "$GITHUB_ENV" + - name: The altered 1.0.1 is refused, 1.0.0 stays run: | set +e - APPIMAGE="$RUNNER_TEMP/installed/DevNotes.AppImage" target/release/examples/update 1.0.0 \ + APPIMAGE="$RUNNER_TEMP/installed/DevNotes.AppImage" "$UPDATER" 1.0.0 \ "$ORIGIN/altered/latest.json" '${{ steps.key.outputs.public }}' status=$? set -e @@ -148,7 +166,7 @@ jobs: - name: The whole 1.0.1 is installed run: | - APPIMAGE="$RUNNER_TEMP/installed/DevNotes.AppImage" target/release/examples/update 1.0.0 \ + APPIMAGE="$RUNNER_TEMP/installed/DevNotes.AppImage" "$UPDATER" 1.0.0 \ "$ORIGIN/whole/latest.json" '${{ steps.key.outputs.public }}' .github/scripts/installed.sh 1.0.1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bf7d37936..1bdd5ebe6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -215,6 +215,8 @@ jobs: environment: release runs-on: ${{ matrix.os }} timeout-minutes: 60 + # ⚠️ The tag is out by now: a macOS leg that fails must not leave it without a release. + continue-on-error: ${{ startsWith(matrix.target, 'macos') }} defaults: run: shell: bash @@ -228,6 +230,10 @@ jobs: target: linux - os: windows-latest target: windows + - os: macos-latest + target: macos-aarch64 + - os: macos-15-intel + target: macos-x64 steps: # The SHA rather than the tag name: the tag was just created by `prepare`, and a SHA # cannot come to mean something else in between. diff --git a/crates/app/Cargo.toml b/crates/app/Cargo.toml index 45471fa24..d0c9cd1a7 100644 --- a/crates/app/Cargo.toml +++ b/crates/app/Cargo.toml @@ -30,6 +30,12 @@ icons = ["icons/32x32.png", "icons/128x128.png", "icons/icon.png", "icons/icon.i [package.metadata.packager.nsis] installer-mode = "currentUser" +# Signed by nobody (« - »): a Mac with Apple Silicon starts no downloaded build that is not signed at +# all. The packager makes the icon of the PNGs above. +[package.metadata.packager.macos] +signing-identity = "-" +minimum-system-version = "11.0" + # GTK for the tray alone (D29); xkbcommon, Vulkan and the indicator are opened at run time. [package.metadata.packager.deb] package-name = "devnotes" diff --git a/scripts/latest-json.mjs b/scripts/latest-json.mjs index a51ef2183..02d2663c1 100644 --- a/scripts/latest-json.mjs +++ b/scripts/latest-json.mjs @@ -3,7 +3,8 @@ // `node scripts/latest-json.mjs --dir release --base --version x.y.z --notes `. // // `cargo-packager-updater` refuses a platform without its `format`, and installs only the NSIS -// installer and the AppImage: the other signatures (.deb, .rpm) are ignored, not fatal. +// installer, the AppImage and the macOS application: the other signatures (.deb, .rpm, .dmg) are +// ignored, not fatal. import { existsSync, readFileSync, readdirSync, writeFileSync } from 'node:fs'; import { join } from 'node:path'; @@ -13,6 +14,8 @@ import { pathToFileURL } from 'node:url'; export const TARGETS = [ { suffix: '-setup.exe', key: 'windows-x86_64', format: 'nsis' }, { suffix: '.AppImage', key: 'linux-x86_64', format: 'appimage' }, + { suffix: '_aarch64.app.tar.gz', key: 'macos-aarch64', format: 'app' }, + { suffix: '_x64.app.tar.gz', key: 'macos-x86_64', format: 'app' }, ]; /** @@ -50,7 +53,9 @@ export function manifest({ names, read, base, version, notes, now = new Date() } if (!notes.trim()) { throw new Error('no release notes'); } - const warnings = platforms['linux-x86_64'] ? [] : ['No Linux update artifact: Windows-only manifest.']; + const warnings = TARGETS.filter(({ key }) => !platforms[key]).map( + ({ key }) => `No update artifact for ${key}.`, + ); for (const entry of Object.values(platforms)) { delete entry.asset; } diff --git a/scripts/latest-json.test.mjs b/scripts/latest-json.test.mjs index 432da2453..54facc195 100644 --- a/scripts/latest-json.test.mjs +++ b/scripts/latest-json.test.mjs @@ -7,11 +7,17 @@ const SIGNATURES = { 'devnotes_1.0.1_x64-setup.exe.sig': 'sig-nsis\n', 'devnotes_1.0.1_x86_64.AppImage.sig': 'sig-appimage\n', 'devnotes_1.0.1_amd64.deb.sig': 'sig-deb\n', + 'devnotes_1.0.1_aarch64.app.tar.gz.sig': 'sig-arm\n', + 'devnotes_1.0.1_aarch64.dmg.sig': 'sig-dmg\n', + 'devnotes_1.0.1_x64.app.tar.gz.sig': 'sig-intel\n', }; const RELEASE = [ 'devnotes_1.0.1_x64-setup.exe', 'devnotes_1.0.1_x86_64.AppImage', 'devnotes_1.0.1_amd64.deb', + 'devnotes_1.0.1_aarch64.app.tar.gz', + 'devnotes_1.0.1_aarch64.dmg', + 'devnotes_1.0.1_x64.app.tar.gz', 'devnotes-1.0.1-windows.exe', ...Object.keys(SIGNATURES), ]; @@ -28,7 +34,7 @@ const build = (names, overrides = {}) => }); describe('latest.json', () => { - it('lists the NSIS installer and the AppImage with their format, signature and address', () => { + it('lists what each system installs with its format, signature and address', () => { const { manifest: written, ignored } = build(RELEASE); assert.deepEqual(written, { @@ -46,9 +52,19 @@ describe('latest.json', () => { signature: 'sig-appimage', url: 'https://example.org/download/v1.0.1/devnotes_1.0.1_x86_64.AppImage', }, + 'macos-aarch64': { + format: 'app', + signature: 'sig-arm', + url: 'https://example.org/download/v1.0.1/devnotes_1.0.1_aarch64.app.tar.gz', + }, + 'macos-x86_64': { + format: 'app', + signature: 'sig-intel', + url: 'https://example.org/download/v1.0.1/devnotes_1.0.1_x64.app.tar.gz', + }, }, }); - assert.deepEqual(ignored, ['devnotes_1.0.1_amd64.deb']); + assert.deepEqual(ignored, ['devnotes_1.0.1_amd64.deb', 'devnotes_1.0.1_aarch64.dmg']); }); it('never takes the standalone executable for the installer', () => { @@ -67,12 +83,12 @@ describe('latest.json', () => { assert.throws(() => build(names), /no Windows/); }); - it('warns when Linux is missing but still writes the manifest', () => { - const names = RELEASE.filter((name) => !name.includes('AppImage')); + it('warns of each system that is missing but still writes the manifest', () => { + const names = RELEASE.filter((name) => !/AppImage|app\.tar\.gz/.test(name)); const { manifest: written, warnings } = build(names); - assert.equal(warnings.length, 1); + assert.equal(warnings.length, 3); assert.deepEqual(Object.keys(written.platforms), ['windows-x86_64']); }); From 573c30281e7d1350d201ed77a3b08ecfe4fbb986 Mon Sep 17 00:00:00 2001 From: Valentin Millet Date: Wed, 25 Nov 2026 16:13:43 +0100 Subject: [PATCH 3/9] macOS: offered by the site and said in the documentation --- CLAUDE.md | 2 +- README.md | 14 +++++---- crates/platform/src/updater/tests.rs | 7 ++++- docs/architecture.md | 22 +++++++------ docs/content/en/faq.md | 4 +-- docs/content/en/safety.md | 1 + docs/content/en/start.md | 4 ++- docs/content/fr/faq.md | 4 +-- docs/content/fr/safety.md | 1 + docs/content/fr/start.md | 4 ++- docs/releasing.md | 4 +++ website/src/app/core/release.ts | 35 +++++++++++++++++++-- website/src/app/download/download-page.html | 9 ++++-- website/src/app/download/download-page.ts | 32 +++++++++++++------ website/src/app/home/home-page.ts | 10 +++--- 15 files changed, 112 insertions(+), 41 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 61c5bef1d..ad81f39b2 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -24,7 +24,7 @@ Principles: - Node is only a build tool: `npm install` · `npm run lint` (Prettier over Markdown, JSON, YAML; `format` writes) · `npm run test:scripts` (⚠️ test files are named one by one in `package.json`; add new ones there) · `cargo run -p app --example icons` (writes `crates/app/icons/`; ⚠️ small `.ico` sizes come from `icons/source/`) · `npm run prettier` (copies the pinned Prettier into `crates/text/prettier/`, the formatter compiled in). The request-script libraries are bundled by `crates/engine/sandbox/build.mjs`, from that folder's own `package.json`. - Website (`website/`, Angular, devnotes.fr; its own `package.json`, outside the Cargo workspace): from `website/`, `npm ci` · `npm start` (port 4300) · `npm run build` (fetches the latest release, prerenders to `website/dist/`, checks every page and its download links) · `npm test` · `npm run lint` · `npm run test:scripts`. `website.yml` publishes it when `website/` or `docs/content/` changes on `main`, and after each release. → "The website". - E2E: `cargo build -p app --features e2e --target-dir target/e2e`, then `cargo test -p e2e` (the driver is `e2e/` at the root; all scenarios, one after the other; `--test 01_first_launch` for one; `cargo test --workspace --exclude e2e` otherwise). `01`–`35` are the WebdriverIO scenarios ported, the rest are this application's own. → "The scenarios, on the assembled window". -- Release is a `workflow_dispatch` after a version bump; the version is `[workspace.package] version` in `Cargo.toml` alone (D27), so a bump touches `Cargo.toml` and `Cargo.lock` (`cargo update --workspace`); `scripts/version.mjs` refuses a release where they disagree. `release.yml` builds, packages (`cargo-packager`: NSIS, AppImage, deb; rpm by `cargo-generate-rpm`) and signs; `packages.yml` installs and updates them. ⚠️ A version branch (`dev/x.y.z`) reaches `main` by a merge commit, never a squash: the release notes read what the merge brings. → "Releasing", `docs/releasing.md`. +- Release is a `workflow_dispatch` after a version bump; the version is `[workspace.package] version` in `Cargo.toml` alone (D27), so a bump touches `Cargo.toml` and `Cargo.lock` (`cargo update --workspace`); `scripts/version.mjs` refuses a release where they disagree. `release.yml` builds, packages (`cargo-packager`: NSIS, AppImage, deb, dmg; rpm by `cargo-generate-rpm`) and signs; `packages.yml` installs and updates them. ⚠️ A version branch (`dev/x.y.z`) reaches `main` by a merge commit, never a squash: the release notes read what the merge brings. → "Releasing", `docs/releasing.md`. ## Things that will bite you diff --git a/README.md b/README.md index f0ef3df17..5c865690e 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Everything local, everything behind one passphrase. [![Latest release](https://img.shields.io/github/v/release/vmillet-dev/devnotes-rs?style=flat-square&color=e8a33d&label=release)](https://github.com/vmillet-dev/devnotes-rs/releases/latest) [![CI](https://img.shields.io/github/actions/workflow/status/vmillet-dev/devnotes-rs/ci.yml?branch=main&style=flat-square&label=CI)](https://github.com/vmillet-dev/devnotes-rs/actions/workflows/ci.yml) -[![Platforms](https://img.shields.io/badge/platform-Windows%20%7C%20Linux-5b6b8c?style=flat-square)](#install) +[![Platforms](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-5b6b8c?style=flat-square)](#install) [![License: GPL-3.0](https://img.shields.io/badge/license-GPL--3.0-5b6b8c?style=flat-square)](LICENSE) [**Download**](https://github.com/vmillet-dev/devnotes-rs/releases/latest) · [Notes](#notes-and-snippets) · [Tools](#tools) · [API client](#api-client) · [Code quality](#code-quality) · [Install](#install) · [Privacy](#privacy) @@ -52,7 +52,7 @@ HTTP, GraphQL and WebSocket. Collections, environments and variables, a history -**Shared by all three:** local-first and encrypted · no account, no cloud, no telemetry · keyboard first · Windows and Linux. +**Shared by all three:** local-first and encrypted · no account, no cloud, no telemetry · keyboard first · Windows, macOS and Linux. ## Code quality @@ -106,12 +106,14 @@ Several libraries, each behind its own passphrase · a daily backup restored in ## Install -DevNotes runs on **Windows** and **Linux**, as one native program: no browser engine, no runtime to install beside it. The Windows installer installs for you alone and needs no administrator rights. Take the file for your system from the [latest release](https://github.com/vmillet-dev/devnotes-rs/releases/latest): +DevNotes runs on **Windows**, **macOS** and **Linux**, as one native program: no browser engine, no runtime to install beside it. The Windows installer installs for you alone and needs no administrator rights. Take the file for your system from the [latest release](https://github.com/vmillet-dev/devnotes-rs/releases/latest): | Platform | File | Pick it if | | -------- | ------------------------------------ | ------------------------------------------------ | | Windows | `devnotes__x64-setup.exe` | you just want it installed — **the one to take** | | Windows | `devnotes--windows.exe` | you want no installer at all | +| macOS | `devnotes__aarch64.dmg` | a Mac with an Apple chip (M1 and later) | +| macOS | `devnotes__x64.dmg` | a Mac with an Intel processor | | Linux | `devnotes__x86_64.AppImage` | any distribution, nothing to install | | Linux | `devnotes__amd64.deb` | Debian, Ubuntu and derivatives | | Linux | `devnotes-.x86_64.rpm` | Fedora, RHEL and derivatives | @@ -128,16 +130,16 @@ sudo dnf install ./devnotes-*.x86_64.rpm # Fedora and RHEL
-Choose **More info**, then **Run anyway**. The warning is about the publisher's identity, not the file: DevNotes has no code-signing certificate. Its updates are signed and verified before they install — the installer and the AppImage update themselves from inside the application; the `.deb` and `.rpm` are updated by your package manager — and every release publishes `SHA256SUMS.txt`. +Choose **More info**, then **Run anyway**. The warning is about the publisher's identity, not the file: DevNotes has no code-signing certificate. Its updates are signed and verified before they install — the installer, the macOS application and the AppImage update themselves from inside the application; the `.deb` and `.rpm` are updated by your package manager — and every release publishes `SHA256SUMS.txt`.
-Why there is no macOS build +macOS blocks it the first time
-It cannot be tested here, and Gatekeeper wants a paid Apple Developer account with no free way around it on recent versions. +Open **System Settings**, **Privacy & Security**, then **Open Anyway**. DevNotes has no publisher certificate, which needs a paid Apple Developer account. The macOS files come with the version after 1.1.0.
diff --git a/crates/platform/src/updater/tests.rs b/crates/platform/src/updater/tests.rs index ea699153c..28eba6b05 100644 --- a/crates/platform/src/updater/tests.rs +++ b/crates/platform/src/updater/tests.rs @@ -22,7 +22,12 @@ fn serve(version: &str, installer: &'static [u8]) -> String { "version": version, "notes": "### Added\n\n- Faster search", "pub_date": "2026-11-06T00:00:00Z", - "platforms": { "windows-x86_64": entry, "linux-x86_64": entry }, + "platforms": { + "windows-x86_64": entry, + "linux-x86_64": entry, + "macos-aarch64": entry, + "macos-x86_64": entry, + }, }) .to_string(); std::thread::spawn(move || { diff --git a/docs/architecture.md b/docs/architecture.md index fa3455c28..ee5854b5f 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -6215,9 +6215,10 @@ key can produce an installable update. It is the key the Tauri releases were sig prompt it was raised with. - **The notes the prompt shows** are the release's changelog section less what the user cannot see, carried by `latest.json` (→ "The update prompt shows the release's notes"). -- **The manifest** (`latest.json`, `scripts/latest-json.mjs`) carries the NSIS installer and the - AppImage, each with its `format` (`nsis`, `appimage`), which the client requires. Windows is the - one platform whose absence fails the release; a missing Linux artefact only warns. It is +- **The manifest** (`latest.json`, `scripts/latest-json.mjs`) carries the NSIS installer, the + AppImage and the two macOS archives, each with its `format` (`nsis`, `appimage`, `app`), which the + client requires. Windows is the one platform whose absence fails the release; another missing + only warns. It is published at `releases/latest/download/latest.json`, the endpoint compiled into the binary. - The signing key and its password are the `release` **environment**'s secrets, so no other workflow and no other branch can reach them; `packages.yml` signs with a key made for its run. @@ -6228,12 +6229,12 @@ One button: **Actions → Release → Run workflow**, with a `dry_run` checkbox, `prepare` and shows what the release would change (`scripts/release-preview.mjs`). `release.yml` carries the whole path — `prepare`, `release-build`, `publish` — and `ci.yml` is only CI. -**Two platforms, deliberately: Windows and Linux.** The release matrix builds -`windows-latest` and `ubuntu-22.04`, the CI matrix tests the same two, and that is the whole -list. macOS is out of scope and stays out: nothing here can test it, and Gatekeeper wants a -paid Apple Developer account with no free bypass on recent versions — a build that can be -neither tested nor distributed is a liability wearing the costume of a feature. The packages -therefore declare no `.icns`, and the README says which platforms it ships. +**Three platforms: Windows, Linux and macOS.** The CI matrix tests `windows-latest`, +`ubuntu-22.04` and `macos-latest`; the release builds on the same, and on an Intel runner for the +second macOS file. There is no Mac to try it by hand: what CI does not show of macOS is not known. +Its packages are signed ad hoc, by nobody, since Gatekeeper's own signature wants a paid Apple +Developer account: a person opens the first one through the system's settings. ⚠️ A macOS leg that +fails holds nothing back (`continue-on-error`): the tag is out by then. Two facts shape that, and neither is negotiable: @@ -6252,7 +6253,8 @@ the file it just wrote, and `scripts/release-notes.mjs` mirrors, in `assertRende three invariants `changelog::tests::the_shipped_file_parses_into_something_to_show` asserts. **The packages** are built by `cargo build -p app --release`, then `.github/actions/package`: -`cargo packager` (NSIS per user on Windows; AppImage and deb on Linux) and `cargo generate-rpm`, +`cargo packager` (NSIS per user on Windows; AppImage and deb on Linux; a `.dmg` and the updater's +archive on macOS) and `cargo generate-rpm`, each signed with the minisign key, each checked to hold the application alone (→ `docs/releasing.md`, "What gets published"). `packages.yml` runs the same action on a pull request that touches packaging, with a key made diff --git a/docs/content/en/faq.md b/docs/content/en/faq.md index b8b4960c7..897e9ef9e 100644 --- a/docs/content/en/faq.md +++ b/docs/content/en/faq.md @@ -8,7 +8,7 @@ Yes, and open source: it is published under the GPL-3.0 licence, its code is on ## Is there a macOS version? -Not for now. It cannot be tested here, and Gatekeeper requires a paid Apple Developer account, with no free way round it on recent versions. +Yes, from the version after 1.1.0: one file for Macs with an Apple chip, another for Intel Macs. On first launch, macOS blocks it, DevNotes having no publisher certificate: open System Settings, Privacy & Security, then Open Anyway. ## Can I sync two computers? @@ -40,7 +40,7 @@ DevNotes uses X11 whenever it is there, including XWayland. On a Wayland session ## Where are my notes? -In your profile folder: `%APPDATA%\com.devnotes.app\` on Windows, `~/.local/share/com.devnotes.app/` on Linux. The details are in [Security and backups](safety.md). +In your profile folder: `%APPDATA%\com.devnotes.app\` on Windows, `~/Library/Application Support/com.devnotes.app/` on macOS, `~/.local/share/com.devnotes.app/` on Linux. The details are in [Security and backups](safety.md). ## I found a bug, or I have an idea. diff --git a/docs/content/en/safety.md b/docs/content/en/safety.md index 01114e82d..465b4e97d 100644 --- a/docs/content/en/safety.md +++ b/docs/content/en/safety.md @@ -71,6 +71,7 @@ The database is checked at every opening. If it is damaged, DevNotes says so ins | System | Folder | | --- | --- | | Windows | `%APPDATA%\com.devnotes.app\` | +| macOS | `~/Library/Application Support/com.devnotes.app/` | | Linux | `~/.local/share/com.devnotes.app/` | Each library lives in `libraries//`: the database, `vault.json` (the key your phrase opens), the attachments and the backup copies. diff --git a/docs/content/en/start.md b/docs/content/en/start.md index 30faf27bc..cfce135fd 100644 --- a/docs/content/en/start.md +++ b/docs/content/en/start.md @@ -4,7 +4,7 @@ Installing DevNotes, choosing your library’s passphrase, and a tour of the sam ## Installing -DevNotes runs on Windows and Linux. Every file is on [the download page](https://devnotes.fr/en/download), each as a direct link: take the one that matches your system. There is no browser engine inside, so nothing else to install. +DevNotes runs on Windows, on macOS (from the version after 1.1.0) and on Linux. Every file is on [the download page](https://devnotes.fr/en/download), each as a direct link: take the one that matches your system. There is no browser engine inside, so nothing else to install. **The files of each version** @@ -12,6 +12,8 @@ DevNotes runs on Windows and Linux. Every file is on [the download page](https:/ | --- | --- | --- | | Windows | `…_x64-setup.exe` | you simply want to install it: this is the one | | Windows | `…-windows.exe` | you want nothing installed | +| macOS | `…_aarch64.dmg` | Macs with an Apple chip (M1 and later) | +| macOS | `…_x64.dmg` | Macs with an Intel processor | | Linux | `…_x86_64.AppImage` | any distribution, nothing to install | | Linux | `…_amd64.deb` | Debian, Ubuntu and derivatives | | Linux | `…x86_64.rpm` | Fedora, RHEL and derivatives | diff --git a/docs/content/fr/faq.md b/docs/content/fr/faq.md index 8083420de..98bffe8bc 100644 --- a/docs/content/fr/faq.md +++ b/docs/content/fr/faq.md @@ -8,7 +8,7 @@ Oui, et libre : il est publié sous licence GPL-3.0, son code est sur [GitHub](h ## Y a-t-il une version macOS ? -Pas pour l’instant. Elle ne peut pas être testée ici, et Gatekeeper réclame un compte Apple Developer payant, sans contournement gratuit sur les versions récentes. +Oui, à partir de la version qui suit la 1.1.0 : un fichier pour les Mac à puce Apple, un autre pour les Mac Intel. Au premier lancement, macOS le bloque, DevNotes n’ayant pas de certificat d’éditeur : ouvrez Réglages Système, Confidentialité et sécurité, puis Ouvrir quand même. ## Puis-je synchroniser deux ordinateurs ? @@ -40,7 +40,7 @@ DevNotes utilise X11 dès qu’il est là, XWayland compris. Dans une session Wa ## Où sont mes notes ? -Dans le dossier de votre profil : `%APPDATA%\com.devnotes.app\` sous Windows, `~/.local/share/com.devnotes.app/` sous Linux. Le détail est dans [Sécurité et sauvegardes](safety.md). +Dans le dossier de votre profil : `%APPDATA%\com.devnotes.app\` sous Windows, `~/Library/Application Support/com.devnotes.app/` sous macOS, `~/.local/share/com.devnotes.app/` sous Linux. Le détail est dans [Sécurité et sauvegardes](safety.md). ## J’ai trouvé un bug, ou j’ai une idée. diff --git a/docs/content/fr/safety.md b/docs/content/fr/safety.md index d719a51ca..914d4abf7 100644 --- a/docs/content/fr/safety.md +++ b/docs/content/fr/safety.md @@ -71,6 +71,7 @@ La base est vérifiée à chaque ouverture. Si elle est endommagée, DevNotes le | Système | Dossier | | --- | --- | | Windows | `%APPDATA%\com.devnotes.app\` | +| macOS | `~/Library/Application Support/com.devnotes.app/` | | Linux | `~/.local/share/com.devnotes.app/` | Chaque bibliothèque vit dans `libraries//` : la base, `vault.json` (la clé que votre phrase ouvre), les pièces jointes et les copies de sauvegarde. diff --git a/docs/content/fr/start.md b/docs/content/fr/start.md index 2ecfdd2b0..0d8b2091b 100644 --- a/docs/content/fr/start.md +++ b/docs/content/fr/start.md @@ -4,7 +4,7 @@ Installer DevNotes, choisir la phrase de passe de votre bibliothèque, et faire ## Installer -DevNotes fonctionne sous Windows et sous Linux. Tous les fichiers sont sur [la page de téléchargement](https://devnotes.fr/telecharger), chacun en lien direct : prenez celui qui correspond à votre système. Il n’y a aucun moteur de navigateur à l’intérieur, donc rien d’autre à installer. +DevNotes fonctionne sous Windows, sous macOS (à partir de la version qui suit la 1.1.0) et sous Linux. Tous les fichiers sont sur [la page de téléchargement](https://devnotes.fr/telecharger), chacun en lien direct : prenez celui qui correspond à votre système. Il n’y a aucun moteur de navigateur à l’intérieur, donc rien d’autre à installer. **Les fichiers de chaque version** @@ -12,6 +12,8 @@ DevNotes fonctionne sous Windows et sous Linux. Tous les fichiers sont sur [la p | --- | --- | --- | | Windows | `…_x64-setup.exe` | vous voulez simplement l’installer : c’est celui-là | | Windows | `…-windows.exe` | vous ne voulez aucune installation | +| macOS | `…_aarch64.dmg` | Mac à puce Apple (M1 et suivantes) | +| macOS | `…_x64.dmg` | Mac à processeur Intel | | Linux | `…_x86_64.AppImage` | toutes les distributions, rien à installer | | Linux | `…_amd64.deb` | Debian, Ubuntu et dérivées | | Linux | `…x86_64.rpm` | Fedora, RHEL et dérivées | diff --git a/docs/releasing.md b/docs/releasing.md index a7d042ad5..6c0fcdaea 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -123,6 +123,10 @@ what the build left in `target/release`. Its configuration is `[package.metadata - **Linux** — the AppImage (`devnotes__x86_64.AppImage`), the `.deb` (by `cargo-packager`), the `.rpm` (by `cargo-generate-rpm`, `[package.metadata.generate-rpm]`), and the standalone binary (`devnotes--linux`). +- **macOS** — one `.dmg` per architecture (`devnotes__aarch64.dmg` for Apple Silicon, + `devnotes__x64.dmg` for Intel), and the archive the updater installs beside each + (`….app.tar.gz`). Signed ad hoc. A macOS build that fails leaves the release without its files, + and the site without its offer, and holds nothing else back. Plus `SHA256SUMS.txt` over all of them, and `latest.json` — the manifest the in-app updater reads, written by `scripts/latest-json.mjs`. Neither package needs WebView2 or WebKitGTK any diff --git a/website/src/app/core/release.ts b/website/src/app/core/release.ts index 571dc3390..8c59485a7 100644 --- a/website/src/app/core/release.ts +++ b/website/src/app/core/release.ts @@ -11,7 +11,7 @@ export const VERSION = RELEASE.version; const FILES = `${REPOSITORY}/releases/download/v${VERSION}`; -export type System = 'windows' | 'linux'; +export type System = 'windows' | 'macos' | 'linux'; export interface ReleaseFile { readonly name: string; @@ -48,9 +48,35 @@ const file = (lang: Lang, name: string, fileName: string, who: string): ReleaseF sha256: KNOWN[fileName]?.sha256 ?? '', }); +const APPLE_SILICON = `devnotes_${VERSION}_aarch64.dmg`; +const INTEL = `devnotes_${VERSION}_x64.dmg`; + +/** The first releases had no macOS files, and a release whose macOS build failed has none either. */ +const HAS_MACOS = APPLE_SILICON in KNOWN && INTEL in KNOWN; + +/** The systems the release is for, as a sentence names them. */ +export function systems(lang: Lang): string { + const and = lang === 'fr' ? 'et' : 'and'; + return HAS_MACOS ? `Windows, macOS ${and} Linux` : `Windows ${and} Linux`; +} + /** One format put forward per system, the others offered beside it. Named as `release.yml` writes them. */ export function offers(lang: Lang): readonly Offer[] { const fr = lang === 'fr'; + const macos: Offer = { + system: 'macos', + label: 'macOS', + action: fr ? 'Télécharger pour Apple Silicon' : 'Download for Apple Silicon', + primary: file( + lang, + 'Apple Silicon', + APPLE_SILICON, + fr ? 'Les Mac à puce Apple (M1 et suivantes).' : 'Macs with an Apple chip (M1 and later).', + ), + others: [ + file(lang, 'Intel', INTEL, fr ? 'Les Mac à processeur Intel.' : 'Macs with an Intel processor.'), + ], + }; return [ { system: 'windows', @@ -73,6 +99,7 @@ export function offers(lang: Lang): readonly Offer[] { ), ], }, + ...(HAS_MACOS ? [macos] : []), { system: 'linux', label: 'Linux', @@ -110,7 +137,11 @@ export function offers(lang: Lang): readonly Offer[] { /** The visitor's system, from what the browser says of itself; Windows when it says nothing. */ export function visitorSystem(): System { const agent = navigator.userAgent; - return /linux|x11/i.test(`${navigator.platform} ${agent}`) && !/android/i.test(agent) ? 'linux' : 'windows'; + const said = `${navigator.platform} ${agent}`; + if (HAS_MACOS && /mac/i.test(said) && !/iphone|ipad|ipod/i.test(agent)) { + return 'macos'; + } + return /linux|x11/i.test(said) && !/android/i.test(agent) ? 'linux' : 'windows'; } /** The checksums of every file of the release, to check a download against. */ diff --git a/website/src/app/download/download-page.html b/website/src/app/download/download-page.html index 2cd74654c..a4ae9e49f 100644 --- a/website/src/app/download/download-page.html +++ b/website/src/app/download/download-page.html @@ -30,7 +30,7 @@

{{ offer.label }}

}

{{ offer.primary.who }}

-

{{ offer.system === 'windows' ? text().unsigned : text().executable }}

+

{{ headsUp(offer.system) }}

{{ text().others }}

    @for (other of offer.others; track other.file) { @@ -48,7 +48,6 @@

    {{ text().others }}

    {{ text().notes }} -

    {{ text().mac }}

    @@ -58,6 +57,12 @@

    {{ text().install }}

    {{ text().onWindows }}

    {{ text().windows }}

    + @if (hasMacos) { +
    +

    {{ text().onMacos }}

    +

    {{ text().macos }}

    +
    + }

    {{ text().onLinux }}

    {{ text().linux }}

    diff --git a/website/src/app/download/download-page.ts b/website/src/app/download/download-page.ts index 859395df3..28aa71ec8 100644 --- a/website/src/app/download/download-page.ts +++ b/website/src/app/download/download-page.ts @@ -3,7 +3,7 @@ import { RouterLink } from '@angular/router'; import { Lang, downloadPath } from '../core/lang'; import { Language } from '../core/language'; -import { CHECKSUMS, RELEASE_PAGE, System, VERSION, offers, visitorSystem } from '../core/release'; +import { CHECKSUMS, RELEASE_PAGE, System, VERSION, offers, systems, visitorSystem } from '../core/release'; import { Seo } from '../core/seo'; import { CHANGELOG } from '../core/site'; import { DocBlocks } from '../docs/doc-blocks'; @@ -20,11 +20,11 @@ const CHECK_COMMANDS = `sha256sum -c SHA256SUMS.txt --ignore-missing # Linux Get-FileHash .\\devnotes_*_x64-setup.exe # Windows, PowerShell`; const FR = { - title: `Télécharger DevNotes ${VERSION} pour Windows et Linux`, - description: `DevNotes ${VERSION} pour Windows et Linux : l'installateur, l'AppImage, les paquets .deb et .rpm, et les exécutables autonomes. Gratuit et libre.`, + title: `Télécharger DevNotes ${VERSION} pour ${systems('fr')}`, + description: `DevNotes ${VERSION} pour ${systems('fr')} : l'installateur, l'AppImage, les paquets .deb et .rpm, et les exécutables autonomes. Gratuit et libre.`, label: 'Télécharger', heading: 'Télécharger DevNotes', - lede: `La version ${VERSION}, pour Windows et Linux. Gratuite et libre, sans compte : tout reste sur votre machine.`, + lede: `La version ${VERSION}, pour ${systems('fr')}. Gratuite et libre, sans compte : tout reste sur votre machine.`, phone: "DevNotes s'installe sur un ordinateur. Ouvrez cette page depuis votre poste pour le télécharger.", systems: 'Les fichiers, par système', yours: 'Votre système', @@ -34,11 +34,15 @@ const FR = { executable: 'Rendez-la exécutable avec chmod +x, puis lancez-la.', others: 'Autres formats', notes: `Notes de la version ${VERSION}`, - mac: "Pas de version macOS pour l'instant : elle ne peut pas être testée ici, et Gatekeeper réclame un compte Apple Developer payant.", + opening: + 'Au premier lancement, macOS le bloque : ouvrez Réglages Système, Confidentialité et sécurité, puis Ouvrir quand même.', install: 'Installer', onWindows: 'Sous Windows', windows: "Lancez l'installateur : il s'installe pour votre compte, sans droits d'administrateur. L'avertissement de SmartScreen porte sur l'éditeur, DevNotes n'ayant pas de certificat de signature de code, pas sur le fichier : son empreinte est plus bas.", + onMacos: 'Sous macOS', + macos: + "Ouvrez l'image et glissez DevNotes dans Applications. Au premier lancement, macOS le bloque, DevNotes n'ayant pas de certificat d'éditeur : ouvrez Réglages Système, Confidentialité et sécurité, puis Ouvrir quand même.", onLinux: 'Sous Linux', linux: "Une AppImage se rend exécutable puis se lance ; un paquet s'installe avec le gestionnaire de la distribution.", @@ -60,11 +64,11 @@ const FR = { }; const EN: typeof FR = { - title: `Download DevNotes ${VERSION} for Windows and Linux`, - description: `DevNotes ${VERSION} for Windows and Linux: the installer, the AppImage, the .deb and .rpm packages, and the standalone executables. Free and open source.`, + title: `Download DevNotes ${VERSION} for ${systems('en')}`, + description: `DevNotes ${VERSION} for ${systems('en')}: the installer, the AppImage, the .deb and .rpm packages, and the standalone executables. Free and open source.`, label: 'Download', heading: 'Download DevNotes', - lede: `Version ${VERSION}, for Windows and Linux. Free and open source, no account: everything stays on your machine.`, + lede: `Version ${VERSION}, for ${systems('en')}. Free and open source, no account: everything stays on your machine.`, phone: 'DevNotes installs on a computer. Open this page from your desktop to download it.', systems: 'The files, by system', yours: 'Your system', @@ -74,11 +78,14 @@ const EN: typeof FR = { executable: 'Make it executable with chmod +x, then run it.', others: 'Other formats', notes: `Release notes for ${VERSION}`, - mac: 'No macOS version for now: it cannot be tested here, and Gatekeeper requires a paid Apple Developer account.', + opening: 'On first launch, macOS blocks it: open System Settings, Privacy & Security, then Open Anyway.', install: 'Installing', onWindows: 'On Windows', windows: "Run the installer: it installs for your account, without administrator rights. SmartScreen's warning is about the publisher, DevNotes having no code signing certificate, not about the file: its fingerprint is below.", + onMacos: 'On macOS', + macos: + 'Open the image and drag DevNotes to Applications. On first launch, macOS blocks it, DevNotes having no publisher certificate: open System Settings, Privacy & Security, then Open Anyway.', onLinux: 'On Linux', linux: "An AppImage is made executable then run; a package installs with the distribution's package manager.", @@ -116,6 +123,7 @@ export class DownloadPage { protected readonly files = computed(() => this.offers().flatMap((offer) => [offer.primary, ...offer.others]), ); + protected readonly hasMacos = this.offers().some(({ system }) => system === 'macos'); protected readonly startPath = computed(() => docPath('start', this.lang())); protected readonly linuxInstall = computed(() => [shell(this.text().linuxTitle, LINUX_COMMANDS)]); protected readonly check = computed(() => [shell(this.text().checkTitle, CHECK_COMMANDS)]); @@ -128,6 +136,12 @@ export class DownloadPage { /** A phone cannot run it: say so rather than offer a file it cannot open. */ protected readonly onPhone = signal(false); + /** What the first launch asks. */ + protected headsUp(system: System): string { + const { unsigned, opening, executable } = this.text(); + return { windows: unsigned, macos: opening, linux: executable }[system]; + } + constructor() { const lang = this.lang(); const text = TEXT[lang]; diff --git a/website/src/app/home/home-page.ts b/website/src/app/home/home-page.ts index 08b546495..df2c2adc8 100644 --- a/website/src/app/home/home-page.ts +++ b/website/src/app/home/home-page.ts @@ -14,7 +14,7 @@ import { clamp, field } from '../core/browser'; import { Lang, downloadPath, homePath } from '../core/lang'; import { Language } from '../core/language'; import { PageProgress, ProgressSegment } from '../core/page-progress'; -import { System, VERSION, offers, visitorSystem } from '../core/release'; +import { System, VERSION, offers, systems, visitorSystem } from '../core/release'; import { ScrollFrame } from '../core/scroll-frame'; import { Seo } from '../core/seo'; import { REPOSITORY, absolute } from '../core/site'; @@ -98,7 +98,7 @@ const FR = { sections: ['Snippets', 'Ranger', 'Code', 'Outils', 'Client API', 'Chiffrement', 'Et aussi'], closing: 'Vos snippets, rangés et à portée de raccourci.', closingLede: (version: string) => - `DevNotes ${version}, pour Windows et Linux. Gratuit, libre, et rien ne quitte votre machine.`, + `DevNotes ${version}, pour ${systems('fr')}. Gratuit, libre, et rien ne quitte votre machine.`, closingDownload: 'Télécharger DevNotes', }; @@ -170,7 +170,7 @@ const EN: typeof FR = { sections: ['Snippets', 'Organise', 'Code', 'Tools', 'API client', 'Encryption', 'And more'], closing: 'Your snippets, filed and one shortcut away.', closingLede: (version: string) => - `DevNotes ${version}, for Windows and Linux. Free, open source, and nothing leaves your machine.`, + `DevNotes ${version}, for ${systems('en')}. Free, open source, and nothing leaves your machine.`, closingDownload: 'Download DevNotes', }; @@ -240,7 +240,9 @@ export class HomePage { '@type': 'SoftwareApplication', name: 'DevNotes', applicationCategory: 'DeveloperApplication', - operatingSystem: 'Windows, Linux', + operatingSystem: offers(lang) + .map(({ label }) => label) + .join(', '), softwareVersion: VERSION, url: absolute(homePath(lang)), downloadUrl: absolute(downloadPath(lang)), From 6231ef8ec80febae430855aae32fea7fda9d9c7c Mon Sep 17 00:00:00 2001 From: Valentin Millet Date: Wed, 25 Nov 2026 16:15:40 +0100 Subject: [PATCH 4/9] macOS: the download page's method after its constructor --- website/src/app/download/download-page.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/website/src/app/download/download-page.ts b/website/src/app/download/download-page.ts index 28aa71ec8..4d481ebea 100644 --- a/website/src/app/download/download-page.ts +++ b/website/src/app/download/download-page.ts @@ -136,12 +136,6 @@ export class DownloadPage { /** A phone cannot run it: say so rather than offer a file it cannot open. */ protected readonly onPhone = signal(false); - /** What the first launch asks. */ - protected headsUp(system: System): string { - const { unsigned, opening, executable } = this.text(); - return { windows: unsigned, macos: opening, linux: executable }[system]; - } - constructor() { const lang = this.lang(); const text = TEXT[lang]; @@ -156,4 +150,10 @@ export class DownloadPage { this.onPhone.set(/Android|iPhone|iPad|iPod/i.test(navigator.userAgent)); }); } + + /** What the first launch asks. */ + protected headsUp(system: System): string { + const { unsigned, opening, executable } = this.text(); + return { windows: unsigned, macos: opening, linux: executable }[system]; + } } From 97b96307dd905b1b754ee3da800277d1f22ddd37 Mon Sep 17 00:00:00 2001 From: Valentin Millet Date: Wed, 25 Nov 2026 18:25:21 +0100 Subject: [PATCH 5/9] macOS: the passphrase scenario closes the report; the summary reads on BSD awk --- .github/workflows/ci.yml | 2 +- e2e/tests/16_passphrase_change.rs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49c39a2b1..93233f532 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -366,7 +366,7 @@ jobs: for (i = 1; i <= n; i++) { k = order[i] sub(/\.$/, "", result[k]) - printf "| `%s` | %d | %s | %s |\n", k, steps[k], result[k] == "" ? "not run" : result[k], time[k] + printf "| `%s` | %d | %s | %s |\n", k, steps[k], (result[k] == "" ? "not run" : result[k]), time[k] } }' } >> "$GITHUB_STEP_SUMMARY" diff --git a/e2e/tests/16_passphrase_change.rs b/e2e/tests/16_passphrase_change.rs index 8fe94d712..dc4a70fd7 100644 --- a/e2e/tests/16_passphrase_change.rs +++ b/e2e/tests/16_passphrase_change.rs @@ -73,7 +73,10 @@ fn passphrase_change() { }); fill_change(&mut app, PASSPHRASE); app.eventually("the dialog closed", |tree| !tree.has("change-passphrase")); + // It stands over the dialog's buttons in a small window. app.wait_for("status-toast"); + app.click("status-dismiss"); + app.eventually("the report is dismissed", |tree| !tree.has("status-toast")); assert_ne!(std::fs::read(&file).unwrap(), first); app.click("settings-close"); app.eventually("the panel closed", |tree| !tree.has("settings-dialog")); From 32e2f06533c259d89f5de3b0efcfe728752f897e Mon Sep 17 00:00:00 2001 From: Valentin Millet Date: Wed, 25 Nov 2026 20:24:32 +0100 Subject: [PATCH 6/9] macOS: a larger screen for the scenarios, the window's tests, the version line --- .github/scripts/largest-screen.swift | 23 +++++++++++++++++++++++ .github/workflows/ci.yml | 4 ++++ .github/workflows/packages.yml | 4 ++-- crates/ui/src/app/palette_copy_tests.rs | 8 ++++---- crates/ui/src/app/window_tests.rs | 9 +++++---- crates/ui/src/state/mod.rs | 10 +++++++--- 6 files changed, 45 insertions(+), 13 deletions(-) create mode 100644 .github/scripts/largest-screen.swift diff --git a/.github/scripts/largest-screen.swift b/.github/scripts/largest-screen.swift new file mode 100644 index 000000000..e0712668d --- /dev/null +++ b/.github/scripts/largest-screen.swift @@ -0,0 +1,23 @@ +// A macOS runner's screen is smaller than the window the scenarios resize, and AppKit keeps a +// window inside its screen: the largest mode the display offers, for the session. +import CoreGraphics + +let display = CGMainDisplayID() +let options = [kCGDisplayShowDuplicateLowResolutionModes: kCFBooleanTrue] as CFDictionary +let modes = CGDisplayCopyAllDisplayModes(display, options) as? [CGDisplayMode] ?? [] +for mode in modes { + print("\(mode.width)x\(mode.height), drawn at \(mode.pixelWidth)x\(mode.pixelHeight)") +} + +func area(_ mode: CGDisplayMode) -> Int { mode.width * mode.height } +guard let largest = modes.max(by: { area($0) < area($1) }) else { + fatalError("the display names no mode") +} + +// `CGDisplaySetDisplayMode` would last as long as this script. +var configuration: CGDisplayConfigRef? +CGBeginDisplayConfiguration(&configuration) +CGConfigureDisplayWithDisplayMode(configuration, display, largest, nil) +let result = CGCompleteDisplayConfiguration(configuration, .forSession) +print("taken: \(largest.width)x\(largest.height), \(result == .success ? "done" : "refused")") +print("now: \(CGDisplayBounds(display).size)") diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 93233f532..021d7774f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -333,6 +333,10 @@ jobs: if: runner.os == 'Linux' run: sudo apt-get install -y --no-install-recommends xvfb + - name: A screen larger than the window + if: runner.os == 'macOS' + run: swift .github/scripts/largest-screen.swift + - name: Build the flavour run: cargo build -p app --features e2e --locked diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index 395406212..3597e1a6c 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -77,7 +77,7 @@ jobs: # The one line of `[workspace.package]` that starts with `version`; Cargo.lock follows. - name: Version 1.0.0 - run: sed -i 's/^version = ".*"/version = "1.0.0"/' Cargo.toml && cargo metadata --format-version 1 > /dev/null + run: perl -pi -e 's/^version = ".*"/version = "1.0.0"/' Cargo.toml && cargo metadata --format-version 1 > /dev/null - uses: ./.github/actions/package with: @@ -86,7 +86,7 @@ jobs: out: old - name: Version 1.0.1 - run: sed -i 's/^version = ".*"/version = "1.0.1"/' Cargo.toml && cargo metadata --format-version 1 > /dev/null + run: perl -pi -e 's/^version = ".*"/version = "1.0.1"/' Cargo.toml && cargo metadata --format-version 1 > /dev/null - uses: ./.github/actions/package with: diff --git a/crates/ui/src/app/palette_copy_tests.rs b/crates/ui/src/app/palette_copy_tests.rs index 6468da53a..971b74fba 100644 --- a/crates/ui/src/app/palette_copy_tests.rs +++ b/crates/ui/src/app/palette_copy_tests.rs @@ -2,11 +2,11 @@ use std::sync::{Arc, Mutex}; -use egui::ViewportCommand as Command; use egui_kittest::Harness; use super::DevNotesApp; use super::tests::{commands, open_library, settle}; +use crate::state::out_of_sight; #[derive(Default)] struct Toasts(Mutex>); @@ -42,7 +42,7 @@ fn over_another_application_the_window_goes_and_a_toast_says_it() { let toasts = copied_from_the_palette(&mut harness, true); - assert!(commands(&harness).contains(&Command::Visible(false))); + assert!(commands(&harness).contains(&out_of_sight())); settle(&mut harness); assert_eq!(toasts.0.lock().unwrap().len(), 1); let state = harness.state().state(); @@ -57,7 +57,7 @@ fn with_devnotes_in_front_it_only_closes_and_says_so_in_the_window() { let toasts = copied_from_the_palette(&mut harness, false); - assert!(!commands(&harness).contains(&Command::Visible(false))); + assert!(!commands(&harness).contains(&out_of_sight())); settle(&mut harness); assert!(toasts.0.lock().unwrap().is_empty()); assert!(harness.state().state().status.latest().is_some()); @@ -71,7 +71,7 @@ fn with_the_confirmation_off_the_window_goes_without_a_word() { let toasts = copied_from_the_palette(&mut harness, true); - assert!(commands(&harness).contains(&Command::Visible(false))); + assert!(commands(&harness).contains(&out_of_sight())); settle(&mut harness); assert!(toasts.0.lock().unwrap().is_empty()); } diff --git a/crates/ui/src/app/window_tests.rs b/crates/ui/src/app/window_tests.rs index a2dc05e81..3fb3bf5a7 100644 --- a/crates/ui/src/app/window_tests.rs +++ b/crates/ui/src/app/window_tests.rs @@ -8,6 +8,7 @@ use super::DevNotesApp; use super::tests::{commands, startup, with_a_tray}; use crate::action::{Action, GlobalAction}; use crate::inputs::Input; +use crate::state::out_of_sight; fn press_the_close_button(harness: &mut Harness<'_, DevNotesApp>) { viewport(harness).events.push(ViewportEvent::Close); @@ -23,7 +24,7 @@ fn viewport<'a>(harness: &'a mut Harness<'_, DevNotesApp>) -> &'a mut ViewportIn } fn hidden_and_held(commands: &[Command]) -> bool { - commands.contains(&Command::Visible(false)) && commands.contains(&Command::CancelClose) + commands.contains(&out_of_sight()) && commands.contains(&Command::CancelClose) } #[test] @@ -96,12 +97,12 @@ fn minimised_with_the_preference_on_the_window_goes_to_the_tray_once() { viewport(&mut harness).minimized = Some(true); harness.step(); - assert!(commands(&harness).contains(&Command::Visible(false))); + assert!(commands(&harness).contains(&out_of_sight())); // Still minimised for a frame while it comes back: it must not go away again. viewport(&mut harness).minimized = Some(true); harness.step(); - assert!(!commands(&harness).contains(&Command::Visible(false))); + assert!(!commands(&harness).contains(&out_of_sight())); } #[test] @@ -112,7 +113,7 @@ fn minimised_with_the_preference_off_the_window_stays_in_the_taskbar() { viewport(&mut harness).minimized = Some(true); harness.step(); - assert!(!commands(&harness).contains(&Command::Visible(false))); + assert!(!commands(&harness).contains(&out_of_sight())); } #[test] diff --git a/crates/ui/src/state/mod.rs b/crates/ui/src/state/mod.rs index db4bbed2e..de83d0ffd 100644 --- a/crates/ui/src/state/mod.rs +++ b/crates/ui/src/state/mod.rs @@ -197,13 +197,17 @@ pub struct AppState { pub reduced_motion: bool, } -/// Out of sight, for the tray, a key or the Dock to call back: minimised where nothing hides it. pub(crate) fn put_away(ctx: &egui::Context) { - ctx.send_viewport_cmd(if platform::window::can_hide() { + ctx.send_viewport_cmd(out_of_sight()); +} + +/// For the tray, a key or the Dock to call back: minimised where nothing hides it. +pub(crate) fn out_of_sight() -> egui::ViewportCommand { + if platform::window::can_hide() { egui::ViewportCommand::Visible(false) } else { egui::ViewportCommand::Minimized(true) - }); + } } impl AppState { From 61cac1016903d6602eecbdb6c09b9bfd408cdd0e Mon Sep 17 00:00:00 2001 From: Valentin Millet Date: Wed, 25 Nov 2026 20:42:37 +0100 Subject: [PATCH 7/9] macOS packages: the licence answered without failing the step --- .github/actions/package/action.yml | 4 ++-- .github/workflows/packages.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/package/action.yml b/.github/actions/package/action.yml index f26a82996..f88667362 100644 --- a/.github/actions/package/action.yml +++ b/.github/actions/package/action.yml @@ -92,8 +92,8 @@ runs: archive=$(ls "$packages"/*.app.tar.gz) check archive "$(tar -tzf "$archive" | grep '/Contents/MacOS/[^/]' | xargs -n1 basename)" devnotes mounted="$RUNNER_TEMP/dmg-check" - # The image shows the licence first. - yes | PAGER=cat hdiutil attach -nobrowse -readonly -mountpoint "$mounted" "$(ls "$packages"/*.dmg)" > /dev/null + # The image shows the licence first; `yes` ends on a closed pipe. + { yes 2> /dev/null || true; } | PAGER=cat hdiutil attach -nobrowse -readonly -mountpoint "$mounted" "$(ls "$packages"/*.dmg)" > /dev/null check dmg "$(ls "$mounted/DevNotes.app/Contents/MacOS")" devnotes hdiutil detach "$mounted" > /dev/null else diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index 3597e1a6c..63ae945d0 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -131,7 +131,7 @@ jobs: elif [ "$RUNNER_OS" = macOS ]; then # Copied from the image, as a person drags it. mkdir -p "$RUNNER_TEMP/installed" - yes | PAGER=cat hdiutil attach -nobrowse -readonly -mountpoint "$RUNNER_TEMP/image" "$(ls old/*.dmg)" > /dev/null + { yes 2> /dev/null || true; } | PAGER=cat hdiutil attach -nobrowse -readonly -mountpoint "$RUNNER_TEMP/image" "$(ls old/*.dmg)" > /dev/null ditto "$RUNNER_TEMP/image/DevNotes.app" "$RUNNER_TEMP/installed/DevNotes.app" hdiutil detach "$RUNNER_TEMP/image" > /dev/null else From ca8cac97fbfe81e148cfa64398941581ee1be775 Mon Sep 17 00:00:00 2001 From: Valentin Millet Date: Thu, 26 Nov 2026 00:49:02 +0100 Subject: [PATCH 8/9] E2E tools: the window is wide enough for every tool on a macOS screen --- e2e/tests/39_recette_tools.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e/tests/39_recette_tools.rs b/e2e/tests/39_recette_tools.rs index faf22a377..5dffe48c3 100644 --- a/e2e/tests/39_recette_tools.rs +++ b/e2e/tests/39_recette_tools.rs @@ -177,7 +177,7 @@ const CASES: &[Case] = &[ ), ]; -/// From the home, its search emptied: the window is tall enough for every tool. +/// From the home, its search emptied: the window is wide enough for every tool to be in view. fn open_tool(app: &mut App, tool: &str) { if app.has("tool-back") { app.click("tool-back"); @@ -216,7 +216,7 @@ fn the_tools(scenario: &'static str, profile: &std::path::Path) -> App { let mut app = App::launch(scenario, profile); app.create_library(); in_french(&mut app); - app.resize(1100, 1400); + app.resize(1800, 1000); app.press(Key::Num2, Modifiers::COMMAND); app.wait_for("area-tools"); app From 48baff072d18e146141e263f0603c07abd81bbc8 Mon Sep 17 00:00:00 2001 From: Valentin Millet Date: Thu, 26 Nov 2026 00:49:02 +0100 Subject: [PATCH 9/9] macOS packages: a busy image is packaged again --- .github/actions/package/action.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/actions/package/action.yml b/.github/actions/package/action.yml index f88667362..aca93b13e 100644 --- a/.github/actions/package/action.yml +++ b/.github/actions/package/action.yml @@ -44,7 +44,14 @@ runs: if [ "$RUNNER_OS" = Windows ]; then cargo packager -p app --release -f nsis -o "$packages" elif [ "$RUNNER_OS" = macOS ]; then - cargo packager -p app --release -f app,dmg -o "$packages" + # The runner's scanners can still hold the image when it is ejected: busy, free later. + for attempt in 1 2 3; do + cargo packager -p app --release -f app,dmg -o "$packages" && break + [ "$attempt" = 3 ] && exit 1 + hdiutil detach /Volumes/DevNotes -force > /dev/null 2>&1 || true + rm -rf "$packages" + sleep 15 + done # One archive an architecture in a release: the packager names it after the application alone. version=$(cargo metadata --format-version 1 --no-deps \ | jq -r '.packages[] | select(.name == "app") | .version')