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.

Every screen is checked at 800×600, 1280×800 and 2560×1440

Yashwanth Kamireddi92c65c865390
diff --git a/.uiverify/shots.mjs b/.uiverify/shots.mjs
index 942b7b1..68e1fe0 100644
--- a/.uiverify/shots.mjs
+++ b/.uiverify/shots.mjs
@@ -4,191 +4,12 @@
import { chromium } from "playwright";
import { fileURLToPath } from "node:url";
import path from "node:path";
+import { SERVICES, installStub } from "./stub.mjs";
const dir = path.dirname(fileURLToPath(import.meta.url));
const BASE = process.env.BASE ?? "http://localhost:4173";
-const SERVICES = ["account","archivews","calendar","ckdatabasews","ckdeviceservice",
- "cksharews","contacts","contactsweb","developerapi","docws","drivews",
- "findme","geows","iwmb","iworkexportws","iworkthumbnailws","keyvalue",
- "mail","mcc","mccgateway","mpp","notes","photos","photosupload",
- "premiummailsettings","push","reminders","settings","sharedlibrary",
- "sharedstreams","ubiquity","uploadimagews"];
-/* addInitScript SERIALIZES this function — closures do not cross into the page, so every
- value it needs must arrive through the single argument. */
-/* Fixture events, so the agenda's rendering is verified without inventing rows in anyone's
- real library. Times are unix seconds relative to now. */
-function installStub({ screen, services, twoFactor, calendarFixture, notesFixture, contactsFixture, driveFixture, remindersFixture }) {
- const HOUR = 3600, DAY = 86400;
- const base = Math.floor(Date.now() / 1000 / DAY) * DAY + 9 * HOUR;
- const events = !calendarFixture ? [] : [
- { guid: "e1", calendarGuid: "work", title: "Design review", location: "Studio",
- startsAt: base + HOUR, endsAt: base + 2 * HOUR, allDay: false,
- timezone: "Asia/Kolkata", url: null, notes: null, etag: null },
- { guid: "e2", calendarGuid: "home", title: "Dentist", location: null,
- startsAt: base + 5 * HOUR, endsAt: base + 6 * HOUR, allDay: false,
- timezone: "Asia/Kolkata", url: null, notes: null, etag: null },
- { guid: "e3", calendarGuid: "work", title: "Sprint planning", location: "Room 2",
- startsAt: base + DAY + 2 * HOUR, endsAt: base + DAY + 3 * HOUR, allDay: false,
- timezone: "Asia/Kolkata", url: null, notes: null, etag: null },
- { guid: "e4", calendarGuid: "personal", title: "Flight to Hyderabad", location: null,
- startsAt: base + 3 * DAY, endsAt: base + 4 * DAY, allDay: true,
- timezone: "Asia/Kolkata", url: null, notes: null, etag: null },
- ];
- const dueReminders = !calendarFixture ? [] : [
- { guid: "r1", listGuid: "daily", title: "Water the plants", notes: null,
- dueAt: base + DAY + 8 * HOUR, completedAt: null, priority: 1, etag: null },
- { guid: "r2", listGuid: "health", title: "Evening run", notes: null,
- dueAt: base + 6 * HOUR, completedAt: null, priority: 0, etag: null },
- { guid: "r3", listGuid: "daily", title: "Plan tomorrow", notes: null,
- dueAt: base + 13 * HOUR, completedAt: base + 13 * HOUR, priority: 0, etag: null },
- ];
- const noteFolders = [
- { guid: "f1", title: "Notes", sortOrder: 0 },
- { guid: "f2", title: "Recently Deleted", sortOrder: 1 },
- ];
- const noteList = !notesFixture ? [] : [
- { guid: "n1", folderGuid: "f1", title: "Curtains",
- snippet: "Bathroom accessories like mirror holder…",
- body: "Curtains\nBathroom accessories like mirror holder, soap holder, shampoo, clothes hanger\nFan\nwall clock\nBed\nDining table\nTea filter\nKnife\nWashing Machine cover",
- locked: false, editable: true, pinned: false, createdAt: null, modifiedAt: 1788500000, etag: null },
- { guid: "n2", folderGuid: "f1", title: "🔴 UNIT 1: SOFTWARE TESTING METHODOLOGIES",
- snippet: "📌 SECTION A: 2-MARK HIGH-YIELD…",
- body: "🔴 UNIT 1: SOFTWARE TESTING METHODOLOGIES\n\n📌 SECTION A: 2-MARK HIGH-YIELD QUESTIONS\n\nSoftware testing is the process of evaluating a system to find whether it satisfies the specified requirements, and to detect the differences between expected and actual results.",
- locked: false, editable: true, pinned: true, createdAt: null, modifiedAt: 1787900000, etag: null },
- { guid: "n3", folderGuid: "f1",
- title: "These sources outline the fundamental principles and methodologies",
- snippet: "of **Software Testing Methodologies…",
- body: "These sources outline the fundamental principles and methodologies of **Software Testing Methodologies (CSEN3311)**, emphasizing its evolution from simple debugging to a structured, process-oriented discipline. The material details the **Software Testing Life Cycle (STLC)**, covering essential phases from initial planning and test design to execution and post-implementation review.",
- locked: false, editable: true, pinned: false, createdAt: null, modifiedAt: 1787800000, etag: null },
- ];
- const contactList = !contactsFixture ? [] : [
- { guid: "c1", firstName: "Zoya", lastName: "Ahuja", company: null, isCompany: false,
- birthday: null, notes: null, etag: null,
- methods: [{ kind: "phone", label: "mobile", value: "+91 90000 00001" },
- { kind: "email", label: "home", value: "[email protected]" }] },
- { guid: "c2", firstName: "Amma", lastName: null, company: null, isCompany: false,
- birthday: null, notes: null, etag: null,
- methods: [{ kind: "phone", label: null, value: "+91 98765 43210" }] },
- { guid: "c3", firstName: null, lastName: null, company: "Northfield University",
- isCompany: true, birthday: null, notes: null, etag: null,
- methods: [{ kind: "phone", label: "work", value: "+91 891 284 0000" },
- { kind: "url", label: null, value: "northfield.example" }] },
- { guid: "c4", firstName: null, lastName: null, company: null, isCompany: false,
- birthday: null, notes: null, etag: null,
- methods: [{ kind: "phone", label: null, value: "+91 90000 11111" }] },
- ];
- const driveItems = !driveFixture ? [] : [
- { drivewsid: "FOLDER::a", parentId: null, name: "Downloads", extension: null,
- kind: "FOLDER", size: null, childCount: 3, createdAt: 1785000000,
- modifiedAt: 1788000000, etag: null },
- { drivewsid: "APPLIB::b", parentId: null, name: "Keynote", extension: null,
- kind: "APP_LIBRARY", size: null, childCount: null, createdAt: 1780000000,
- modifiedAt: null, etag: null },
- { drivewsid: "APPLIB::c", parentId: null, name: "Shortcuts", extension: null,
- kind: "APP_LIBRARY", size: null, childCount: null, createdAt: 1780000000,
- modifiedAt: null, etag: null },
- { drivewsid: "FILE::d", parentId: null, name: "Semester Plan", extension: "pdf",
- kind: "FILE", size: 2411724, childCount: null, createdAt: 1787000000,
- modifiedAt: 1788600000, etag: null },
- ];
- const reminderLists = !remindersFixture ? [] : [
- { guid: "l1", title: "Daily", colour: "#63da38", ctag: null, sortOrder: 0, enabled: true },
- { guid: "l2", title: "GYM", colour: "#cc73e1", ctag: null, sortOrder: 1, enabled: true },
- { guid: "l3", title: "Life Goals", colour: "#1badf8", ctag: null, sortOrder: 2, enabled: true },
- ];
- const reminderItems = !remindersFixture ? [] : [
- { guid: "r1", listGuid: "l1", title: "Plan tomorrow", notes: null,
- dueAt: base - 2 * HOUR, completedAt: null, priority: 0, flagged: false, parentGuid: null, etag: null },
- { guid: "r2", listGuid: "l1", title: "Pick up the parcel", notes: null,
- dueAt: base + DAY + 7 * HOUR, completedAt: null, priority: 0, flagged: true, parentGuid: null, etag: null },
- { guid: "r3", listGuid: "l2", title: "Evening run", notes: "Legs today",
- dueAt: base + 6 * HOUR, completedAt: null, priority: 0, flagged: false, parentGuid: null, etag: null },
- { guid: "r4", listGuid: "l1", title: "Water the plants", notes: null,
- dueAt: base - DAY, completedAt: base - DAY, priority: 0, flagged: false, parentGuid: null, etag: null },
- ];
- // Shaped like a real account rather than a tidy one: the default is not the first, and one
- // of them is a subscribed feed that nothing may be written to.
- const calendars = [
- { guid: "work", title: "Work", colour: "#cc73e1", ctag: null, sortOrder: 0, enabled: true,
- writable: true, isDefault: false },
- { guid: "home", title: "Home", colour: "#0088ff", ctag: null, sortOrder: 1, enabled: true,
- writable: true, isDefault: true },
- { guid: "personal", title: "Asha", colour: "#1badf8", ctag: null, sortOrder: 2, enabled: true,
- writable: true, isDefault: false },
- { guid: "holidays", title: "Holidays in India", colour: "#8e8e93", ctag: null, sortOrder: 3,
- enabled: true, writable: false, isDefault: false },
- ];
- window.__TAURI_INTERNALS__ = {
- transformCallback: (cb) => cb,
- invoke: async (cmd) => {
- switch (cmd) {
- case "auth_status":
- return { hasStoredSession: screen === "library", signedIn: screen === "library" };
- case "auth_resume": return screen === "library";
- case "auth_sign_in": return screen === "code" ? "needs_two_factor" : "complete";
- case "auth_submit_code": return null;
- case "account_services": return services;
- case "calendar_events": return events;
- case "calendar_list": return calendars;
- case "event_save": return "E-new";
- case "event_delete": return null;
- case "calendar_sync": return { calendars: calendars.length, events: events.length };
- case "reminder_counts": return { today: 4, scheduled: 7, flagged: 2, all: 12, lists: [["L1", 5], ["L2", 3], ["lists", 4]] };
- case "reminder_lists": return !remindersFixture ? [] : reminderLists;
- case "reminders_in": return !remindersFixture ? [] : reminderItems;
- case "reminders_due_between": return calendarFixture ? dueReminders : [];
- case "reminder_create": return null;
- case "reminder_delete": return null;
- case "reminder_set_done": return null;
- case "reminder_set_repeat": return null;
- case "reminder_edit": return null;
- case "reminder_list_create": case "reminder_list_rename": case "reminder_list_delete":
- return null;
- case "reminders_smart": return !remindersFixture ? [] : reminderItems.filter(r => !r.completedAt);
- case "note_folders": return !notesFixture ? [] : noteFolders;
- case "note_save": case "note_delete": case "note_move": return null;
- case "note_create": return "Note/new";
- case "notes_in": return !notesFixture ? [] : noteList;
- case "contact_save": return "C-new";
- case "contact_delete": return null;
- case "contacts_list": return !contactsFixture ? [] : contactList;
- case "drive_children": return !driveFixture ? [] : driveItems;
- case "drive_sync_folder": return driveItems.length;
- case "drive_download": return "/home/user/Downloads/file.pdf";
- case "drive_create_folder": case "drive_rename": case "drive_delete": case "drive_move": return null;
- case "drive_item": return null;
- case "auth_two_factor_options": return twoFactor;
- case "auth_resend_code": return null;
- case "auth_send_sms": return null;
- case "auth_submit_sms_code": return null;
- case "auth_sign_out": return null;
- // One refresh covers every service, so there is one command to stub rather than
- // a pair per screen.
- case "sync_all":
- case "sync_status":
- return {
- services: [
- { service: "calendar", label: "Calendar", outcome: "ok", detail: null, lastSyncedAt: Math.floor(Date.now() / 1000) - 120 },
- { service: "reminders", label: "Reminders", outcome: "ok", detail: null, lastSyncedAt: Math.floor(Date.now() / 1000) - 60 },
- { service: "notes", label: "Notes", outcome: "ok", detail: null, lastSyncedAt: Math.floor(Date.now() / 1000) - 90 },
- { service: "contacts", label: "Contacts", outcome: "ok", detail: null, lastSyncedAt: Math.floor(Date.now() / 1000) - 300 },
- ],
- asOf: Math.floor(Date.now() / 1000) - 300,
- tookMs: 40,
- };
- // The event plugin is how a finished refresh reaches the screens. Nothing emits in
- // a plain browser, so listening is a no-op that hands back an unsubscribe id.
- case "plugin:event|listen":
- return 0;
- case "plugin:event|unlisten":
- return null;
- default: throw new Error(`unstubbed command: ${cmd}`);
- }
- },
- };
-}
const PUSHED = { trustedDeviceCount: 2, phones: [{ id: 1, maskedNumber: "+91 ••••• ••318" }], tooManyCodesSent: false };
const NOTHING = { trustedDeviceCount: 0, phones: [{ id: 1, maskedNumber: "+91 ••••• ••318" }], tooManyCodesSent: false };
diff --git a/.uiverify/sizes.mjs b/.uiverify/sizes.mjs
new file mode 100644
index 0000000..a6d1d72
--- /dev/null
+++ b/.uiverify/sizes.mjs
@@ -0,0 +1,101 @@
+// Every screen at every size a window is likely to be, checked for what breaks when it is
+// resized: the page scrolling sideways, a control cut off by the box it sits in, or anything
+// running off the edge of the window.
+//
+// Screens break at the sizes nobody looked at — the half-screen window, the small laptop —
+// so each is opened at a small, an ordinary and a very large size, and in Calendar each of
+// its four views too.
+import { chromium } from "playwright";
+import { SERVICES, installStub } from "./stub.mjs";
+
+const SIZES = [
+ { width: 800, height: 600 },
+ { width: 1280, height: 800 },
+ { width: 2560, height: 1440 },
+];
+const SCREENS = ["Reminders", "Notes", "iCloud Drive", "Calendar", "Contacts"];
+const CALENDAR_VIEWS = ["Day", "Week", "Month", "Year"];
+
+/** What is broken on the page as it stands, described so a failure says where to look. */
+function problems() {
+ const out = [];
+ const doc = document.documentElement;
+ if (doc.scrollWidth > window.innerWidth + 1) out.push(`the page scrolls sideways by ${doc.scrollWidth - window.innerWidth}px`);
+
+ const describe = (el) => {
+ const label = el.getAttribute("aria-label") || el.textContent?.trim().slice(0, 30) || el.tagName.toLowerCase();
+ return `${el.tagName.toLowerCase()}.${[...el.classList].join(".")} "${label}"`;
+ };
+ const clippers = (el) => {
+ const found = [];
+ for (let p = el.parentElement; p && p !== document.body; p = p.parentElement) {
+ const cs = getComputedStyle(p);
+ if (/(hidden|clip|auto|scroll)/.test(cs.overflowX + cs.overflowY)) found.push(p);
+ // Inside something that scrolls, what is out of view is scrolled to, not lost — and
+ // nothing further out decides whether it can be reached.
+ if (/(auto|scroll)/.test(cs.overflowY) && /(auto|scroll)/.test(cs.overflowX + cs.overflowY)) break;
+ }
+ return found;
+ };
+
+ for (const el of document.querySelectorAll("button, input, select, textarea, [role=checkbox], a[href]")) {
+ const r = el.getBoundingClientRect();
+ if (r.width === 0 || r.height === 0) continue;
+ const style = getComputedStyle(el);
+ if (style.visibility === "hidden" || style.opacity === "0") continue;
+ // Off the window sideways: a control nobody can reach. (Below the fold is only scrolled to.)
+ if (r.right > window.innerWidth + 1 || r.left < -1) {
+ out.push(`${describe(el)} runs off the window`);
+ continue;
+ }
+ // Cut off by a box that does not scroll to it: part of a control shown, part not.
+ for (const box of clippers(el)) {
+ const b = box.getBoundingClientRect();
+ const cs = getComputedStyle(box);
+ const scrollsX = /(auto|scroll)/.test(cs.overflowX) && box.scrollWidth > box.clientWidth;
+ const scrollsY = /(auto|scroll)/.test(cs.overflowY);
+ const cutX = !scrollsX && (r.left < b.left - 1 || r.right > b.right + 1) && r.right > b.left && r.left < b.right;
+ const cutY = !scrollsY && (r.top < b.top - 1 || r.bottom > b.bottom + 1) && r.bottom > b.top && r.top < b.bottom;
+ if (cutX || cutY) {
+ out.push(`${describe(el)} is cut off by ${describe(box)}`);
+ break;
+ }
+ }
+ }
+ return [...new Set(out)];
+}
+
+const b = await chromium.launch();
+let failures = 0;
+for (const size of SIZES) {
+ const ctx = await b.newContext({ viewport: size });
+ await ctx.addInitScript(installStub, {
+ screen: "library", services: SERVICES, twoFactor: null,
+ calendarFixture: true, notesFixture: true, contactsFixture: true, driveFixture: true, remindersFixture: true,
+ });
+ const page = await ctx.newPage();
+ await page.goto("http://localhost:4173", { waitUntil: "networkidle" });
+ await page.waitForSelector(".sidebar .nav-item");
+ for (const screen of SCREENS) {
+ await page.locator(".nav-item", { hasText: screen }).click();
+ await page.waitForTimeout(350);
+ const views = screen === "Calendar" ? CALENDAR_VIEWS : [null];
+ for (const view of views) {
+ if (view) {
+ await page.getByRole("button", { name: view, exact: true }).click();
+ await page.waitForTimeout(250);
+ }
+ const where = `${screen}${view ? ` (${view})` : ""} at ${size.width}×${size.height}`;
+ const found = await page.evaluate(problems);
+ if (found.length === 0) {
+ console.log(`PASS ${where}`);
+ } else {
+ failures++;
+ console.log(`FAIL ${where}:\n ${found.slice(0, 6).join("\n ")}${found.length > 6 ? `\n …and ${found.length - 6} more` : ""}`);
+ }
+ }
+ }
+ await ctx.close();
+}
+await b.close();
+process.exitCode = failures === 0 ? 0 : 1;
diff --git a/.uiverify/stub.mjs b/.uiverify/stub.mjs
new file mode 100644
index 0000000..b6a730f
--- /dev/null
+++ b/.uiverify/stub.mjs
@@ -0,0 +1,183 @@
+// The IPC stub and sample data the browser suites share: the shapes the Rust commands
+// return, with sample rows so every screen has something real-shaped to draw.
+export const SERVICES = ["account","archivews","calendar","ckdatabasews","ckdeviceservice",
+ "cksharews","contacts","contactsweb","developerapi","docws","drivews",
+ "findme","geows","iwmb","iworkexportws","iworkthumbnailws","keyvalue",
+ "mail","mcc","mccgateway","mpp","notes","photos","photosupload",
+ "premiummailsettings","push","reminders","settings","sharedlibrary",
+ "sharedstreams","ubiquity","uploadimagews"];
+
+/* addInitScript SERIALIZES this function — closures do not cross into the page, so every
+ value it needs must arrive through the single argument. */
+/* Fixture events, so the agenda's rendering is verified without inventing rows in anyone's
+ real library. Times are unix seconds relative to now. */
+export function installStub({ screen, services, twoFactor, calendarFixture, notesFixture, contactsFixture, driveFixture, remindersFixture }) {
+ const HOUR = 3600, DAY = 86400;
+ const base = Math.floor(Date.now() / 1000 / DAY) * DAY + 9 * HOUR;
+ const events = !calendarFixture ? [] : [
+ { guid: "e1", calendarGuid: "work", title: "Design review", location: "Studio",
+ startsAt: base + HOUR, endsAt: base + 2 * HOUR, allDay: false,
+ timezone: "Asia/Kolkata", url: null, notes: null, etag: null },
+ { guid: "e2", calendarGuid: "home", title: "Dentist", location: null,
+ startsAt: base + 5 * HOUR, endsAt: base + 6 * HOUR, allDay: false,
+ timezone: "Asia/Kolkata", url: null, notes: null, etag: null },
+ { guid: "e3", calendarGuid: "work", title: "Sprint planning", location: "Room 2",
+ startsAt: base + DAY + 2 * HOUR, endsAt: base + DAY + 3 * HOUR, allDay: false,
+ timezone: "Asia/Kolkata", url: null, notes: null, etag: null },
+ { guid: "e4", calendarGuid: "personal", title: "Flight to Hyderabad", location: null,
+ startsAt: base + 3 * DAY, endsAt: base + 4 * DAY, allDay: true,
+ timezone: "Asia/Kolkata", url: null, notes: null, etag: null },
+ ];
+ const dueReminders = !calendarFixture ? [] : [
+ { guid: "r1", listGuid: "daily", title: "Water the plants", notes: null,
+ dueAt: base + DAY + 8 * HOUR, completedAt: null, priority: 1, etag: null },
+ { guid: "r2", listGuid: "health", title: "Evening run", notes: null,
+ dueAt: base + 6 * HOUR, completedAt: null, priority: 0, etag: null },
+ { guid: "r3", listGuid: "daily", title: "Plan tomorrow", notes: null,
+ dueAt: base + 13 * HOUR, completedAt: base + 13 * HOUR, priority: 0, etag: null },
+ ];
+ const noteFolders = [
+ { guid: "f1", title: "Notes", sortOrder: 0 },
+ { guid: "f2", title: "Recently Deleted", sortOrder: 1 },
+ ];
+ const noteList = !notesFixture ? [] : [
+ { guid: "n1", folderGuid: "f1", title: "Curtains",
+ snippet: "Bathroom accessories like mirror holder…",
+ body: "Curtains\nBathroom accessories like mirror holder, soap holder, shampoo, clothes hanger\nFan\nwall clock\nBed\nDining table\nTea filter\nKnife\nWashing Machine cover",
+ locked: false, editable: true, pinned: false, createdAt: null, modifiedAt: 1788500000, etag: null },
+ { guid: "n2", folderGuid: "f1", title: "🔴 UNIT 1: SOFTWARE TESTING METHODOLOGIES",
+ snippet: "📌 SECTION A: 2-MARK HIGH-YIELD…",
+ body: "🔴 UNIT 1: SOFTWARE TESTING METHODOLOGIES\n\n📌 SECTION A: 2-MARK HIGH-YIELD QUESTIONS\n\nSoftware testing is the process of evaluating a system to find whether it satisfies the specified requirements, and to detect the differences between expected and actual results.",
+ locked: false, editable: true, pinned: true, createdAt: null, modifiedAt: 1787900000, etag: null },
+ { guid: "n3", folderGuid: "f1",
+ title: "These sources outline the fundamental principles and methodologies",
+ snippet: "of **Software Testing Methodologies…",
+ body: "These sources outline the fundamental principles and methodologies of **Software Testing Methodologies (CSEN3311)**, emphasizing its evolution from simple debugging to a structured, process-oriented discipline. The material details the **Software Testing Life Cycle (STLC)**, covering essential phases from initial planning and test design to execution and post-implementation review.",
+ locked: false, editable: true, pinned: false, createdAt: null, modifiedAt: 1787800000, etag: null },
+ ];
+ const contactList = !contactsFixture ? [] : [
+ { guid: "c1", firstName: "Zoya", lastName: "Ahuja", company: null, isCompany: false,
+ birthday: null, notes: null, etag: null,
+ methods: [{ kind: "phone", label: "mobile", value: "+91 90000 00001" },
+ { kind: "email", label: "home", value: "[email protected]" }] },
+ { guid: "c2", firstName: "Amma", lastName: null, company: null, isCompany: false,
+ birthday: null, notes: null, etag: null,
+ methods: [{ kind: "phone", label: null, value: "+91 98765 43210" }] },
+ { guid: "c3", firstName: null, lastName: null, company: "Northfield University",
+ isCompany: true, birthday: null, notes: null, etag: null,
+ methods: [{ kind: "phone", label: "work", value: "+91 891 284 0000" },
+ { kind: "url", label: null, value: "northfield.example" }] },
+ { guid: "c4", firstName: null, lastName: null, company: null, isCompany: false,
+ birthday: null, notes: null, etag: null,
+ methods: [{ kind: "phone", label: null, value: "+91 90000 11111" }] },
+ ];
+ const driveItems = !driveFixture ? [] : [
+ { drivewsid: "FOLDER::a", parentId: null, name: "Downloads", extension: null,
+ kind: "FOLDER", size: null, childCount: 3, createdAt: 1785000000,
+ modifiedAt: 1788000000, etag: null },
+ { drivewsid: "APPLIB::b", parentId: null, name: "Keynote", extension: null,
+ kind: "APP_LIBRARY", size: null, childCount: null, createdAt: 1780000000,
+ modifiedAt: null, etag: null },
+ { drivewsid: "APPLIB::c", parentId: null, name: "Shortcuts", extension: null,
+ kind: "APP_LIBRARY", size: null, childCount: null, createdAt: 1780000000,
+ modifiedAt: null, etag: null },
+ { drivewsid: "FILE::d", parentId: null, name: "Semester Plan", extension: "pdf",
+ kind: "FILE", size: 2411724, childCount: null, createdAt: 1787000000,
+ modifiedAt: 1788600000, etag: null },
+ ];
+ const reminderLists = !remindersFixture ? [] : [
+ { guid: "l1", title: "Daily", colour: "#63da38", ctag: null, sortOrder: 0, enabled: true },
+ { guid: "l2", title: "GYM", colour: "#cc73e1", ctag: null, sortOrder: 1, enabled: true },
+ { guid: "l3", title: "Life Goals", colour: "#1badf8", ctag: null, sortOrder: 2, enabled: true },
+ ];
+ const reminderItems = !remindersFixture ? [] : [
+ { guid: "r1", listGuid: "l1", title: "Plan tomorrow", notes: null,
+ dueAt: base - 2 * HOUR, completedAt: null, priority: 0, flagged: false, parentGuid: null, etag: null },
+ { guid: "r2", listGuid: "l1", title: "Pick up the parcel", notes: null,
+ dueAt: base + DAY + 7 * HOUR, completedAt: null, priority: 0, flagged: true, parentGuid: null, etag: null },
+ { guid: "r3", listGuid: "l2", title: "Evening run", notes: "Legs today",
+ dueAt: base + 6 * HOUR, completedAt: null, priority: 0, flagged: false, parentGuid: null, etag: null },
+ { guid: "r4", listGuid: "l1", title: "Water the plants", notes: null,
+ dueAt: base - DAY, completedAt: base - DAY, priority: 0, flagged: false, parentGuid: null, etag: null },
+ ];
+ // Shaped like a real account rather than a tidy one: the default is not the first, and one
+ // of them is a subscribed feed that nothing may be written to.
+ const calendars = [
+ { guid: "work", title: "Work", colour: "#cc73e1", ctag: null, sortOrder: 0, enabled: true,
+ writable: true, isDefault: false },
+ { guid: "home", title: "Home", colour: "#0088ff", ctag: null, sortOrder: 1, enabled: true,
+ writable: true, isDefault: true },
+ { guid: "personal", title: "Asha", colour: "#1badf8", ctag: null, sortOrder: 2, enabled: true,
+ writable: true, isDefault: false },
+ { guid: "holidays", title: "Holidays in India", colour: "#8e8e93", ctag: null, sortOrder: 3,
+ enabled: true, writable: false, isDefault: false },
+ ];
+ window.__TAURI_INTERNALS__ = {
+ transformCallback: (cb) => cb,
+ invoke: async (cmd) => {
+ switch (cmd) {
+ case "auth_status":
+ return { hasStoredSession: screen === "library", signedIn: screen === "library" };
+ case "auth_resume": return screen === "library";
+ case "auth_sign_in": return screen === "code" ? "needs_two_factor" : "complete";
+ case "auth_submit_code": return null;
+ case "account_services": return services;
+ case "calendar_events": return events;
+ case "calendar_list": return calendars;
+ case "event_save": return "E-new";
+ case "event_delete": return null;
+ case "calendar_sync": return { calendars: calendars.length, events: events.length };
+ case "reminder_counts": return { today: 4, scheduled: 7, flagged: 2, all: 12, lists: [["L1", 5], ["L2", 3], ["lists", 4]] };
+ case "reminder_lists": return !remindersFixture ? [] : reminderLists;
+ case "reminders_in": return !remindersFixture ? [] : reminderItems;
+ case "reminders_due_between": return calendarFixture ? dueReminders : [];
+ case "reminder_create": return null;
+ case "reminder_delete": return null;
+ case "reminder_set_done": return null;
+ case "reminder_set_repeat": return null;
+ case "reminder_edit": return null;
+ case "reminder_list_create": case "reminder_list_rename": case "reminder_list_delete":
+ return null;
+ case "reminders_smart": return !remindersFixture ? [] : reminderItems.filter(r => !r.completedAt);
+ case "note_folders": return !notesFixture ? [] : noteFolders;
+ case "note_save": case "note_delete": case "note_move": return null;
+ case "note_create": return "Note/new";
+ case "notes_in": return !notesFixture ? [] : noteList;
+ case "contact_save": return "C-new";
+ case "contact_delete": return null;
+ case "contacts_list": return !contactsFixture ? [] : contactList;
+ case "drive_children": return !driveFixture ? [] : driveItems;
+ case "drive_sync_folder": return driveItems.length;
+ case "drive_download": return "/home/user/Downloads/file.pdf";
+ case "drive_create_folder": case "drive_rename": case "drive_delete": case "drive_move": return null;
+ case "drive_item": return null;
+ case "auth_two_factor_options": return twoFactor;
+ case "auth_resend_code": return null;
+ case "auth_send_sms": return null;
+ case "auth_submit_sms_code": return null;
+ case "auth_sign_out": return null;
+ // One refresh covers every service, so there is one command to stub rather than
+ // a pair per screen.
+ case "sync_all":
+ case "sync_status":
+ return {
+ services: [
+ { service: "calendar", label: "Calendar", outcome: "ok", detail: null, lastSyncedAt: Math.floor(Date.now() / 1000) - 120 },
+ { service: "reminders", label: "Reminders", outcome: "ok", detail: null, lastSyncedAt: Math.floor(Date.now() / 1000) - 60 },
+ { service: "notes", label: "Notes", outcome: "ok", detail: null, lastSyncedAt: Math.floor(Date.now() / 1000) - 90 },
+ { service: "contacts", label: "Contacts", outcome: "ok", detail: null, lastSyncedAt: Math.floor(Date.now() / 1000) - 300 },
+ ],
+ asOf: Math.floor(Date.now() / 1000) - 300,
+ tookMs: 40,
+ };
+ // The event plugin is how a finished refresh reaches the screens. Nothing emits in
+ // a plain browser, so listening is a no-op that hands back an unsubscribe id.
+ case "plugin:event|listen":
+ return 0;
+ case "plugin:event|unlisten":
+ return null;
+ default: throw new Error(`unstubbed command: ${cmd}`);
+ }
+ },
+ };
+}
diff --git a/check.sh b/check.sh
index 96d6412..f8268d5 100755
--- a/check.sh
+++ b/check.sh
@@ -37,6 +37,7 @@ step "writing a note" node .uiverify/notes-compose.mjs
step "deleting a note" node .uiverify/notes-trash.mjs
step "uploading" node .uiverify/drive-upload.mjs
step "calendar grids" node .uiverify/calendar.mjs
+step "every size" node .uiverify/sizes.mjs
printf '\n'
if [ "$fail" -eq 0 ]; then printf '\033[32mAll checks passed.\033[0m\n'; else printf '\033[31mSome checks failed.\033[0m\n'; fi