Skip to content

Native iCloud apps for Windows and Linux, built in Rust. Notes, Reminders, Calendar, Contacts, Drive and Photos, offline and in sync with your iPhone.

CI green again: rustfmt, and calendar-edits on any weekday

Yashwanth Kamireddib07c1d9cc092
diff --git a/.uiverify/calendar-edits.mjs b/.uiverify/calendar-edits.mjs
index 3363304..c757731 100644
--- a/.uiverify/calendar-edits.mjs
+++ b/.uiverify/calendar-edits.mjs
@@ -82,6 +82,10 @@ ok(s.at(-1)?.guid === "e1" && s.at(-1)?.calendarGuid === "personal", "Calendar
// Month day shows as many lines as fit, and today has grown by the copies made above.
await page.keyboard.press("Control+2");
await page.waitForTimeout(300);
+// Back to today's week: the paste above picked a day two on, which late in the week is
+// next week, where today's Dentist isn't drawn.
+await page.getByRole("button", { name: "Today", exact: true }).click();
+await page.waitForTimeout(300);
await page.locator(".cx-block", { hasText: "Dentist" }).first().click();
await page.waitForTimeout(200);
await page.keyboard.press("Escape");
diff --git a/crates/quince-icloud/src/notes.rs b/crates/quince-icloud/src/notes.rs
index 893e8ba..c4997c0 100644
--- a/crates/quince-icloud/src/notes.rs
+++ b/crates/quince-icloud/src/notes.rs
@@ -1775,16 +1775,31 @@ mod tests {
#[test]
fn an_edit_below_the_title_line_keeps_the_title() {
let tent = "\u{1F3D5}\u{1F3D5}\n\nTent\nStove";
- assert!(title_line_unchanged(tent, "\u{1F3D5}\u{1F3D5}\n\nTent\nStove and lamp"));
- assert!(title_line_unchanged("Groceries\nMilk", "Groceries\nMilk\nEggs"));
+ assert!(title_line_unchanged(
+ tent,
+ "\u{1F3D5}\u{1F3D5}\n\nTent\nStove and lamp"
+ ));
+ assert!(title_line_unchanged(
+ "Groceries\nMilk",
+ "Groceries\nMilk\nEggs"
+ ));
assert!(title_line_unchanged("Groceries", "Groceries\nMilk"));
// The title line itself, or anything above it.
- assert!(!title_line_unchanged(tent, "\u{1F3D5}\u{1F3D5}\n\nTents\nStove"));
+ assert!(!title_line_unchanged(
+ tent,
+ "\u{1F3D5}\u{1F3D5}\n\nTents\nStove"
+ ));
assert!(!title_line_unchanged(tent, "\u{1F3D5}\n\nTent\nStove"));
assert!(!title_line_unchanged("Groceries\nMilk", "Shopping\nMilk"));
- assert!(!title_line_unchanged("Groceries\nMilk", "\nGroceries\nMilk"));
+ assert!(!title_line_unchanged(
+ "Groceries\nMilk",
+ "\nGroceries\nMilk"
+ ));
// A pasted block above the old title is a new title line.
- assert!(!title_line_unchanged("Cedar list\nplanks", "Pasted\nCedar list\nplanks"));
+ assert!(!title_line_unchanged(
+ "Cedar list\nplanks",
+ "Pasted\nCedar list\nplanks"
+ ));
// No line with words: only the same text is the same title.
assert!(title_line_unchanged("\u{FFFC}", "\u{FFFC}"));
assert!(!title_line_unchanged("\u{FFFC}", "\u{FFFC}\nhello"));
diff --git a/src-tauri/src/outbox.rs b/src-tauri/src/outbox.rs
index ff98103..8e446da 100644
--- a/src-tauri/src/outbox.rs
+++ b/src-tauri/src/outbox.rs
@@ -471,11 +471,12 @@ fn lay_note(
// The title the library holds — Apple's, as the phone set it — while the edit leaves the
// title line alone; the new first line's once it reaches it (notes.rs
// `title_line_unchanged`, the rule the send follows too, so here and the phone agree).
- let held = l.note(guid)?.map(|n| n.title).filter(|t| !t.trim().is_empty());
+ let held = l
+ .note(guid)?
+ .map(|n| n.title)
+ .filter(|t| !t.trim().is_empty());
let title = match (held, l.note_body(guid)?) {
- (Some(held), Some(before))
- if quince_icloud::notes::title_line_unchanged(&before, body) =>
- {
+ (Some(held), Some(before)) if quince_icloud::notes::title_line_unchanged(&before, body) => {
held
}
_ => derived,
@@ -2557,7 +2558,11 @@ mod tests {
assert_eq!(lib.note("N").unwrap().unwrap().title, camp);
titled(&mut lib, "N", camp, &text, 100);
replay(&mut lib, NOTES).unwrap();
- assert_eq!(lib.note("N").unwrap().unwrap().title, camp, "laid back over a pass");
+ assert_eq!(
+ lib.note("N").unwrap().unwrap().title,
+ camp,
+ "laid back over a pass"
+ );
record_note_save(&mut lib, "N", "Camping\nTent\nStove", None, None, None).unwrap();
assert_eq!(lib.note("N").unwrap().unwrap().title, "Camping");
}
@@ -2571,7 +2576,11 @@ mod tests {
titled(&mut lib, "N", "Groceries", "Groceries\nMilk", 100);
titled(&mut lib, "M", "Errands", "Errands\nBank", 200);
record_note_save(&mut lib, "M", "Errands\nBank", None, None, None).unwrap();
- assert_eq!(lib.note("M").unwrap().unwrap().modified_at, Some(200), "nothing changed, nothing moved");
+ assert_eq!(
+ lib.note("M").unwrap().unwrap().modified_at,
+ Some(200),
+ "nothing changed, nothing moved"
+ );
record_note_save(&mut lib, "N", "Groceries\nMilk\nEggs", None, None, None).unwrap();
let edited = lib.note("N").unwrap().unwrap().modified_at.unwrap();
assert!(edited > 200);
@@ -2580,7 +2589,10 @@ mod tests {
replay(&mut lib, NOTES).unwrap();
let n = lib.note("N").unwrap().unwrap();
assert_eq!(n.modified_at, Some(edited));
- assert_eq!(lib.note_body("N").unwrap().as_deref(), Some("Groceries\nMilk\nEggs"));
+ assert_eq!(
+ lib.note_body("N").unwrap().as_deref(),
+ Some("Groceries\nMilk\nEggs")
+ );
}
/// Contacts: a new card gets its id here, shows at once, and edits before it is sent stay