Native iCloud apps for Windows and Linux, built in Rust. Notes, Reminders, Calendar, Contacts, Drive and Photos, offline and in sync with your iPhone.
Rust apple-notesapple-reminderscloudkitcrdtdesktop-appicloudicloud-calendaricloud-driveicloud-notesicloud-photosiphonelinuxlinux-desktoplocal-firstoffline-firstprivacyrusttauritauri-appwindows
Reminders: the date on one line — day, the phone's Time switch, the time — and time fields wide enough for '12:45 PM'
Yashwanth Kamireddibce60b17b6de
diff --git a/.uiverify/look-reminder.mjs b/.uiverify/look-reminder.mjsnew file mode 100644index 0000000..c9e8510--- /dev/null+++ b/.uiverify/look-reminder.mjs@@ -0,0 +1,15 @@+// Not a check: a reminder opened in its list, to look at. node look-reminder.mjs <png>+import { engine } from "./engine.mjs";+import { SERVICES, installStub, openScreen } from "./stub.mjs";+const b = await engine.launch();+const ctx = await b.newContext({ viewport: { width: 1300, height: 820 }, colorScheme: "dark" });+await ctx.addInitScript(installStub, { screen: "library", services: SERVICES, twoFactor: null, remindersFixture: true });+const p = await ctx.newPage();+await p.goto("http://localhost:4173", { waitUntil: "networkidle" });+await openScreen(p, "Reminders");+await p.locator(".rx-list", { hasText: "GYM" }).click();+await p.waitForTimeout(300);+await p.getByRole("button", { name: "Details for Evening run" }).click();+await p.waitForTimeout(300);+await p.screenshot({ path: process.argv[2] });+await b.close();diff --git a/.uiverify/reminders-date.mjs b/.uiverify/reminders-date.mjsindex 5919fe8..6900f58 100644--- a/.uiverify/reminders-date.mjs+++ b/.uiverify/reminders-date.mjs@@ -16,7 +16,7 @@ await page.getByRole("button", { name: "Details for Evening run" }).click();await page.waitForTimeout(200);const sw = page.getByRole("switch", { name: "Time for Evening run" });ok((await sw.isChecked()) && (await page.getByLabel("Time of day for Evening run").count()) === 1, "a timed reminder shows its date, the Time switch on, and its time");-await sw.click();+await page.locator(".rx-switch", { has: sw }).click();await page.waitForTimeout(200);const off = await page.evaluate(() => window.__edits?.at(-1));const utcMidnight = off && off.dueAt % 86400 === 0;diff --git a/src/screens/RemindersView.tsx b/src/screens/RemindersView.tsxindex bc2c2bf..11fa3d1 100644--- a/src/screens/RemindersView.tsx+++ b/src/screens/RemindersView.tsx@@ -1367,35 +1367,39 @@ function DueField({ reminder, onChange }: { reminder: Reminder; onChange: (day:const day = at ? `${at.getFullYear()}-${pad(at.getMonth() + 1)}-${pad(at.getDate())}` : "";const time = at && !reminder.allDay ? `${pad(at.getHours())}:${pad(at.getMinutes())}` : null;return (- <div className="rx-field rx-due">+ <div className="rx-field"><span>Date</span>- <input- type="date"- aria-label={`Date for ${reminder.title}`}- defaultValue={day}- key={`d${reminder.dueAt}`}- // A new date keeps the time already set; a first date is a day, as on the phone.- onBlur={(e) => e.target.value !== day && onChange(e.target.value, e.target.value ? time : null)}- />- <label className="rx-due-switch">+ <div className="rx-due"><input- type="checkbox"- role="switch"- aria-label={`Time for ${reminder.title}`}- checked={time !== null}- disabled={!day}- onChange={(e) => onChange(day, e.target.checked ? "09:00" : null)}- />- <span>Time</span>- </label>- {time !== null && at && (- <TimeField- label={`Time of day for ${reminder.title}`}- hours={at.getHours()}- minutes={at.getMinutes()}- onChange={(h, m) => onChange(day, `${pad(h)}:${pad(m)}`)}+ type="date"+ className="rx-due-day"+ aria-label={`Date for ${reminder.title}`}+ defaultValue={day}+ key={`d${reminder.dueAt}`}+ // A new date keeps the time already set; a first date is a day, as on the phone.+ onBlur={(e) => e.target.value !== day && onChange(e.target.value, e.target.value ? time : null)}/>- )}+ <label className="rx-switch">+ <input+ type="checkbox"+ role="switch"+ aria-label={`Time for ${reminder.title}`}+ checked={time !== null}+ disabled={!day}+ onChange={(e) => onChange(day, e.target.checked ? "09:00" : null)}+ />+ <span className="rx-switch-track" aria-hidden="true" />+ <span>Time</span>+ </label>+ {time !== null && at && (+ <TimeField+ label={`Time of day for ${reminder.title}`}+ hours={at.getHours()}+ minutes={at.getMinutes()}+ onChange={(h, m) => onChange(day, `${pad(h)}:${pad(m)}`)}+ />+ )}+ </div></div>);}diff --git a/src/styles/app.css b/src/styles/app.cssindex b17d74b..60932d6 100644--- a/src/styles/app.css+++ b/src/styles/app.css@@ -1780,7 +1780,7 @@/* 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; }+.time-field { width: 10.5ch; text-align: center; font-variant-numeric: tabular-nums; }/* The letter a run of names begins with, as Contacts heads its list. */.contact-letter {position: sticky; top: 0; z-index: 1; padding: 10px 10px 4px;diff --git a/src/styles/reminders.css b/src/styles/reminders.cssindex 5306903..bbd9a89 100644--- a/src/styles/reminders.css+++ b/src/styles/reminders.css@@ -546,6 +546,16 @@.rx-info-swatch.is-on { box-shadow: 0 0 0 2px var(--sheet, var(--bg)), 0 0 0 4px var(--text-3); }.rx-info-actions { display: flex; justify-content: space-between; width: 100%; margin-top: 4px; }-/* Date, then the Time switch, then the time once it is on — the phone's order. */-.rx-due { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }-.rx-due-switch { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-13); color: var(--text-2); }+/* Date, then the Time switch, then the time once it is on — the phone's order, on one line. */+.rx-due { display: flex; align-items: center; gap: 12px; min-width: 0; }+.rx-field .rx-due .rx-due-day { width: auto; flex: 0 1 11em; }+.rx-field .rx-due .time-field { width: 10.5ch; flex: none; }+/* The phone's switch: a pill that fills with the accent when on. */+.rx-switch { position: relative; display: inline-flex; align-items: center; gap: 8px; flex: none; color: var(--text-2); font-size: var(--t-13); cursor: pointer; }+.rx-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }+.rx-switch-track { position: relative; width: 34px; height: 20px; border-radius: 10px; background: color-mix(in srgb, var(--text) 22%, transparent); transition: background 160ms ease; }+.rx-switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.3); transition: transform 160ms ease; }+.rx-switch input:checked + .rx-switch-track { background: var(--sys-green, #34c759); }+.rx-switch input:checked + .rx-switch-track::after { transform: translateX(14px); }+.rx-switch input:focus-visible + .rx-switch-track { outline: 2px solid var(--sys-blue); outline-offset: 2px; }+.rx-switch input:disabled + .rx-switch-track { opacity: 0.4; }