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
Sidebar with Apple-style app icons that folds to an icon rail; Calendar edits keep the event's own time zone; Today heads only the parts of the day that hold something
Yashwanth Kamireddi7134c0b73430
diff --git a/.uiverify/calendar-instant.mjs b/.uiverify/calendar-instant.mjsindex a608e1f..b8bc79e 100644--- a/.uiverify/calendar-instant.mjs+++ b/.uiverify/calendar-instant.mjs@@ -45,6 +45,11 @@ const sent = await page.evaluate(() => window.__saves.at(-1));ok(sent?.draft?.url === "https://meet.example/dentist",`an edit keeps the event's link [${JSON.stringify(sent?.draft?.url)}]`);+// And its own zone, not this machine's: the stub's browser says Asia/Calcutta, the event+// was made in Asia/Kolkata (and a meeting set in New York must stay in New York).+const zoned = await page.evaluate(() => window.__saves.at(-1)?.draft?.timezone);+ok(zoned === "Asia/Kolkata", `an edit keeps the event's own time zone [${zoned}]`);+// A delete takes the event off the calendar at once.await page.locator(".cx-block", { hasText: "Design review" }).first().click();await page.waitForTimeout(250);diff --git a/.uiverify/reminders-empty.mjs b/.uiverify/reminders-empty.mjsindex 9f514b2..223c3c8 100644--- a/.uiverify/reminders-empty.mjs+++ b/.uiverify/reminders-empty.mjs@@ -18,5 +18,20 @@ const seen = await page.evaluate(() => ({const pass = seen.headings.length === 0 && seen.empty === "No Reminders";console.log(pass ? "PASS an empty Today says No Reminders, with no empty headings": `FAIL an empty Today: ${JSON.stringify(seen)}`);++// And a Today with something in it heads only the parts of the day that hold something.+const full = await b.newContext({ viewport: { width: 1200, height: 800 } });+await full.addInitScript(installStub, { screen: "library", services: SERVICES, twoFactor: null, remindersFixture: true });+const p2 = await full.newPage();+await p2.goto("http://localhost:4173", { waitUntil: "networkidle" });+await openScreen(p2, "Reminders");+await p2.locator(".rx-tile", { hasText: "Today" }).click();+await p2.waitForTimeout(400);+const empty = await p2.evaluate(() => [...document.querySelectorAll(".rx-section")].filter((h) => {+ const next = h.nextElementSibling;+ return !next || next.querySelectorAll(".rx-row").length === 0;+}).map((h) => h.textContent.trim()));+const pass2 = empty.length === 0;+console.log(pass2 ? "PASS a Today with reminders shows no empty headings" : `FAIL empty headings: ${JSON.stringify(empty)}`);await b.close();-process.exitCode = pass ? 0 : 1;+process.exitCode = pass && pass2 ? 0 : 1;diff --git a/src/components/AppIcon.tsx b/src/components/AppIcon.tsxnew file mode 100644index 0000000..7190e08--- /dev/null+++ b/src/components/AppIcon.tsx@@ -0,0 +1,82 @@+/**+ * Each screen's mark in the sidebar, drawn after the app it stands in for — Reminders' three+ * coloured dots on white, Notes' yellow pad, Drive's blue folder, Calendar's day-of-the-week+ * tile, Contacts' grey card — as icloud.com's launcher and macOS's sidebar show them, so a+ * row is found by its picture before its name is read. Drawn, not bitmaps: crisp at any+ * scale and on any desktop.+ */+export function AppIcon({ app, size = 22 }: { app: string; size?: number }) {+ const today = new Date();+ const s = { width: size, height: size, flex: "none" } as const;+ switch (app) {+ case "reminders":+ return (+ <svg viewBox="0 0 24 24" style={s} aria-hidden="true">+ <rect width="24" height="24" rx="5.5" fill="#fff" />+ {[+ [7, "#0a84ff"],+ [12, "#ff3b30"],+ [17, "#ff9f0a"],+ ].map(([y, c]) => (+ <g key={String(y)}>+ <circle cx="6.5" cy={y as number} r="2.1" fill={c as string} />+ <rect x="10" y={(y as number) - 0.6} width="9" height="1.2" rx="0.6" fill="#c7c7cc" />+ </g>+ ))}+ </svg>+ );+ case "notes":+ return (+ <svg viewBox="0 0 24 24" style={s} aria-hidden="true">+ <rect width="24" height="24" rx="5.5" fill="#fff" />+ <path d="M0 5.5A5.5 5.5 0 0 1 5.5 0h13A5.5 5.5 0 0 1 24 5.5V8H0z" fill="#ffd60a" />+ {[12, 15.5, 19].map((y) => (+ <rect key={y} x="3.5" y={y} width="17" height="0.9" rx="0.45" fill="#d1d1d6" />+ ))}+ </svg>+ );+ case "drivews":+ return (+ <svg viewBox="0 0 24 24" style={s} aria-hidden="true">+ <defs>+ <linearGradient id="qi-drive" x1="0" y1="0" x2="0" y2="1">+ <stop offset="0" stopColor="#5ac8fa" />+ <stop offset="1" stopColor="#0a84ff" />+ </linearGradient>+ </defs>+ <rect width="24" height="24" rx="5.5" fill="#fff" />+ <path d="M4 7.5A1.5 1.5 0 0 1 5.5 6h4l1.6 1.8h7.4A1.5 1.5 0 0 1 20 9.3V17a1.5 1.5 0 0 1-1.5 1.5h-13A1.5 1.5 0 0 1 4 17z" fill="url(#qi-drive)" />+ </svg>+ );+ case "calendar":+ return (+ <svg viewBox="0 0 24 24" style={s} aria-hidden="true">+ <rect width="24" height="24" rx="5.5" fill="#fff" />+ <text x="12" y="8.2" textAnchor="middle" fontSize="5.4" fontWeight="600" fill="#ff3b30"+ fontFamily="-apple-system, system-ui, sans-serif">+ {today.toLocaleDateString(undefined, { weekday: "short" }).toUpperCase().slice(0, 3)}+ </text>+ <text x="12" y="19.6" textAnchor="middle" fontSize="11.5" fontWeight="300" fill="#1c1c1e"+ fontFamily="-apple-system, system-ui, sans-serif">+ {today.getDate()}+ </text>+ </svg>+ );+ case "contacts":+ return (+ <svg viewBox="0 0 24 24" style={s} aria-hidden="true">+ <defs>+ <linearGradient id="qi-contacts" x1="0" y1="0" x2="0" y2="1">+ <stop offset="0" stopColor="#d1d1d6" />+ <stop offset="1" stopColor="#aeaeb2" />+ </linearGradient>+ </defs>+ <rect width="24" height="24" rx="5.5" fill="url(#qi-contacts)" />+ <circle cx="12" cy="9.5" r="3.6" fill="#fff" />+ <path d="M5.5 19.5c.9-3.4 3.4-5 6.5-5s5.6 1.6 6.5 5z" fill="#fff" />+ </svg>+ );+ default:+ return <span style={s} aria-hidden="true" />;+ }+}diff --git a/src/screens/Library.tsx b/src/screens/Library.tsxindex 243546c..9e5cb34 100644--- a/src/screens/Library.tsx+++ b/src/screens/Library.tsx@@ -10,6 +10,7 @@ import { NotesView } from "./NotesView";import { ContactsView } from "./ContactsView";import { DriveView } from "./DriveView";import { ScreenBoundary } from "../components/ScreenBoundary";+import { AppIcon } from "../components/AppIcon";/*** What the sidebar holds: the services with a real screen behind them, most used first.@@ -29,6 +30,7 @@ const SCREENS: { key: string; name: string }[] = [/** The screen open last time, so the app reopens where it was left. */const LAST_KEY = "quince.library.screen";+const RAIL_KEY = "quince.library.rail";export function Library({ onSignOut }: { onSignOut: () => void }) {const [services, setServices] = useState<string[]>([]);@@ -37,6 +39,23 @@ export function Library({ onSignOut }: { onSignOut: () => void }) {const [ready, setReady] = useState(false);/** In a narrow window the sidebar slides over the content, and only when asked for. */const [sidebarOpen, setSidebarOpen] = useState(false);+ /** A wide window can fold the sidebar to its icons, as Finder and Mail can; remembered. */+ const [rail, setRail] = useState(() => {+ try {+ return window.localStorage.getItem(RAIL_KEY) === "1";+ } catch {+ return false;+ }+ });+ const toggleRail = () =>+ setRail((was) => {+ try {+ window.localStorage.setItem(RAIL_KEY, was ? "0" : "1");+ } catch {+ // Folds for now; forgotten on restart.+ }+ return !was;+ });useEffect(() => {api@@ -115,15 +134,17 @@ export function Library({ onSignOut }: { onSignOut: () => void }) {tabIndex={selected === key ? 0 : -1}onKeyDown={(e) => onKeyDown(e, index)}onClick={() => choose(key)}+ title={rail ? (SCREENS.find((s) => s.key === key)?.name ?? key) : undefined}>- <span>{SCREENS.find((s) => s.key === key)?.name ?? key}</span>+ <AppIcon app={key} />+ <span className="nav-name">{SCREENS.find((s) => s.key === key)?.name ?? key}</span></button>);};return (<SyncProvider>- <div className={`library enter-library${sidebarOpen ? " is-sidebar-open" : ""}`}>+ <div className={`library enter-library${sidebarOpen ? " is-sidebar-open" : ""}${rail ? " is-rail" : ""}`}>{/* Only in a narrow window, where the sidebar gives its room to the content. */}<buttonclassName="sidebar-toggle"@@ -136,7 +157,18 @@ export function Library({ onSignOut }: { onSignOut: () => void }) {</button><div className="sidebar-scrim" aria-hidden="true" onClick={() => setSidebarOpen(false)} /><nav className="sidebar" aria-label="Your iCloud">- <h2>Your iCloud</h2>+ <div className="sidebar-head">+ <h2>iCloud</h2>+ <button+ className="sidebar-fold"+ aria-label={rail ? "Show Sidebar Names" : "Fold Sidebar to Icons"}+ aria-pressed={rail}+ title={rail ? "Show Sidebar Names" : "Fold Sidebar to Icons"}+ onClick={toggleRail}+ >+ <PanelLeft size={16} strokeWidth={2} aria-hidden="true" />+ </button>+ </div>{services.map(item)}{!ready && !error && <p className="badge">Loading…</p>}{error && (diff --git a/src/screens/RemindersView.tsx b/src/screens/RemindersView.tsxindex 1429ef7..bef6241 100644--- a/src/screens/RemindersView.tsx+++ b/src/screens/RemindersView.tsx@@ -610,9 +610,8 @@ export function RemindersView() {const listOf = (guid: string) => lists.find((l) => l.guid === guid);if (kind === "today") {- // Apple's own buckets, all three shown once anything is due today. A day with nothing- // in it shows no empty headings, only that there is nothing — as icloud.com does.- if (threaded.length === 0) return [];+ // Apple's own buckets, each shown only when something is in it: empty "Morning" and+ // "Afternoon" headings above the one reminder due tonight read as missing reminders.const buckets: { key: string; heading: string | null; rows: typeof threaded }[] = [{ key: "loose", heading: null, rows: [] },{ key: "morning", heading: "Morning", rows: [] },@@ -631,7 +630,7 @@ export function RemindersView() {buckets[hour < 12 ? 1 : hour < 17 ? 2 : 3].rows.push(row);}return buckets- .filter((b) => b.rows.length > 0 || b.heading !== null)+ .filter((b) => b.rows.length > 0)// The buckets are all today, so a row under one needs only its time. The loose rows// above are overdue or undated and still have to say which day they mean..map((b) => ({ ...b, colour: null, dated: b.heading !== null }));diff --git a/src/screens/calendar/CalendarView.tsx b/src/screens/calendar/CalendarView.tsxindex 7aca64f..464965e 100644--- a/src/screens/calendar/CalendarView.tsx+++ b/src/screens/calendar/CalendarView.tsx@@ -76,6 +76,9 @@ type Draft = {/** Carried through untouched: the editor has no field for it yet, and sending null wiped* the link off every event that was edited, moved or resized here. */url: string | null;+ /** The zone the event was made in. Sending this machine's instead moved a meeting set in+ * New York to local time on every edit, on every device. New events take this machine's. */+ timezone: string | null;};const draftOf = (e: CalendarEvent): Draft => ({@@ -88,6 +91,7 @@ const draftOf = (e: CalendarEvent): Draft => ({allDay: e.allDay,notes: e.notes ?? "",url: e.url,+ timezone: e.timezone,});/** `YYYY-MM-DDTHH:mm` and `YYYY-MM-DD` for the date inputs, in local time. */@@ -303,7 +307,7 @@ export function CalendarView() {startsAt: d.startsAt,endsAt: Math.max(d.endsAt, d.startsAt + (d.allDay ? 86_400 : 900)),allDay: d.allDay,- timezone: ZONE,+ timezone: d.allDay ? ZONE : (d.timezone ?? ZONE),notes: d.notes.trim() || null,url: d.url,});@@ -352,7 +356,7 @@ export function CalendarView() {const newAt = (startsAt: number, endsAt: number, allDay: boolean, at: Anchor) => {if (!target) return;openDraft(- { guid: null, calendarGuid: target.guid, title: "", location: "", startsAt, endsAt, allDay, notes: "", url: null },+ { guid: null, calendarGuid: target.guid, title: "", location: "", startsAt, endsAt, allDay, notes: "", url: null, timezone: null },at);};diff --git a/src/styles/app.css b/src/styles/app.cssindex 24e608c..7e8b642 100644--- a/src/styles/app.css+++ b/src/styles/app.css@@ -257,7 +257,9 @@left: 8px;top: 8px;bottom: 8px;- width: 208px;+ width: 196px;+ transition: width 260ms cubic-bezier(0.32, 0.72, 0, 1);+ overflow: hidden;background: var(--glass);-webkit-backdrop-filter: var(--glass-blur);backdrop-filter: var(--glass-blur);@@ -387,8 +389,11 @@.nav-item {display: flex;align-items: center;- justify-content: space-between;- gap: 8px;+ justify-content: flex-start;+ gap: 10px;+ min-height: 34px;+ white-space: nowrap;+ transition: background 120ms ease, transform 120ms ease;width: 100%;border: 0;background: none;@@ -401,6 +406,27 @@cursor: pointer;}+.nav-item:active { transform: scale(0.98); }+.nav-item > svg { border-radius: 5.5px; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.18), 0 1px 2px rgba(0, 0, 0, 0.25); }+.nav-name { overflow: hidden; text-overflow: ellipsis; transition: opacity 160ms ease; }+.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 {+ display: grid; place-items: center; width: 28px; height: 28px; padding: 0; flex: none;+ border: 0; border-radius: 7px; background: none; box-shadow: none; color: var(--text-2); cursor: pointer;+}+.sidebar-fold:hover { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }+.sidebar-fold:focus-visible { outline: 3px solid var(--gold-ring); }+/* Folded: the icons alone, centred, names gone; the foot keeps only its status dot. */+@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; }+ .is-rail .nav-item { justify-content: center; gap: 0; padding-inline: 0; }+ .is-rail .sidebar-foot { display: none; }+}+@media (max-width: 900px) { .sidebar-fold { display: none; } }+@media (prefers-reduced-motion: reduce) { .content, .sidebar, .nav-item { transition: none; } }.nav-item:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }.nav-item[aria-current="true"] { background: var(--gold-tint); color: var(--gold-strong); font-weight: 550; }.nav-item:focus-visible { outline: 3px solid var(--gold-ring); outline-offset: -1px; }@@ -440,8 +466,11 @@.content {height: 100%;overflow-y: auto;- padding: 28px 34px 28px 248px;+ padding: 28px 34px 28px var(--side, 236px);+ transition: padding-left 260ms cubic-bezier(0.32, 0.72, 0, 1);}+.library { --side: 236px; }+.library.is-rail { --side: 84px; }.sidebar-toggle, .sidebar-scrim, .compact-back { display: none; }/*