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.

Reminders: added in Today or Scheduled it is due today, in Flagged it is flagged, and it stays where it was typed; completed reminders beneath the open ones, latest first; grid ⋯ readable in light mode; sidebar names no longer smear while folding

Yashwanth Kamireddi5fe8cbbc0508
diff --git a/.uiverify/reminders-add-done.mjs b/.uiverify/reminders-add-done.mjs
new file mode 100644
index 0000000..1e72dae
--- /dev/null
+++ b/.uiverify/reminders-add-done.mjs
@@ -0,0 +1,43 @@
+// Added in Today it is due today and stays in Today; in Flagged it is flagged. Completed
+// reminders sit beneath the open ones, the latest first.
+import { engine } from "./engine.mjs";
+import { SERVICES, installStub, openScreen } from "./stub.mjs";
+const b = await engine.launch();
+const ctx = await b.newContext({ viewport: { width: 1200, height: 800 } });
+await ctx.addInitScript(installStub, { screen: "library", services: SERVICES, twoFactor: null, remindersFixture: true });
+await ctx.addInitScript(() => {
+ const wrap = () => { const t = window.__TAURI_INTERNALS__; if (!t || t.__rec) return; const inner = t.invoke;
+ t.invoke = async (c, a) => { if (c === "reminder_create") (window.__creates ??= []).push(a); return inner(c, a); }; t.__rec = true; };
+ wrap(); document.addEventListener("DOMContentLoaded", wrap);
+});
+const page = await ctx.newPage();
+await page.goto("http://localhost:4173", { waitUntil: "networkidle" });
+await openScreen(page, "Reminders");
+await page.locator(".rx-tile", { hasText: "Today" }).click();
+await page.waitForTimeout(300);
+let failures = 0;
+const ok = (p, m) => { console.log(`${p ? "PASS" : "FAIL"} ${m}`); if (!p) failures++; };
+const field = page.getByPlaceholder("New Reminder");
+await field.fill("Call the bank");
+await field.press("Enter");
+await page.waitForTimeout(150);
+ok((await page.getByRole("checkbox", { name: "Call the bank" }).count()) === 1, "a reminder added in Today stays in Today");
+const sent = await page.evaluate(() => window.__creates?.at(-1));
+ok(sent?.allDay === true && typeof sent?.dueAt === "number", `and is made due today ${JSON.stringify(sent)}`);
+await page.locator(".rx-tile", { hasText: "Flagged" }).click();
+await page.waitForTimeout(300);
+await field.fill("Passport");
+await field.press("Enter");
+await page.waitForTimeout(150);
+ok((await page.evaluate(() => window.__creates?.at(-1)))?.flagged === true, "a reminder added in Flagged is flagged");
+
+// Completed beneath open, latest first.
+await page.locator(".rx-list", { hasText: "Daily" }).click();
+await page.waitForTimeout(300);
+const toggle = page.getByRole("button", { name: /Show Completed|Show completed/ });
+if (await toggle.count()) { await toggle.first().click(); await page.waitForTimeout(300); }
+const states = await page.locator(".rx-row").evaluateAll((rows) => rows.map((r) => r.classList.contains("is-done")));
+const firstDone = states.indexOf(true);
+ok(firstDone === -1 || states.slice(firstDone).every(Boolean), `completed reminders sit beneath the open ones ${JSON.stringify(states)}`);
+await b.close();
+process.exitCode = failures ? 1 : 0;
diff --git a/.uiverify/stub.mjs b/.uiverify/stub.mjs
index 021c667..572efe9 100644
--- a/.uiverify/stub.mjs
+++ b/.uiverify/stub.mjs
@@ -148,7 +148,12 @@ export function installStub({ screen, services, twoFactor, calendarFixture, note
case "reminder_lists": return !remindersFixture ? [] : reminderLists;
case "reminders_in": return !remindersFixture || remindersFixture === "lists" ? [] : reminderItems;
case "reminders_due_between": return calendarFixture ? dueReminders : [];
- case "reminder_create": return null;
+ case "reminder_create":
+ // Kept, as Apple keeps it, with what the view implied.
+ reminderItems.push({ guid: `made-${reminderItems.length}`, listGuid: args.listGuid, title: args.title,
+ notes: null, dueAt: args.dueAt ?? null, allDay: args.allDay ?? false, completedAt: null, priority: 0,
+ flagged: args.flagged ?? false, parentGuid: null, etag: null });
+ return null;
case "reminder_delete": return null;
case "reminder_set_done": return null;
case "reminder_set_repeat": return null;
diff --git a/check.sh b/check.sh
index a877e71..67ec7fd 100755
--- a/check.sh
+++ b/check.sh
@@ -61,6 +61,7 @@ step "list info" node .uiverify/reminders-list-info.mjs
step "reminder date" node .uiverify/reminders-date.mjs
step "contacts order" node .uiverify/contacts-order.mjs
step "calendar alerts" node .uiverify/calendar-alerts.mjs
+step "reminder add/done" node .uiverify/reminders-add-done.mjs
# The same screens in WebKit, the engine Quince draws in. Chromium above catches most things;
# this catches what only WebKit does — pointer capture, blur on removal, its own layout.
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index 38566a0..069bc2f 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -758,13 +758,36 @@ async fn reminders_due_between(
async fn reminder_create(
list_guid: String,
title: String,
+ // What the view it was typed into implies, as on the phone: added in Today it is due
+ // today, in Flagged it is flagged. Without it the new reminder belonged to neither, and
+ // vanished from the view it was typed into the moment it was made.
+ due_at: Option<i64>,
+ all_day: Option<bool>,
+ flagged: Option<bool>,
auth: State<'_, Auth>,
data: State<'_, Data>,
) -> UiResult<()> {
let (http, root, params) = cloudkit_context(&auth).await?;
- quince_icloud::reminders::create_cloudkit(&http, &root, params.clone(), &list_guid, &title)
+ let guid = quince_icloud::reminders::create_cloudkit(&http, &root, params.clone(), &list_guid, &title)
.await
.map_err(|e| e.to_string())?;
+ if due_at.is_some() || flagged.is_some() {
+ let made = quince_core::reminders::Reminder {
+ guid,
+ list_guid: list_guid.clone(),
+ title: title.clone(),
+ ..Default::default()
+ };
+ let edit = quince_icloud::reminders::ReminderEdit {
+ due_at: due_at.map(Some),
+ all_day,
+ flagged,
+ ..Default::default()
+ };
+ quince_icloud::reminders::edit_cloudkit(&http, &root, params.clone(), &made, &edit)
+ .await
+ .map_err(|e| e.to_string())?;
+ }
refresh_reminders(&http, &root, params, &data, false).await
}
diff --git a/src/lib/ipc.ts b/src/lib/ipc.ts
index fe1844a..c3d2397 100644
--- a/src/lib/ipc.ts
+++ b/src/lib/ipc.ts
@@ -111,8 +111,11 @@ export const api = {
remindersSearch: (query: string) => invoke<Reminder[]>("reminders_search", { query }),
remindersSmart: (kind: SmartList, until: number) =>
invoke<Reminder[]>("reminders_smart", { kind, until }),
- reminderCreate: (listGuid: string, title: string) =>
- invoke<void>("reminder_create", { listGuid, title }),
+ reminderCreate: (
+ listGuid: string,
+ title: string,
+ implied: { dueAt?: number; allDay?: boolean; flagged?: boolean } = {},
+ ) => invoke<void>("reminder_create", { listGuid, title, ...implied }),
reminderDelete: (guid: string, listGuid: string) =>
invoke<void>("reminder_delete", { guid, listGuid }),
diff --git a/src/screens/RemindersView.tsx b/src/screens/RemindersView.tsx
index 73b8fa4..bc2c2bf 100644
--- a/src/screens/RemindersView.tsx
+++ b/src/screens/RemindersView.tsx
@@ -498,20 +498,34 @@ export function RemindersView() {
if (!title || !targetListGuid) return;
setSyncing(true);
setError(null);
+ // What the view implies, as on the phone: typed into Today or Scheduled it is due today,
+ // into Flagged it is flagged — so it stays where it was typed, rather than vanishing.
+ const kind = selection.type === "smart" ? selection.kind : null;
+ const today = new Date();
+ const pad2 = (n: number) => String(n).padStart(2, "0");
+ const todayKey = `${today.getFullYear()}-${pad2(today.getMonth() + 1)}-${pad2(today.getDate())}`;
+ const implied =
+ kind === "today" || kind === "scheduled"
+ ? { dueAt: dayToUtc(todayKey), allDay: true }
+ : kind === "flagged"
+ ? { flagged: true }
+ : {};
// The row is there the moment Return is pressed, and the field is ready for the next.
const standIn = `pending:${Date.now()}`;
setDraft("");
- // Only in the list it goes to: an undated reminder would not stay in Today or Scheduled.
- if (inList) setItems((rows) => [
+ const shownHere = inList || kind === "today" || kind === "scheduled" || kind === "flagged" || kind === "all";
+ if (shownHere) setItems((rows) => [
...rows,
{
- guid: standIn, listGuid: targetListGuid, title, notes: null, dueAt: null,
- completedAt: null, priority: 0, flagged: false, parentGuid: null,
+ guid: standIn, listGuid: targetListGuid, title, notes: null,
+ dueAt: implied.dueAt !== undefined ? dayToLocal(implied.dueAt) : null,
+ allDay: implied.allDay ?? false,
+ completedAt: null, priority: 0, flagged: implied.flagged ?? false, parentGuid: null,
recurFrequency: null, recurInterval: null, etag: null,
} as Reminder,
]);
try {
- await api.reminderCreate(targetListGuid, title);
+ await api.reminderCreate(targetListGuid, title, implied);
await readItems();
} catch (err) {
setItems((rows) => rows.filter((r) => r.guid !== standIn));
@@ -560,7 +574,14 @@ export function RemindersView() {
}
const known = new Set(items.map((r) => r.guid));
const out: { reminder: Reminder; depth: number }[] = [];
- for (const r of items) {
+ // Open reminders first, in their list's own order; completed ones beneath them, the most
+ // recently completed first, as Reminders shows them. In the list's stored order they came
+ // out scattered among the open ones, in no order a person could follow.
+ const open = items.filter((r) => !r.completedAt);
+ const done = items
+ .filter((r) => r.completedAt)
+ .sort((a, b) => (b.completedAt ?? 0) - (a.completedAt ?? 0));
+ for (const r of [...open, ...done]) {
// A subtask whose parent is not in this view — filtered out, or in another list —
// has to appear at the top level rather than vanish.
if (r.parentGuid && known.has(r.parentGuid)) continue;
diff --git a/src/styles/app.css b/src/styles/app.css
index 2a1824b..b17d74b 100644
--- a/src/styles/app.css
+++ b/src/styles/app.css
@@ -429,7 +429,7 @@
.app-icon.ai-contacts .ai-tile-top { stop-color: #3a3a3e; }
.app-icon.ai-contacts .ai-tile-bottom { stop-color: #1c1c1f; }
}
-.nav-name { overflow: hidden; text-overflow: ellipsis; transition: opacity 160ms ease; }
+.nav-name { overflow: hidden; text-overflow: ellipsis; transition: opacity 120ms ease 140ms; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 6px; min-height: 28px; }
.sidebar-head h2 { margin: 0 8px; }
.sidebar-fold {
@@ -442,7 +442,9 @@
@media (min-width: 901px) {
.is-rail .sidebar { width: 60px; }
.is-rail .sidebar-head { flex-direction: column; }
- .is-rail .sidebar-head h2, .is-rail .nav-name { opacity: 0; width: 0; margin: 0; }
+ /* Gone at once when folding — fading while the width closed squeezed the names into a
+ smear — and back only once the sidebar has opened (the delay on .nav-name above). */
+ .is-rail .sidebar-head h2, .is-rail .nav-name { opacity: 0; width: 0; margin: 0; transition: none; }
.is-rail .nav-item { justify-content: center; gap: 0; padding-inline: 0; }
.is-rail .sidebar-foot { display: none; }
}
@@ -1774,7 +1776,9 @@
.info-mark.has-thumb img { max-width: 160px; max-height: 140px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.35); }
/* On the selection's blue an icon turns white, as Finder's do; a blue folder on blue vanished. */
.drive-rows:not(.is-grid) .drive-row.is-selected .drive-badge > svg { filter: brightness(0) invert(1); }
-.drive-row.is-selected .drive-more { color: #fff; }
+.drive-rows:not(.is-grid) .drive-row.is-selected .drive-more { color: #fff; }
+/* In Grid the ⋯ sits on its own light or dark disc, so its dots take the text colour. */
+.drive-rows.is-grid .drive-more { color: var(--text); }
/* A time typed as said: the width of "12:45 PM", right-aligned figures, as macOS's. */
.time-field { width: 8.5ch; text-align: center; font-variant-numeric: tabular-nums; }
/* The letter a run of names begins with, as Contacts heads its list. */