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: Show List Info — the list's name and Apple's twelve colours, shown at once, written as icloud.com writes them

Yashwanth Kamireddi8e8f67723bc7
diff --git a/.uiverify/reminders-list-info.mjs b/.uiverify/reminders-list-info.mjs
new file mode 100644
index 0000000..b80922a
--- /dev/null
+++ b/.uiverify/reminders-list-info.mjs
@@ -0,0 +1,27 @@
+// Show List Info: Apple's twelve colours; choosing one shows at once and is sent as its
+// CloudKit name.
+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 });
+const page = await ctx.newPage();
+await page.goto("http://localhost:4173", { waitUntil: "networkidle" });
+await openScreen(page, "Reminders");
+await page.waitForTimeout(300);
+let failures = 0;
+const ok = (p, m) => { console.log(`${p ? "PASS" : "FAIL"} ${m}`); if (!p) failures++; };
+await page.locator(".rx-list", { hasText: "Daily" }).hover();
+await page.getByRole("button", { name: "Show List Info for Daily" }).click();
+await page.waitForTimeout(200);
+ok((await page.getByRole("radio").count()) === 12, "Apple's twelve colours are offered");
+await page.getByRole("radio", { name: "purple" }).click();
+await page.getByRole("button", { name: "Done" }).click();
+await page.waitForTimeout(150);
+const dot = await page.locator(".rx-list", { hasText: "Daily" }).evaluate((el) => el.outerHTML.toLowerCase().includes("c077db") || el.outerHTML.includes("192, 119, 219"));
+ok(dot, "the list takes the colour at once");
+await page.waitForTimeout(300);
+const sent = await page.evaluate(() => window.__listColours);
+ok(JSON.stringify(sent) === JSON.stringify([["l1", "purple"]]), `sent by its CloudKit name ${JSON.stringify(sent)}`);
+await b.close();
+process.exitCode = failures ? 1 : 0;
diff --git a/.uiverify/stub.mjs b/.uiverify/stub.mjs
index 803e02e..6c42888 100644
--- a/.uiverify/stub.mjs
+++ b/.uiverify/stub.mjs
@@ -152,6 +152,13 @@ export function installStub({ screen, services, twoFactor, calendarFixture, note
case "reminder_set_done": return null;
case "reminder_set_repeat": return null;
case "reminder_edit": return null;
+ case "reminder_list_colour": {
+ (window.__listColours ??= []).push([args.listGuid, args.colour]);
+ const hex = { purple: "#C077DB", red: "#FF3B30", blue: "#007AFF" }[args.colour];
+ const list = reminderLists.find((l) => l.guid === args.listGuid);
+ if (list && hex) list.colour = hex;
+ return null;
+ }
case "reminder_list_create": case "reminder_list_rename": case "reminder_list_delete":
return null;
case "reminders_smart": return !remindersFixture || remindersFixture === "lists" ? [] : reminderItems.filter(r => !r.completedAt);
diff --git a/check.sh b/check.sh
index 29b2ba0..d0fb3ec 100755
--- a/check.sh
+++ b/check.sh
@@ -57,6 +57,7 @@ step "drive trash" node .uiverify/drive-trash.mjs
step "drive info" node .uiverify/drive-info.mjs
step "drive delete" node .uiverify/drive-delete.mjs
step "notes folders" node .uiverify/notes-folders.mjs
+step "list info" node .uiverify/reminders-list-info.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 8f61b8a..027b9c7 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -865,6 +865,27 @@ async fn reminder_list_rename(
resync_reminders(&http, &root, params, &data).await
}
+/// A list's colour, one of Apple's twelve, as Show List Info sets it.
+#[tauri::command]
+async fn reminder_list_colour(
+ list_guid: String,
+ colour: String,
+ auth: State<'_, Auth>,
+ data: State<'_, Data>,
+) -> UiResult<()> {
+ let (http, root, params) = cloudkit_context(&auth).await?;
+ quince_icloud::reminders::set_list_colour_cloudkit(
+ &http,
+ &root,
+ params.clone(),
+ &list_guid,
+ &colour,
+ )
+ .await
+ .map_err(|e| e.to_string())?;
+ resync_reminders(&http, &root, params, &data).await
+}
+
#[tauri::command]
async fn reminder_list_delete(
list_guid: String,
@@ -2312,6 +2333,7 @@ fn main() {
reminder_list_create,
reminder_list_rename,
reminder_list_delete,
+ reminder_list_colour,
note_folders,
note_folder_create,
note_folder_rename,
diff --git a/src/lib/ipc.ts b/src/lib/ipc.ts
index 9dac038..8704b98 100644
--- a/src/lib/ipc.ts
+++ b/src/lib/ipc.ts
@@ -102,6 +102,8 @@ export const api = {
reminderListCreate: (title: string) => invoke<void>("reminder_list_create", { title }),
reminderListRename: (listGuid: string, title: string) =>
invoke<void>("reminder_list_rename", { listGuid, title }),
+ reminderListColour: (listGuid: string, colour: string) =>
+ invoke<void>("reminder_list_colour", { listGuid, colour }),
reminderListDelete: (listGuid: string) =>
invoke<void>("reminder_list_delete", { listGuid }),
/** Reminders still to do holding every word typed, across every list. */
diff --git a/src/screens/RemindersView.tsx b/src/screens/RemindersView.tsx
index 91bc479..50258ae 100644
--- a/src/screens/RemindersView.tsx
+++ b/src/screens/RemindersView.tsx
@@ -159,6 +159,8 @@ type Selection =
export function RemindersView() {
const [lists, setLists] = useState<ReminderList[]>([]);
+ /** The list whose Show List Info sheet is open. */
+ const [infoFor, setInfoFor] = useState<ReminderList | null>(null);
const [groups, setGroups] = useState<ReminderGroup[]>([]);
const [folded, setFolded] = useState<Set<string>>(readFolded);
const toggleFolded = useCallback((guid: string) => {
@@ -769,6 +771,14 @@ export function RemindersView() {
<span className="rx-list-count">{countOf(list.guid)}</span>
</button>
<span className="rx-list-actions">
+ <button
+ className="rx-icon-button"
+ aria-label={`Show List Info for ${list.title}`}
+ title="Show List Info"
+ onClick={() => setInfoFor(list)}
+ >
+ ⓘ
+ </button>
<button
className="rx-icon-button"
aria-label={`Rename ${list.title}`}
@@ -1220,6 +1230,86 @@ export function RemindersView() {
</p>
)}
</section>
+ {infoFor && (
+ <ListInfo
+ list={infoFor}
+ onClose={() => setInfoFor(null)}
+ onDone={(title, colour) => {
+ const list = infoFor;
+ setInfoFor(null);
+ // Shown at once; Apple's answer confirms or puts it back.
+ setLists((ls) => ls.map((l) => (l.guid === list.guid
+ ? { ...l, title: title || l.title, colour: colour ? LIST_COLOURS.find((c) => c.key === colour)!.hex : l.colour }
+ : l)));
+ void listWrite(async () => {
+ if (title && title !== list.title) await api.reminderListRename(list.guid, title);
+ if (colour) await api.reminderListColour(list.guid, colour);
+ });
+ }}
+ />
+ )}
+ </div>
+ );
+}
+
+/** Apple's twelve list colours, in its picker's order, keyed as CloudKit names them. */
+const LIST_COLOURS = [
+ { key: "red", hex: "#FF3B30" }, { key: "orange", hex: "#FF9500" }, { key: "yellow", hex: "#FFCC00" },
+ { key: "green", hex: "#34C759" }, { key: "lightBlue", hex: "#51AAF2" }, { key: "blue", hex: "#007AFF" },
+ { key: "indigo", hex: "#5856D6" }, { key: "pink", hex: "#EA426A" }, { key: "purple", hex: "#C077DB" },
+ { key: "brown", hex: "#A2845E" }, { key: "gray", hex: "#5B6770" }, { key: "rose", hex: "#D9A69F" },
+] as const;
+
+/** Show List Info, as icloud.com's: the list's mark, its name, and Apple's colours. */
+function ListInfo({ list, onClose, onDone }: {
+ list: ReminderList;
+ onClose: () => void;
+ onDone: (title: string, colour: string | null) => void;
+}) {
+ const [title, setTitle] = useState(list.title);
+ const current = LIST_COLOURS.find((c) => c.hex.toLowerCase() === (list.colour ?? "").toLowerCase())?.key ?? null;
+ const [colour, setColour] = useState<string | null>(current);
+ const shown = LIST_COLOURS.find((c) => c.key === colour)?.hex ?? list.colour ?? "#007AFF";
+ useEffect(() => {
+ const onKey = (e: KeyboardEvent) => e.key === "Escape" && onClose();
+ window.addEventListener("keydown", onKey);
+ return () => window.removeEventListener("keydown", onKey);
+ }, [onClose]);
+ const done = () => onDone(title.trim(), colour !== current ? colour : null);
+ return (
+ <div className="modal-veil" onClick={onClose}>
+ <div className="modal-sheet rx-info" role="dialog" aria-label={`\u201c${list.title}\u201d Info`} onClick={(e) => e.stopPropagation()}>
+ <h2>“{list.title}” Info</h2>
+ <span className="rx-info-mark" style={{ background: shown }} aria-hidden="true">
+ <Glyph name="list" />
+ </span>
+ <input
+ className="rx-info-name"
+ value={title}
+ aria-label="List name"
+ style={{ color: shown }}
+ autoFocus
+ onChange={(e) => setTitle(e.target.value)}
+ onKeyDown={(e) => e.key === "Enter" && done()}
+ />
+ <div className="rx-info-colours" role="radiogroup" aria-label="Colour">
+ {LIST_COLOURS.map((c) => (
+ <button
+ key={c.key}
+ role="radio"
+ aria-checked={colour === c.key}
+ aria-label={c.key}
+ className={`rx-info-swatch${colour === c.key ? " is-on" : ""}`}
+ style={{ background: c.hex }}
+ onClick={() => setColour(c.key)}
+ />
+ ))}
+ </div>
+ <div className="rx-info-actions">
+ <button className="quiet" onClick={onClose}>Cancel</button>
+ <button className="primary" onClick={done} disabled={!title.trim()}>Done</button>
+ </div>
+ </div>
</div>
);
}
diff --git a/src/styles/reminders.css b/src/styles/reminders.css
index d82289a..2b7fa50 100644
--- a/src/styles/reminders.css
+++ b/src/styles/reminders.css
@@ -532,3 +532,16 @@
.rx.is-searching { grid-template-rows: auto minmax(0, 1fr); }
.rx .compact-back { align-self: flex-start; margin-bottom: 6px; }
}
+
+/* Show List Info: a centred sheet, the list's mark large in its colour, Apple's swatches. */
+.rx-info { width: min(420px, calc(100vw - 32px)); display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 22px 24px 18px; }
+.rx-info h2 { margin: 0; font-size: var(--t-15); font-weight: 600; }
+.rx-info-mark { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, currentColor 0%, rgba(0,0,0,0.35)); transition: background 160ms ease; }
+.rx-info-mark svg { width: 40px; height: 40px; }
+.rx-info-name { width: 100%; padding: 8px 10px; border: 1px solid var(--separator); border-radius: 8px; background: color-mix(in srgb, var(--text) 5%, transparent); font: inherit; font-size: var(--t-15); font-weight: 600; text-align: center; outline: none; }
+.rx-info-name:focus { border-color: currentColor; }
+.rx-info-colours { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
+.rx-info-swatch { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; box-shadow: none; cursor: pointer; transition: transform 120ms ease; }
+.rx-info-swatch:hover { transform: scale(1.08); }
+.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; }