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
{{ 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 }}
@@ -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')