0.1.1: device names with brackets, reopening the app

A device named like "Sen setup (CLI)" made kept-both copies unreadable:
the name was cut at the inner bracket, so tidying wrote the kept version
into a new note instead of the original. Copy names are now read by
matching brackets, and names with unpaired brackets are refused.
Opening Lune again while it runs brings its window back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-29 13:47:07 +07:00
parent 97dda528d3
commit 3f29810f96
8 changed files with 81 additions and 9 deletions

View File

@@ -94,6 +94,9 @@ pub fn connect(
if label.is_empty() {
return Err("give this Mac a name your team will see".into());
}
if !lune_core::names::label_ok(label) {
return Err(lune_core::names::LABEL_BRACKETS.into());
}
let mut config = Config::load().map_err(plain)?;
let request = match (hub_url, code) {
(Some(hub), Some(code)) if !hub.trim().is_empty() && !code.trim().is_empty() => {

View File

@@ -410,8 +410,17 @@ fn main() {
let _ = window.hide();
}
})
.run(tauri::generate_context!())
.expect("Lune couldn't start");
.build(tauri::generate_context!())
.expect("Lune couldn't start")
.run(|app, event| {
// Opening Lune again (Finder, Launchpad) while it runs in the menu bar brings its window back.
#[cfg(target_os = "macos")]
if let tauri::RunEvent::Reopen { .. } = event {
show_window(app);
}
#[cfg(not(target_os = "macos"))]
let _ = (app, event);
});
}
async fn tokio_sleep(d: Duration) {