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.

Verify the app's own sign-in against Apple, and curate the sidebar

Yashwanth Kamireddida5d7eaa7f18
diff --git a/.uiverify/assert.mjs b/.uiverify/assert.mjs
new file mode 100644
index 0000000..1d572d3
--- /dev/null
+++ b/.uiverify/assert.mjs
@@ -0,0 +1,41 @@
+// Deterministic checks on the library nav — cheaper and more reliable than eyeballing a screenshot.
+import { chromium } from "playwright";
+const b = await chromium.launch();
+const ctx = await b.newContext({ viewport: { width: 1040, height: 900 } });
+await ctx.addInitScript(({ services }) => {
+ window.__TAURI_INTERNALS__ = {
+ transformCallback: (cb) => cb,
+ invoke: async (cmd) => {
+ if (cmd === "auth_status") return { hasStoredSession: true, signedIn: true };
+ if (cmd === "auth_resume") return true;
+ if (cmd === "account_services") return services;
+ return null;
+ },
+ };
+}, { 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","schoolwork","settings",
+ "sharedlibrary","sharedstreams","ubiquity","uploadimagews"] });
+
+const p = await ctx.newPage();
+const errs = [];
+p.on("pageerror", (e) => errs.push(String(e)));
+await p.goto("http://localhost:4173", { waitUntil: "networkidle" });
+await p.waitForSelector(".sidebar .nav-item");
+
+const toggle = await p.textContent(".nav-toggle");
+const count = await p.locator(".sidebar .nav-item").count();
+const first = await p.textContent(".sidebar .nav-item");
+const selected = await p.textContent('.nav-item[aria-current="true"]');
+
+console.log("toggle label :", JSON.stringify(toggle?.trim()));
+console.log("nav items :", count, "(10 primary + 1 toggle expected when collapsed)");
+console.log("first item :", JSON.stringify(first?.trim()));
+console.log("selected :", JSON.stringify(selected?.trim()));
+console.log("page errors :", errs.length ? errs : "none");
+
+const collapsed = toggle?.includes("Show") && count === 11;
+console.log(collapsed ? "PASS collapsed by default" : "FAIL not collapsed by default");
+await b.close();
+process.exitCode = collapsed ? 0 : 1;
diff --git a/src/screens/Library.tsx b/src/screens/Library.tsx
index 12a0316..65aa39d 100644
--- a/src/screens/Library.tsx
+++ b/src/screens/Library.tsx
@@ -1,10 +1,6 @@
import { useEffect, useState } from "react";
import { api, messageOf } from "../lib/ipc";
-/** Which services Quince can actually read yet. Empty on purpose: the sync engine is Phase 2,
- * and showing anything else here would be inventing data the app doesn't have. */
-const IMPLEMENTED = new Set<string>();
-
const NAMES: Record<string, string> = {
photos: "Photos",
sharedlibrary: "Shared library",
@@ -41,9 +37,24 @@ const NAMES: Record<string, string> = {
schoolwork: "Schoolwork",
};
+/** What a person actually came for, in the order they'd look for it. */
+const PRIMARY = [
+ "photos",
+ "calendar",
+ "reminders",
+ "notes",
+ "contacts",
+ "drivews",
+ "mail",
+ "findme",
+ "sharedlibrary",
+ "sharedstreams",
+];
+
export function Library({ onSignOut }: { onSignOut: () => void }) {
const [services, setServices] = useState<string[]>([]);
const [selected, setSelected] = useState<string | null>(null);
+ const [showAll, setShowAll] = useState(false);
const [error, setError] = useState<string | null>(null);
useEffect(() => {
@@ -59,43 +70,61 @@ export function Library({ onSignOut }: { onSignOut: () => void }) {
return true;
});
setServices(unique);
- setSelected(unique[0] ?? null);
+ setSelected(PRIMARY.find((k) => unique.includes(k)) ?? unique[0] ?? null);
})
.catch((e) => setError(messageOf(e)));
}, []);
+ const primary = PRIMARY.filter((k) => services.includes(k));
+ // Everything else is infrastructure — real, but not something anyone navigates to.
+ const rest = services.filter((k) => !PRIMARY.includes(k));
+
+ const item = (key: string) => (
+ <button
+ key={key}
+ className="nav-item"
+ aria-current={selected === key}
+ onClick={() => setSelected(key)}
+ >
+ <span>{NAMES[key] ?? key}</span>
+ </button>
+ );
+
return (
<div className="library enter-library">
- <nav className="sidebar" aria-label="Your iCloud services">
- <h2>On your account</h2>
- {services.map((key) => (
- <button
- key={key}
- className="nav-item"
- aria-current={selected === key}
- onClick={() => setSelected(key)}
- >
- <span>{NAMES[key] ?? key}</span>
- {!IMPLEMENTED.has(key) && <span className="badge">soon</span>}
- </button>
- ))}
+ <nav className="sidebar" aria-label="Your iCloud">
+ <h2>Your iCloud</h2>
+ {primary.map(item)}
{services.length === 0 && !error && <p className="badge">Loading…</p>}
+
+ {rest.length > 0 && (
+ <>
+ <button
+ className="nav-item nav-toggle"
+ aria-expanded={showAll}
+ onClick={() => setShowAll((v) => !v)}
+ >
+ <span>{showAll ? "Hide" : "Show"} {rest.length} more</span>
+ </button>
+ {showAll && rest.map(item)}
+ </>
+ )}
</nav>
<main className="content">
<div className="toolbar">
<button className="quiet" onClick={onSignOut}>Sign out</button>
</div>
- <h1>You're signed in</h1>
+ <h1>{selected ? (NAMES[selected] ?? selected) : "You're signed in"}</h1>
<p>
- Quince is holding a live session with Apple, and it will still be here after you
- quit and reopen the app. The list on the left is what Apple actually reports for
- your account — nothing invented.
+ Quince is holding a live session with Apple, and it survived quitting and reopening
+ the app — no password, no code. The list on the left is what Apple reports for your
+ account, nothing invented.
</p>
<p>
- Reading your calendar, reminders and photos into a local library comes next. Until
- then this screen tells you the truth: the connection works, the data layer isn't
- built yet.
+ Reading this into a local library is what comes next, so it opens instantly and
+ works offline. Until then this screen tells you the truth: the connection works,
+ the data layer isn't built yet.
</p>
{error && <p className="error" role="alert">{error}</p>}
</main>
diff --git a/src/styles/app.css b/src/styles/app.css
index 6311b01..aabaea7 100644
--- a/src/styles/app.css
+++ b/src/styles/app.css
@@ -269,6 +269,11 @@
.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; }
+.nav-toggle {
+ margin-top: 6px;
+ color: var(--text-2);
+}
+
.badge {
font-size: var(--t-11);
color: var(--text-3);
@@ -276,7 +281,12 @@
opacity: 0.62;
}
-.nav-item[aria-current="true"] .badge { opacity: 0.85; }
+.nav-item[aria-current="true"] .nav-toggle {
+ margin-top: 6px;
+ color: var(--text-2);
+}
+
+.badge { opacity: 0.85; }
/* Full-bleed, so it passes under the floating sidebar as it scrolls. */
.content {