Checklists in the body, colour from tags, and commit-derived CalVer #4

Merged
bvandeusen merged 73 commits from dev into main 2026-08-29 13:39:45 -04:00
2 changed files with 7 additions and 7 deletions
Showing only changes of commit 32dafca148 - Show all commits
+4 -1
View File
@@ -396,7 +396,10 @@ mod tests {
assert_eq!(append_item("a note", "milk", false), "a note\n\n- [ ] milk"); assert_eq!(append_item("a note", "milk", false), "a note\n\n- [ ] milk");
// Nothing between consecutive items. // Nothing between consecutive items.
let one = "a note\n\n- [ ] milk"; let one = "a note\n\n- [ ] milk";
assert_eq!(append_item(one, "eggs", false), format!("{one}\n- [ ] eggs")); assert_eq!(
append_item(one, "eggs", false),
format!("{one}\n- [ ] eggs")
);
// A list-only note starts at the first line. // A list-only note starts at the first line.
assert_eq!(append_item("", "milk", false), "- [ ] milk"); assert_eq!(append_item("", "milk", false), "- [ ] milk");
assert_eq!(append_item("\n\n", "milk", false), "- [ ] milk"); assert_eq!(append_item("\n\n", "milk", false), "- [ ] milk");
+3 -6
View File
@@ -222,11 +222,9 @@ fn migrate_v8(conn: &Connection) -> rusqlite::Result<()> {
for (note_id, items) in grouped { for (note_id, items) in grouped {
let existing: Option<String> = conn let existing: Option<String> = conn
.query_row( .query_row("SELECT body FROM notes WHERE id = ?1", [&note_id], |r| {
"SELECT body FROM notes WHERE id = ?1", r.get(0)
[&note_id], })
|r| r.get(0),
)
.optional()?; .optional()?;
// An item whose note is already gone has nothing to fold into. The foreign key // An item whose note is already gone has nothing to fold into. The foreign key
// should make this impossible; skipping costs nothing, and failing here would // should make this impossible; skipping costs nothing, and failing here would
@@ -290,7 +288,6 @@ pub fn migrate(conn: &Connection) -> rusqlite::Result<()> {
Ok(()) Ok(())
} }
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;