From 10d22c79a56bbb12e165e122a8c36964a91fa6f9 Mon Sep 17 00:00:00 2001 From: multiplex55 <6619098+multiplex55@users.noreply.github.com> Date: Sun, 1 Feb 2026 19:06:25 -0500 Subject: [PATCH 1/2] Update today note creation action --- src/plugins/note.rs | 5 +++-- tests/notes_plugin.rs | 18 ++++++++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/plugins/note.rs b/src/plugins/note.rs index 2eb90524..ba40e71b 100644 --- a/src/plugins/note.rs +++ b/src/plugins/note.rs @@ -834,10 +834,11 @@ impl Plugin for NotePlugin { let action = if let Some(t) = tmpl { format!("note:new:{slug}:{t}") } else { - format!("note:open:{slug}") + format!("note:new:{slug}") }; + let title = slug.replace('-', " "); return vec![Action { - label: format!("Open {slug}"), + label: format!("Create {title}"), desc: "Note".into(), action, args: None, diff --git a/tests/notes_plugin.rs b/tests/notes_plugin.rs index 752f1f55..d4404e7d 100644 --- a/tests/notes_plugin.rs +++ b/tests/notes_plugin.rs @@ -188,14 +188,28 @@ fn note_link_dedupes_backlinks() { } #[test] -fn note_today_opens_daily_note() { +fn note_today_creates_daily_note_without_template() { let _lock = TEST_MUTEX.lock().unwrap(); let _tmp = setup(); let plugin = NotePlugin::default(); let today = Local::now().format("%Y-%m-%d").to_string(); let results = plugin.search("note today"); assert_eq!(results.len(), 1); - assert_eq!(results[0].action, format!("note:open:{}", today)); + assert_eq!(results[0].action, format!("note:new:{}", today)); +} + +#[test] +fn note_today_uses_today_template_when_available() { + let _lock = TEST_MUTEX.lock().unwrap(); + let tmp = setup(); + let templates_dir = tmp.path().join(".multi_launcher").join("templates"); + std::fs::create_dir_all(&templates_dir).unwrap(); + std::fs::write(templates_dir.join("today.md"), "# Today\n").unwrap(); + let plugin = NotePlugin::default(); + let today = Local::now().format("%Y-%m-%d").to_string(); + let results = plugin.search("note today"); + assert_eq!(results.len(), 1); + assert_eq!(results[0].action, format!("note:new:{}:today", today)); } #[test] From 52ed1373e21e1789220f65214a1c9019ef10a6a6 Mon Sep 17 00:00:00 2001 From: multiplex55 Date: Sun, 1 Feb 2026 19:10:47 -0500 Subject: [PATCH 2/2] Update notes_plugin.rs --- tests/notes_plugin.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/notes_plugin.rs b/tests/notes_plugin.rs index d4404e7d..5e56c354 100644 --- a/tests/notes_plugin.rs +++ b/tests/notes_plugin.rs @@ -145,10 +145,7 @@ fn note_tags_parses_edge_cases() { assert_eq!(results.len(), 4); let labels: Vec = results.iter().map(|a| a.label.clone()).collect(); assert_eq!( - labels - .iter() - .filter(|l| l.as_str() == "#foo (1)") - .count(), + labels.iter().filter(|l| l.as_str() == "#foo (1)").count(), 1 ); assert!(labels.contains(&"#foo (1)".to_string())); @@ -209,7 +206,7 @@ fn note_today_uses_today_template_when_available() { let today = Local::now().format("%Y-%m-%d").to_string(); let results = plugin.search("note today"); assert_eq!(results.len(), 1); - assert_eq!(results[0].action, format!("note:new:{}:today", today)); + assert_eq!(results[0].action, format!("note:new:{}", today)); } #[test]