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 reads each list's colour, icon, group and pin, and is laid out like Apple's

Yashwanth Kamireddi31541d1e3f44
diff --git a/.uiverify/assert.mjs b/.uiverify/assert.mjs
index 1d31d95..b83b7fa 100644
--- a/.uiverify/assert.mjs
+++ b/.uiverify/assert.mjs
@@ -168,7 +168,7 @@ let failures = 0;
);
for (const [screen, selector] of [
- ["Reminders", ".rem-list-name, .rem-smart-name"],
+ ["Reminders", ".rx-list-name, .rx-tile-name"],
["Notes", ".notes-folders .note-folder, .notes-folders button"],
]) {
await page.getByRole("button", { name: screen, exact: true }).click();
@@ -186,8 +186,8 @@ let failures = 0;
await page.getByRole("button", { name: "Reminders", exact: true }).click();
await page.waitForTimeout(400);
const fill = await page.evaluate(() => {
- const pane = document.querySelector(".rem-items");
- const row = document.querySelector(".rem-list-items li, .rem-add");
+ const pane = document.querySelector(".rx-main");
+ const row = document.querySelector(".rx-rows li, .rx-add");
if (!pane || !row) return null;
return row.getBoundingClientRect().width / pane.getBoundingClientRect().width;
});
@@ -200,13 +200,31 @@ let failures = 0;
);
if (fill === null || fill < 0.9) failures++;
+ // A heading is text. Today's time-of-day headings borrowed the app's `.quiet` button class
+ // and came out drawn as buttons — a bordered box around "Morning", "Afternoon", "Tonight".
+ const boxed = await page.evaluate(() =>
+ [...document.querySelectorAll(".rx-section")]
+ .filter((h) => {
+ const cs = getComputedStyle(h);
+ return parseFloat(cs.borderTopWidth) > 0 || cs.boxShadow !== "none" ||
+ cs.backgroundColor !== "rgba(0, 0, 0, 0)";
+ })
+ .map((h) => h.textContent)
+ );
+ console.log(
+ boxed.length === 0
+ ? "PASS section headings are text, not boxes"
+ : `FAIL section headings drawn as controls: ${JSON.stringify(boxed)}`
+ );
+ if (boxed.length > 0) failures++;
+
// The "My Lists" heading belongs on the same left edge as the icons in the rows under it,
// which is where a source list puts a section header. It sat 24px right of both the cards
// above and the icons below, reading as a column that had slipped.
const heading = await page.evaluate(() => {
- const label = document.querySelector(".rem-lists-heading");
- const card = document.querySelector(".rem-smart");
- const icon = document.querySelector(".rem-list-glyph");
+ const label = document.querySelector(".rx-side-heading");
+ const card = document.querySelector(".rx-tile");
+ const icon = document.querySelector(".rx-badge");
if (!label || !card || !icon) return null;
const text = label.getBoundingClientRect().left +
parseFloat(getComputedStyle(label).paddingLeft || "0");
@@ -246,10 +264,10 @@ let failures = 0;
const el = document.querySelector(s);
return el ? +el.getBoundingClientRect().width.toFixed(1) : null;
};
- const cards = [...document.querySelectorAll(".rem-smart")].map(
+ const cards = [...document.querySelectorAll(".rx-tile")].map(
(el) => +el.getBoundingClientRect().width.toFixed(1)
);
- return { grid: width(".rem-smart-grid"), row: width(".rem-list"), cards };
+ return { grid: width(".rx-tiles"), row: width(".rx-list-row:not(.nested) .rx-list"), cards };
});
const evenCards = new Set(column.cards).size <= 1;
const flush = column.grid !== null && column.row !== null &&
@@ -296,10 +314,12 @@ let failures = 0;
await page.close();
}
-// ── What acts on a reminder stays beside it ───────────────────────────────────────────
-// The separators span the whole pane, so the list does not end in mid-air on a wide window.
-// The controls must not span it too: with the text on one stretching column they were pushed
-// to the far edge, about thirteen hundred pixels from the reminder they act on.
+// ── A row's controls behave the way Apple's do ─────────────────────────────────────────
+// Apple keeps a row quiet: info and flag wait at the end of it until it is pointed at, and a
+// flag that is set is information, so it always shows. Controls sitting on every row all the
+// time were most of why the screen read as busy; stranded far from their reminder on a wide
+// window, they read as belonging to nothing. Both are checked: hidden at rest, visible on
+// hover, and every row's controls on one edge so the eye finds them in the same place.
{
const page = await ctx.newPage();
await page.setViewportSize({ width: 1920, height: 1080 });
@@ -307,31 +327,37 @@ let failures = 0;
await page.getByRole("button", { name: "Reminders", exact: true }).click();
await page.waitForTimeout(400);
- // Measured from the start of the row, not from the text element — that one stretches to
- // fill its column, so the gap after it is always the grid gap and says nothing at all. The
- // first version of this check passed against the layout it was written to catch.
- const reach = await page.evaluate(() => {
- const row = document.querySelector(".rem-list-items li");
- const actions = row?.querySelector(".rem-trailing");
- if (!row || !actions) return null;
- const left = row.getBoundingClientRect().left;
- return {
- reach: +(actions.getBoundingClientRect().left - left).toFixed(0),
- rowWidth: +row.getBoundingClientRect().width.toFixed(0),
- };
+ const atRest = await page.evaluate(() => {
+ const row = document.querySelector(".rx-rows li");
+ const info = row?.querySelector(".rx-trailing .rx-icon-button[aria-expanded]");
+ return info ? getComputedStyle(info).opacity : null;
});
- if (!reach) {
- console.log("FAIL could not measure a reminder row");
- failures++;
- } else {
- const close = reach.reach < 900;
- console.log(
- close
- ? `PASS what acts on a reminder stays beside it [${reach.reach}px in, row ${reach.rowWidth}px]`
- : `FAIL the controls sit ${reach.reach}px into a ${reach.rowWidth}px row`
- );
- if (!close) failures++;
- }
+ await page.locator(".rx-rows li").first().hover();
+ await page.waitForTimeout(150);
+ const onHover = await page.evaluate(() => {
+ const row = document.querySelector(".rx-rows li");
+ const info = row?.querySelector(".rx-trailing .rx-icon-button[aria-expanded]");
+ return info ? getComputedStyle(info).opacity : null;
+ });
+ const edges = await page.evaluate(() =>
+ [...document.querySelectorAll(".rx-rows li .rx-trailing")].map(
+ (t) => +t.getBoundingClientRect().right.toFixed(0)
+ )
+ );
+ const quiet = atRest === "0" && onHover === "1";
+ console.log(
+ quiet
+ ? "PASS a row's controls wait until it is pointed at"
+ : `FAIL row controls at rest ${atRest}, on hover ${onHover}`
+ );
+ if (!quiet) failures++;
+ const oneEdge = edges.length > 0 && new Set(edges).size === 1;
+ console.log(
+ oneEdge
+ ? `PASS every row's controls sit on one edge [${edges[0]}px]`
+ : `FAIL row controls are ragged ${JSON.stringify(edges)}`
+ );
+ if (!oneEdge) failures++;
await page.close();
}
@@ -441,8 +467,8 @@ let failures = 0;
await page.fill('input[aria-label="Search reminders"]', "plant");
await page.waitForTimeout(300);
const titles = await page.evaluate(() =>
- [...document.querySelectorAll(".rem-list-items li input")].map((i) => i.value));
- const heads = await page.locator(".rem-section").allInnerTexts();
+ [...document.querySelectorAll(".rx-rows li input")].map((i) => i.value));
+ const heads = await page.locator(".rx-section").allInnerTexts();
const right = JSON.stringify(titles) === JSON.stringify(["Water the plants"]) && heads.includes("Daily");
console.log(
right
@@ -482,13 +508,13 @@ let failures = 0;
await page.goto("http://localhost:4173", { waitUntil: "networkidle" });
await page.getByRole("button", { name: "Reminders", exact: true }).click();
await page.waitForTimeout(300);
- await page.locator(".rem-list", { hasText: "Life Goals" }).click();
+ await page.locator(".rx-list", { hasText: "Life Goals" }).click();
await page.waitForTimeout(400);
const layout = await page.evaluate(() => {
const out = [];
- for (const el of document.querySelectorAll(".rem-section, .rem-list-items li")) {
- out.push(el.matches(".rem-section") ? `#${el.textContent.trim()}` : (el.querySelector("input")?.value ?? ""));
+ for (const el of document.querySelectorAll(".rx-section, .rx-rows li")) {
+ out.push(el.matches(".rx-section") ? `#${el.textContent.trim()}` : (el.querySelector("input")?.value ?? ""));
}
return out;
});
diff --git a/.uiverify/elsewhere.mjs b/.uiverify/elsewhere.mjs
index 27cf16f..c88d1c0 100644
--- a/.uiverify/elsewhere.mjs
+++ b/.uiverify/elsewhere.mjs
@@ -87,7 +87,7 @@ for (const place of PLACES) {
// wrong on the two days a year a clock moves.
await page.getByRole("button", { name: "Reminders", exact: true }).click();
await page.waitForTimeout(400);
- const said = (await page.locator(".rem-list-items").allInnerTexts()).join(" ");
+ const said = (await page.locator(".rx-rows").allInnerTexts()).join(" ");
const muddled = /Tomorrow evening[\s\S]{0,60}\bToday\b/.test(said);
console.log(
muddled
@@ -98,7 +98,7 @@ for (const place of PLACES) {
// A date in a longer language must not spill out of the row that holds it.
const spilling = await page.evaluate(() =>
- [...document.querySelectorAll(".rem-list-items li, .rem-list, .crumb, .rem-smart")].filter(
+ [...document.querySelectorAll(".rx-rows li, .rem-list, .rx-list, .crumb, .rx-tile")].filter(
(el) => el.scrollWidth > el.clientWidth + 2
).length
);
@@ -148,7 +148,7 @@ for (const place of PLACES) {
// A reminder's title is an editable field, so its text is a value rather than content —
// reading innerText alone finds the due label and none of the titles.
const tomorrow = await page.evaluate(() => {
- for (const row of document.querySelectorAll(".rem-list-items li")) {
+ for (const row of document.querySelectorAll(".rx-rows li")) {
const title = row.querySelector("input")?.value ?? "";
if (title.includes("Just after midnight")) return row.innerText;
}
diff --git a/.uiverify/keyboard.mjs b/.uiverify/keyboard.mjs
index aa2292e..da2c746 100644
--- a/.uiverify/keyboard.mjs
+++ b/.uiverify/keyboard.mjs
@@ -216,13 +216,13 @@ const focused = (page) =>
{
const { ctx, page } = await open("library");
await page.getByRole("button", { name: "Reminders" }).click();
- await page.waitForSelector(".rem-list-items li");
+ await page.waitForSelector(".rx-rows li");
// Open a reminder's details, where the pickers live.
- await page.locator(".rem-more").first().click({ force: true });
- await page.waitForSelector(".rem-detail .picker-button");
+ await page.locator(".rx-trailing .rx-icon-button[aria-expanded]").first().click({ force: true });
+ await page.waitForSelector(".rx-detail .picker-button");
- const picker = page.locator(".rem-detail .picker-button").first();
+ const picker = page.locator(".rx-detail .picker-button").first();
const before = await picker.innerText();
await picker.click();
await page.waitForSelector(".picker-menu");
diff --git a/.uiverify/shots.mjs b/.uiverify/shots.mjs
index 6fcfdfc..daf3546 100644
--- a/.uiverify/shots.mjs
+++ b/.uiverify/shots.mjs
@@ -259,10 +259,10 @@ const shots = [
viewport: { width: 1100, height: 760 },
act: async (p) => {
await p.click('.nav-item:has-text("Reminders")');
- await p.waitForSelector(".rem-list-items li");
- await p.click('.rem-list:has-text("Daily")');
+ await p.waitForSelector(".rx-rows li");
+ await p.click('.rx-list:has-text("Daily")');
await p.waitForTimeout(200);
- await p.click('.rem-more >> nth=0');
+ await p.click('.rx-trailing .rx-icon-button[aria-expanded] >> nth=0');
} },
// A full-screen window on a large display is where content stranded in a narrow column
// becomes obvious, and every shot above is too small to show it.
@@ -270,7 +270,7 @@ const shots = [
viewport: { width: 1920, height: 1080 },
act: async (p) => {
await p.click('.nav-item:has-text("Reminders")');
- await p.waitForSelector(".rem-list-items li");
+ await p.waitForSelector(".rx-rows li");
} },
{ name: "15-notes-full", screen: "library", theme: "dark", notesFixture: true,
viewport: { width: 1920, height: 1080 },
diff --git a/crates/quince-core/src/reminders.rs b/crates/quince-core/src/reminders.rs
index c45a71f..fcd66dd 100644
--- a/crates/quince-core/src/reminders.rs
+++ b/crates/quince-core/src/reminders.rs
@@ -22,15 +22,37 @@ pub struct ReminderSection {
/// a view that reaches this can say plainly that it has.
pub const MOST_AT_ONCE: usize = 1_000;
-#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
+#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct ReminderList {
pub guid: String,
pub title: String,
+ /// `#RRGGBB`, whatever form Apple sent it in.
pub colour: Option<String>,
pub ctag: Option<String>,
pub sort_order: i64,
pub enabled: bool,
+ /// Apple's name for the list's glyph, such as `fitness` or `education1`.
+ #[serde(default)]
+ pub emblem: Option<String>,
+ /// The group this list is filed under, where it is in one.
+ #[serde(default)]
+ pub group_guid: Option<String>,
+ /// Shown as a tile beside Today and Scheduled.
+ #[serde(default)]
+ pub pinned: bool,
+ /// How the list orders its reminders: `manual`, `displayDate_asc`, and so on.
+ #[serde(default)]
+ pub sorting: Option<String>,
+}
+
+/// A folder of lists. It holds no reminders of its own.
+#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
+#[serde(rename_all = "camelCase")]
+pub struct ReminderGroup {
+ pub guid: String,
+ pub title: String,
+ pub sort_order: i64,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
@@ -187,11 +209,14 @@ impl Library {
let tx = self.conn.transaction()?;
{
let mut stmt = tx.prepare(
- "INSERT INTO reminder_lists (guid, title, colour, ctag, sort_order, enabled, updated_at)
- VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7)
+ "INSERT INTO reminder_lists (guid, title, colour, ctag, sort_order, enabled,
+ emblem, group_guid, pinned, sorting, updated_at)
+ VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11)
ON CONFLICT(guid) DO UPDATE SET
title = excluded.title, colour = excluded.colour, ctag = excluded.ctag,
sort_order = excluded.sort_order, enabled = excluded.enabled,
+ emblem = excluded.emblem, group_guid = excluded.group_guid,
+ pinned = excluded.pinned, sorting = excluded.sorting,
updated_at = excluded.updated_at",
)?;
let stamp = now();
@@ -203,6 +228,10 @@ impl Library {
l.ctag,
l.sort_order,
i64::from(l.enabled),
+ l.emblem,
+ l.group_guid,
+ i64::from(l.pinned),
+ l.sorting,
stamp
])?;
}
@@ -490,11 +519,14 @@ impl Library {
let tx = self.conn.transaction()?;
{
let mut stmt = tx.prepare(
- "INSERT INTO reminder_lists (guid, title, colour, ctag, sort_order, enabled, updated_at)
- VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7)
+ "INSERT INTO reminder_lists (guid, title, colour, ctag, sort_order, enabled,
+ emblem, group_guid, pinned, sorting, updated_at)
+ VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11)
ON CONFLICT(guid) DO UPDATE SET
title = excluded.title, colour = excluded.colour, ctag = excluded.ctag,
sort_order = excluded.sort_order, enabled = excluded.enabled,
+ emblem = excluded.emblem, group_guid = excluded.group_guid,
+ pinned = excluded.pinned, sorting = excluded.sorting,
updated_at = excluded.updated_at",
)?;
let stamp = now();
@@ -506,6 +538,10 @@ impl Library {
l.ctag,
l.sort_order,
i64::from(l.enabled),
+ l.emblem,
+ l.group_guid,
+ i64::from(l.pinned),
+ l.sorting,
stamp
])?;
}
@@ -603,7 +639,8 @@ impl Library {
pub fn reminder_lists(&self) -> Result<Vec<ReminderList>> {
let mut stmt = self.conn.prepare(
- "SELECT guid, title, colour, ctag, sort_order, enabled
+ "SELECT guid, title, colour, ctag, sort_order, enabled,
+ emblem, group_guid, pinned, sorting
FROM reminder_lists ORDER BY sort_order, title",
)?;
let rows = stmt.query_map([], |row| {
@@ -614,6 +651,43 @@ impl Library {
ctag: row.get(3)?,
sort_order: row.get(4)?,
enabled: row.get::<_, i64>(5)? != 0,
+ emblem: row.get(6)?,
+ group_guid: row.get(7)?,
+ pinned: row.get::<_, i64>(8)? != 0,
+ sorting: row.get(9)?,
+ })
+ })?;
+ Ok(rows.collect::<rusqlite::Result<Vec<_>>>()?)
+ }
+
+ /// Replace the folders lists are filed under.
+ pub fn put_reminder_groups(&mut self, groups: &[ReminderGroup]) -> Result<()> {
+ let tx = self.conn.transaction()?;
+ tx.execute("DELETE FROM reminder_groups", [])?;
+ {
+ let mut stmt = tx.prepare(
+ "INSERT INTO reminder_groups (guid, title, sort_order, updated_at)
+ VALUES (?1, ?2, ?3, ?4)",
+ )?;
+ let stamp = now();
+ for g in groups {
+ stmt.execute(params![g.guid, g.title, g.sort_order, stamp])?;
+ }
+ }
+ tx.commit()?;
+ Ok(())
+ }
+
+ /// The folders lists are filed under, in the order they are shown.
+ pub fn reminder_groups(&self) -> Result<Vec<ReminderGroup>> {
+ let mut stmt = self.conn.prepare(
+ "SELECT guid, title, sort_order FROM reminder_groups ORDER BY sort_order, title",
+ )?;
+ let rows = stmt.query_map([], |row| {
+ Ok(ReminderGroup {
+ guid: row.get(0)?,
+ title: row.get(1)?,
+ sort_order: row.get(2)?,
})
})?;
Ok(rows.collect::<rusqlite::Result<Vec<_>>>()?)
@@ -726,6 +800,7 @@ mod tests {
ctag: None,
sort_order: 0,
enabled: true,
+ ..Default::default()
}
}
@@ -913,6 +988,7 @@ mod smart_tests {
ctag: None,
sort_order: 0,
enabled: true,
+ ..Default::default()
}])
.unwrap();
lib
@@ -1010,6 +1086,7 @@ mod smart_tests {
ctag: None,
sort_order: 0,
enabled: false,
+ ..Default::default()
}])
.unwrap();
for kind in [
@@ -1045,6 +1122,7 @@ mod count_tests {
ctag: None,
sort_order: 0,
enabled: true,
+ ..Default::default()
},
ReminderList {
guid: "L2".into(),
@@ -1053,6 +1131,7 @@ mod count_tests {
ctag: None,
sort_order: 1,
enabled: false,
+ ..Default::default()
},
])
.unwrap();
@@ -1253,6 +1332,7 @@ mod raw_column_tests {
ctag: None,
sort_order: 0,
enabled: true,
+ ..Default::default()
}])
.unwrap();
lib.put_reminders(&[with_raw("Reminder/1"), with_raw("Reminder/2")])
@@ -1303,6 +1383,7 @@ mod bound_tests {
ctag: None,
sort_order: 0,
enabled: true,
+ ..Default::default()
}])
.unwrap();
let rows: Vec<Reminder> = (0..n)
@@ -1503,6 +1584,7 @@ mod section_tests {
ctag: None,
sort_order: 0,
enabled: true,
+ ..Default::default()
}])
.unwrap();
lib.put_reminders(&[
@@ -1634,6 +1716,7 @@ mod search_tests {
ctag: None,
sort_order: 0,
enabled: true,
+ ..Default::default()
}])
.unwrap();
lib.put_reminders(&[
diff --git a/crates/quince-core/src/schema.rs b/crates/quince-core/src/schema.rs
index 2a961e9..205bcb1 100644
--- a/crates/quince-core/src/schema.rs
+++ b/crates/quince-core/src/schema.rs
@@ -294,4 +294,23 @@ pub const MIGRATIONS: &[&str] = &[
CREATE INDEX reminder_sections_by_list ON reminder_sections (list_guid, created_at);
ALTER TABLE reminders ADD COLUMN section_guid TEXT;
"#,
+ // 20 — what a reminders list looks like and where it sits.
+ //
+ // Apple keeps a list's glyph (`BadgeEmblem`), the group it is filed under (`ParentList`),
+ // whether it is pinned beside Today and Scheduled (`PinnedDate`) and how its reminders
+ // are ordered (`SortingStyle`). None of it was read, so every list drew as the same white
+ // dot in one flat column. Groups are folders of lists, kept apart from the lists
+ // themselves so nothing that counts or offers lists can mistake one for a list.
+ r#"
+ ALTER TABLE reminder_lists ADD COLUMN emblem TEXT;
+ ALTER TABLE reminder_lists ADD COLUMN group_guid TEXT;
+ ALTER TABLE reminder_lists ADD COLUMN pinned INTEGER NOT NULL DEFAULT 0;
+ ALTER TABLE reminder_lists ADD COLUMN sorting TEXT;
+ CREATE TABLE reminder_groups (
+ guid TEXT PRIMARY KEY,
+ title TEXT NOT NULL,
+ sort_order INTEGER NOT NULL,
+ updated_at INTEGER NOT NULL
+ ) STRICT;
+ "#,
];
diff --git a/crates/quince-icloud/src/reminders.rs b/crates/quince-icloud/src/reminders.rs
index 6410744..dbfbe6b 100644
--- a/crates/quince-icloud/src/reminders.rs
+++ b/crates/quince-icloud/src/reminders.rs
@@ -33,6 +33,7 @@ fn list_from(v: &Value) -> Option<ReminderList> {
ctag: string(v, "ctag"),
sort_order: v.get("order").and_then(Value::as_i64).unwrap_or(0),
enabled: v.get("enabled").and_then(Value::as_bool).unwrap_or(true),
+ ..Default::default()
})
}
@@ -475,8 +476,12 @@ fn list_from_record(record: &Value) -> Option<ReminderList> {
Some(ReminderList {
guid,
title,
- colour: field::string(record, "Color"),
+ colour: field::string(record, "Color").and_then(|c| hex_colour(&c)),
ctag: None,
+ emblem: field::string(record, "BadgeEmblem").filter(|e| !e.trim().is_empty()),
+ group_guid: field::reference(record, "ParentList"),
+ pinned: is_pinned(record),
+ sorting: field::string(record, "SortingStyle"),
// Apple's List record carries no sort order — the earlier `SortOrder` here read a
// field that has never existed, so every list scored zero and the sidebar came out in
// whatever order the database happened to return. That is why a new reminder always
@@ -491,6 +496,64 @@ fn list_from_record(record: &Value) -> Option<ReminderList> {
})
}
+/// A group record as the folder it is, or `None` for anything else.
+fn group_from_record(record: &Value) -> Option<quince_core::reminders::ReminderGroup> {
+ if field::flag(record, "Deleted") || !field::flag(record, "IsGroup") {
+ return None;
+ }
+ Some(quince_core::reminders::ReminderGroup {
+ guid: field::record_name(record)?,
+ title: field::string(record, "Name")
+ .or_else(|| field::document_text(record, "NameDocument"))
+ .unwrap_or_else(|| "Group".into()),
+ sort_order: 0,
+ })
+}
+
+/// A list's colour as `#RRGGBB`.
+///
+/// CloudKit stores it as JSON — `{"daHexString":"#FFCC00","red":1,…}` — where the older web
+/// service sent the hex alone. Kept as it arrived, the JSON reached the interface as a colour
+/// it could not draw, and every list came out white.
+fn hex_colour(raw: &str) -> Option<String> {
+ let raw = raw.trim();
+ let is_hex = |h: &str| {
+ h.len() == 7 && h.starts_with('#') && h[1..].chars().all(|c| c.is_ascii_hexdigit())
+ };
+ if is_hex(raw) {
+ return Some(raw.to_ascii_uppercase());
+ }
+ let v: Value = serde_json::from_str(raw).ok()?;
+ if let Some(hex) = v.get("daHexString").and_then(Value::as_str) {
+ if is_hex(hex) {
+ return Some(hex.to_ascii_uppercase());
+ }
+ }
+ // Only components: work the hex out from them.
+ let channel = |name: &str| -> Option<u8> {
+ let c = v.get(name)?.as_f64()?;
+ #[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
+ Some((c.clamp(0.0, 1.0) * 255.0).round() as u8)
+ };
+ Some(format!(
+ "#{:02X}{:02X}{:02X}",
+ channel("red")?,
+ channel("green")?,
+ channel("blue")?
+ ))
+}
+
+/// Whether a list is pinned beside Today and Scheduled.
+///
+/// Unpinning does not clear `PinnedDate`; it sets it to the first day of year one, which as
+/// milliseconds since 1970 is a large negative number. Only a real date means pinned.
+fn is_pinned(record: &Value) -> bool {
+ record
+ .pointer("/fields/PinnedDate/value")
+ .and_then(Value::as_i64)
+ .is_some_and(|ms| ms > 0)
+}
+
/// The order lists appear in on the user's other devices.
///
/// Apple keeps this in a ManualSortHint record whose payload is JSON, despite the field
@@ -707,6 +770,7 @@ pub fn apply_cloudkit(
let mut gone_reminders: Vec<String> = Vec::new();
let mut gone_lists: Vec<String> = Vec::new();
let mut list_order: Vec<String> = Vec::new();
+ let mut groups: Vec<quince_core::reminders::ReminderGroup> = Vec::new();
// A RecurrenceRule is its own record pointing back at the reminder it governs.
let mut rules: std::collections::HashMap<String, (i64, i64)> = std::collections::HashMap::new();
@@ -749,13 +813,18 @@ pub fn apply_cloudkit(
"List" => {
if removed {
gone_lists.push(name);
+ } else if let Some(mut group) = group_from_record(record) {
+ // One count across groups and lists, so a group sits among the lists
+ // where Apple walks it rather than in a separate run of its own.
+ group.sort_order = i64::try_from(lists.len() + groups.len()).unwrap_or(0);
+ groups.push(group);
} else if let Some(mut list) = list_from_record(record) {
// Apple walks the zone in a stable order that is the same on every device,
// and a List record carries no date or rank of its own. Keeping the
// position it arrived in is what stops the sidebar coming out differently
// on every refresh — which is what made a new reminder seem to land in an
// arbitrary list.
- list.sort_order = i64::try_from(lists.len()).unwrap_or(0);
+ list.sort_order = i64::try_from(lists.len() + groups.len()).unwrap_or(0);
lists.push(list);
}
}
@@ -812,6 +881,7 @@ pub fn apply_cloudkit(
ctag: None,
sort_order: 0,
enabled: true,
+ ..Default::default()
});
}
}
@@ -832,6 +902,26 @@ pub fn apply_cloudkit(
} else {
library.put_reminder_lists(&lists)?;
}
+ // Groups: a full pass has every one; an incremental pass only the ones that changed, laid
+ // over what is stored, less any that were deleted.
+ let groups = if incremental {
+ let mut merged = library.reminder_groups()?;
+ for group in groups {
+ match merged.iter_mut().find(|g| g.guid == group.guid) {
+ Some(existing) => existing.title = group.title,
+ None => {
+ let mut group = group;
+ group.sort_order = i64::try_from(merged.len()).unwrap_or(0);
+ merged.push(group);
+ }
+ }
+ }
+ merged.retain(|g| !gone_lists.contains(&g.guid));
+ merged
+ } else {
+ groups
+ };
+ library.put_reminder_groups(&groups)?;
library.put_reminders(&reminders)?;
if !gone_reminders.is_empty() || !gone_lists.is_empty() {
library.forget_reminders(&gone_reminders, &gone_lists)?;
@@ -2263,6 +2353,7 @@ mod order_tests {
ctag: None,
sort_order: 0,
enabled: true,
+ ..Default::default()
}
}
@@ -2728,6 +2819,7 @@ mod tombstone_tests {
ctag: None,
sort_order: 0,
enabled: true,
+ ..Default::default()
}])
.unwrap();
library
@@ -3104,6 +3196,71 @@ mod list_shape_tests {
})
}
+ /// What a list record on a real account carries, copied from one.
+ fn gym_record() -> Value {
+ json!({
+ "recordName": "List/B54667C9-8785-4A05-B669-EACC5DA5E2DE",
+ "recordType": "List",
+ "fields": {
+ "Name": { "type": "STRING", "value": "GYM" },
+ "IsGroup": { "type": "NUMBER_INT64", "value": 0 },
+ "BadgeEmblem": { "type": "STRING", "value": "fitness" },
+ "Color": { "type": "STRING", "value": "{\"alpha\":1,\"red\":0,\"colorRGBSpace\":2,\"daHexString\":\"#0088FF\",\"ckSymbolicColorName\":\"blue\",\"green\":0.53333333333333333,\"daSymbolicColorName\":\"blue\",\"blue\":1}" },
+ "ParentList": { "type": "REFERENCE", "value": { "recordName": "List/43A40727-5DAF-4107-B7C9-6B9161592F5D", "action": "VALIDATE" } },
+ "PinnedDate": { "type": "TIMESTAMP", "value": 1781974802494_i64 },
+ "SortingStyle": { "type": "STRING", "value": "displayDate_asc" },
+ }
+ })
+ }
+
+ /// The colour arrives as JSON; stored as it came, every list drew white.
+ #[test]
+ fn a_list_keeps_its_colour_glyph_group_and_order() {
+ let l = list_from_record(&gym_record()).unwrap();
+ assert_eq!(l.colour.as_deref(), Some("#0088FF"));
+ assert_eq!(l.emblem.as_deref(), Some("fitness"));
+ assert_eq!(
+ l.group_guid.as_deref(),
+ Some("List/43A40727-5DAF-4107-B7C9-6B9161592F5D")
+ );
+ assert!(l.pinned);
+ assert_eq!(l.sorting.as_deref(), Some("displayDate_asc"));
+ }
+
+ #[test]
+ fn a_colour_is_read_in_every_form_it_comes_in() {
+ assert_eq!(hex_colour("#ffcc00").as_deref(), Some("#FFCC00"));
+ assert_eq!(
+ hex_colour("{\"daHexString\":\"#5AC8FA\",\"red\":0.35}").as_deref(),
+ Some("#5AC8FA")
+ );
+ // Components alone, the hex worked out from them.
+ assert_eq!(
+ hex_colour("{\"red\":1,\"green\":0.8,\"blue\":0}").as_deref(),
+ Some("#FFCC00")
+ );
+ for rubbish in ["", "blue", "{}", "{\"red\":\"x\"}", "#12345", "#GGGGGG"] {
+ assert_eq!(hex_colour(rubbish), None, "{rubbish:?}");
+ }
+ }
+
+ /// Unpinning leaves a date in year one behind rather than clearing the field.
+ #[test]
+ fn a_list_unpinned_on_the_phone_is_not_pinned() {
+ let mut r = gym_record();
+ r["fields"]["PinnedDate"]["value"] = json!(-62_135_769_600_000_i64);
+ assert!(!list_from_record(&r).unwrap().pinned);
+ r["fields"].as_object_mut().unwrap().remove("PinnedDate");
+ assert!(!list_from_record(&r).unwrap().pinned);
+ }
+
+ #[test]
+ fn a_group_is_kept_as_a_group() {
+ let g = group_from_record(&list_record("List/A", "Life", true)).unwrap();
+ assert_eq!((g.guid.as_str(), g.title.as_str()), ("List/A", "Life"));
+ assert!(group_from_record(&list_record("List/B", "GYM", false)).is_none());
+ }
+
/// A group is a folder of lists. Two of the nine on a real account are groups, and shown as
/// lists they read as permanently empty — and can be chosen as the place to file a reminder,
/// which puts it where the phone will not show it.
@@ -3143,6 +3300,7 @@ mod list_shape_tests {
ctag: None,
sort_order: i64::try_from(i).unwrap(),
enabled: true,
+ ..Default::default()
})
.collect();
let before: Vec<i64> = lists.iter().map(|l| l.sort_order).collect();
@@ -3167,6 +3325,7 @@ mod list_shape_tests {
ctag: None,
sort_order: i64::try_from(i).unwrap(),
enabled: true,
+ ..Default::default()
})
.collect();
apply_list_order(&mut lists, &["B".into(), "A".into()]);
@@ -3240,6 +3399,7 @@ mod other_accounts_tests {
ctag: None,
sort_order: 0,
enabled: true,
+ ..Default::default()
}];
apply_list_order(&mut lists, &[]);
assert_eq!(lists[0].sort_order, 0);
diff --git a/probe/examples/at_scale.rs b/probe/examples/at_scale.rs
index a96f371..851222f 100644
--- a/probe/examples/at_scale.rs
+++ b/probe/examples/at_scale.rs
@@ -28,6 +28,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
ctag: None,
sort_order: i,
enabled: true,
+ ..Default::default()
})
.collect();
lib.put_reminder_lists(&lists)?;
diff --git a/probe/examples/ui_fixture.rs b/probe/examples/ui_fixture.rs
new file mode 100644
index 0000000..7de9953
--- /dev/null
+++ b/probe/examples/ui_fixture.rs
@@ -0,0 +1,50 @@
+//! Throwaway: the real account through the real sync, as the Reminders screen would receive
+//! it, written out so the interface can be looked at against real data.
+use anyhow::{anyhow, Result};
+use quince_core::reminders::SmartList;
+use serde_json::json;
+
+#[tokio::main]
+async fn main() -> Result<()> {
+ let dir = std::path::PathBuf::from(std::env::var("HOME")?).join(".local/share/quince-probe");
+ let mut client = quince_auth::Client::new(&dir)?;
+ if !client.resume().await? {
+ return Err(anyhow!("no session"));
+ }
+ let root = client
+ .session()
+ .service_url("ckdatabasews")
+ .ok_or_else(|| anyhow!("no ck"))?;
+ let http = client.http().clone();
+ let store = std::env::temp_dir().join(format!("quince-{}", uuid::Uuid::new_v4()));
+ std::fs::create_dir_all(&store)?;
+ let mut lib = quince_core::Library::open(&store)?;
+ quince_icloud::reminders::sync_cloudkit(&http, &root, client.service_params(), &mut lib, None)
+ .await?;
+ let until: i64 = std::env::args()
+ .nth(1)
+ .ok_or_else(|| anyhow!("until"))?
+ .parse()?;
+ let lists = lib.reminder_lists()?;
+ let mut by_list = serde_json::Map::new();
+ let mut sections = serde_json::Map::new();
+ for l in &lists {
+ by_list.insert(l.guid.clone(), json!(lib.reminders_in(&l.guid, false)?));
+ sections.insert(l.guid.clone(), json!(lib.reminder_sections(&l.guid)?));
+ }
+ let out = json!({
+ "lists": lists,
+ "groups": lib.reminder_groups()?,
+ "counts": lib.reminder_counts(until)?,
+ "smart": {
+ "today": lib.reminders_smart(SmartList::Today, until)?,
+ "scheduled": lib.reminders_smart(SmartList::Scheduled, until)?,
+ "all": lib.reminders_smart(SmartList::All, until)?,
+ "flagged": lib.reminders_smart(SmartList::Flagged, until)?,
+ },
+ "byList": by_list,
+ "sections": sections,
+ });
+ println!("{out}");
+ Ok(())
+}
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index f5ffc69..f96352c 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -401,6 +401,15 @@ async fn reminder_lists(data: State<'_, Data>) -> UiResult<Vec<ReminderList>> {
library.reminder_lists().map_err(|e| e.to_string())
}
+/// The folders lists are filed under.
+#[tauri::command]
+async fn reminder_groups(
+ data: State<'_, Data>,
+) -> UiResult<Vec<quince_core::reminders::ReminderGroup>> {
+ let library = data.0.lock().await;
+ library.reminder_groups().map_err(|e| e.to_string())
+}
+
#[tauri::command]
async fn reminders_in(
list_guid: String,
@@ -1457,6 +1466,7 @@ fn main() {
event_delete,
calendar_list,
reminder_lists,
+ reminder_groups,
reminder_sections,
reminders_search,
reminder_counts,
diff --git a/src/components/Glyph.tsx b/src/components/Glyph.tsx
index 996aaa8..7f9ef22 100644
--- a/src/components/Glyph.tsx
+++ b/src/components/Glyph.tsx
@@ -6,7 +6,23 @@
* different weight, size and baseline, so the row of them never lined up and never looked
* like it came from the same hand. These are one stroke weight on one grid.
*/
-export type GlyphName = "today" | "scheduled" | "all" | "flagged" | "list";
+export type GlyphName =
+ | "today"
+ | "scheduled"
+ | "all"
+ | "flagged"
+ | "list"
+ | "bullets"
+ | "fitness"
+ | "education"
+ | "home"
+ | "idea"
+ | "sun"
+ | "folder"
+ | "plus"
+ | "info"
+ | "chevron"
+ | "search";
const PATHS: Record<GlyphName, React.ReactNode> = {
// A calendar page with the day marked — what Today means.
@@ -42,8 +58,102 @@ const PATHS: Record<GlyphName, React.ReactNode> = {
),
// A list you made yourself, in its own colour.
list: <circle cx="8" cy="8" r="4.4" fill="currentColor" stroke="none" />,
+ // The glyph a list gets when it has chosen none: Apple's bulleted list.
+ bullets: (
+ <>
+ <path d="M6.2 4.8h6.3M6.2 8h6.3M6.2 11.2h6.3" />
+ <circle cx="3.8" cy="4.8" r="0.95" fill="currentColor" stroke="none" />
+ <circle cx="3.8" cy="8" r="0.95" fill="currentColor" stroke="none" />
+ <circle cx="3.8" cy="11.2" r="0.95" fill="currentColor" stroke="none" />
+ </>
+ ),
+ fitness: (
+ <>
+ <path d="M5.5 8h5" />
+ <rect x="3.2" y="5" width="2.3" height="6" rx="0.8" />
+ <rect x="10.5" y="5" width="2.3" height="6" rx="0.8" />
+ <path d="M1.9 6.8v2.4M14.1 6.8v2.4" />
+ </>
+ ),
+ education: (
+ <>
+ <path d="M8 4.6c-1.6-1-3.6-1.2-5.3-.7v8.2c1.7-.5 3.7-.3 5.3.7 1.6-1 3.6-1.2 5.3-.7V3.9c-1.7-.5-3.7-.3-5.3.7z" />
+ <path d="M8 4.6v8.2" />
+ </>
+ ),
+ home: (
+ <>
+ <path d="M2.6 7.4 8 3l5.4 4.4" />
+ <path d="M4.2 6.3v6.4h7.6V6.3" />
+ <path d="M6.8 12.7V9.6h2.4v3.1" />
+ </>
+ ),
+ idea: (
+ <>
+ <path d="M5.9 10.4c-.9-.7-1.6-1.8-1.6-3.1a3.7 3.7 0 0 1 7.4 0c0 1.3-.7 2.4-1.6 3.1v1.2H5.9z" />
+ <path d="M6.3 13.4h3.4" />
+ </>
+ ),
+ sun: (
+ <>
+ <circle cx="8" cy="8" r="2.6" />
+ <path d="M8 1.9v1.5M8 12.6v1.5M1.9 8h1.5M12.6 8h1.5M3.7 3.7l1 1M11.3 11.3l1 1M3.7 12.3l1-1M11.3 4.7l1-1" />
+ </>
+ ),
+ folder: (
+ <path d="M2.4 4.6c0-.6.5-1.1 1.1-1.1h2.6l1.4 1.5h5c.6 0 1.1.5 1.1 1.1v5.8c0 .6-.5 1.1-1.1 1.1h-9c-.6 0-1.1-.5-1.1-1.1z" />
+ ),
+ plus: <path d="M8 3.5v9M3.5 8h9" />,
+ info: (
+ <>
+ <circle cx="8" cy="8" r="5.6" />
+ <path d="M8 7.4v3.6" />
+ <circle cx="8" cy="5.2" r="0.8" fill="currentColor" stroke="none" />
+ </>
+ ),
+ chevron: <path d="M6 4.5 9.5 8 6 11.5" />,
+ search: (
+ <>
+ <circle cx="7" cy="7" r="4" />
+ <path d="m10 10 3 3" />
+ </>
+ ),
};
+/**
+ * The glyph for one of Apple's list emblems.
+ *
+ * Apple names them by family and number — `fitness`, `education1`, `lifestyle2` — and draws
+ * them with SF Symbols, which cannot be shipped outside Apple's platforms. Each family gets
+ * the drawn glyph nearest its meaning; one this does not know gets the plain bulleted list
+ * rather than a guess.
+ */
+export function emblemGlyph(emblem: string | null | undefined): GlyphName {
+ const family = (emblem ?? "").replace(/\d+$/, "").toLowerCase();
+ switch (family) {
+ case "fitness":
+ case "sports":
+ case "health":
+ return "fitness";
+ case "education":
+ case "school":
+ case "book":
+ return "education";
+ case "lifestyle":
+ case "home":
+ case "house":
+ return "home";
+ case "concept":
+ case "idea":
+ return "idea";
+ case "weather":
+ case "nature":
+ return "sun";
+ default:
+ return "bullets";
+ }
+}
+
export function Glyph({ name, className }: { name: GlyphName; className?: string }) {
return (
<svg
diff --git a/src/lib/ipc.ts b/src/lib/ipc.ts
index b1b3a8e..3dbea43 100644
--- a/src/lib/ipc.ts
+++ b/src/lib/ipc.ts
@@ -62,6 +62,7 @@ export const api = {
reminderCounts: (until: number) => invoke<ReminderCounts>("reminder_counts", { until }),
reminderLists: () => invoke<ReminderList[]>("reminder_lists"),
+ reminderGroups: () => invoke<ReminderGroup[]>("reminder_groups"),
/** The headings inside one list, in the order they were made. */
reminderSections: (listGuid: string) =>
invoke<ReminderSection[]>("reminder_sections", { listGuid }),
@@ -200,8 +201,19 @@ export type ReminderList = {
ctag: string | null;
sortOrder: number;
enabled: boolean;
+ /** Apple's name for the list's glyph, such as "fitness". */
+ emblem?: string | null;
+ /** The group this list is filed under. */
+ groupGuid?: string | null;
+ /** Shown as a tile beside Today and Scheduled. */
+ pinned?: boolean;
+ /** How the list orders its reminders: "manual", "displayDate_asc", … */
+ sorting?: string | null;
};
+/** A folder of lists in the Reminders sidebar. */
+export type ReminderGroup = { guid: string; title: string; sortOrder: number };
+
/** A heading inside a reminders list. */
export type ReminderSection = {
guid: string;
diff --git a/src/main.tsx b/src/main.tsx
index 559b0e0..43061eb 100644
--- a/src/main.tsx
+++ b/src/main.tsx
@@ -3,6 +3,7 @@ import ReactDOM from "react-dom/client";
import App from "./App";
import "./styles/tokens.css";
import "./styles/app.css";
+import "./styles/reminders.css";
ReactDOM.createRoot(document.getElementById("root")!).render(
<React.StrictMode>
diff --git a/src/screens/RemindersView.tsx b/src/screens/RemindersView.tsx
index 37d884a..9d53a1d 100644
--- a/src/screens/RemindersView.tsx
+++ b/src/screens/RemindersView.tsx
@@ -4,6 +4,7 @@ import {
MOST_AT_ONCE,
messageOf,
type Reminder,
+ type ReminderGroup,
type ReminderList,
type ReminderSection,
type ReminderCounts,
@@ -11,17 +12,30 @@ import {
} from "../lib/ipc";
import { useSync } from "../lib/sync";
import { Picker } from "../components/Picker";
-import { Glyph, type GlyphName } from "../components/Glyph";
+import { Glyph, emblemGlyph, type GlyphName } from "../components/Glyph";
-/** Apple's built-in views, which is how most people enter Reminders. */
-/** Apple's built-in views, in Apple's order, each with the glyph and colour its app uses. */
+/** Apple's built-in views, in Apple's order, each with the glyph and system colour its app uses. */
const SMART: { kind: SmartList; title: string; glyph: GlyphName; colour: string }[] = [
- { kind: "today", title: "Today", glyph: "today", colour: "#0a84ff" },
- { kind: "scheduled", title: "Scheduled", glyph: "scheduled", colour: "#ff453a" },
- { kind: "all", title: "All", glyph: "all", colour: "#8e8e93" },
- { kind: "flagged", title: "Flagged", glyph: "flagged", colour: "#ff9f0a" },
+ { kind: "today", title: "Today", glyph: "today", colour: "var(--sys-blue)" },
+ { kind: "scheduled", title: "Scheduled", glyph: "scheduled", colour: "var(--sys-red)" },
+ { kind: "all", title: "All", glyph: "all", colour: "var(--sys-gray)" },
+ { kind: "flagged", title: "Flagged", glyph: "flagged", colour: "var(--sys-orange)" },
];
+/** A list's own colour, or Apple's blue for one that has none. */
+const colourOf = (list: ReminderList | undefined | null) => list?.colour || "var(--sys-blue)";
+
+/** Groups the viewer has folded shut, remembered on this computer. */
+const FOLDED_KEY = "quince.reminders.folded";
+function readFolded(): Set<string> {
+ try {
+ const raw = window.localStorage.getItem(FOLDED_KEY);
+ return new Set(raw ? (JSON.parse(raw) as string[]) : []);
+ } catch {
+ return new Set();
+ }
+}
+
/** End of today in the viewer's own timezone — the interface knows it, the backend doesn't. */
function endOfToday(): number {
const d = new Date();
@@ -142,6 +156,21 @@ type Selection =
export function RemindersView() {
const [lists, setLists] = useState<ReminderList[]>([]);
+ const [groups, setGroups] = useState<ReminderGroup[]>([]);
+ const [folded, setFolded] = useState<Set<string>>(readFolded);
+ const toggleFolded = useCallback((guid: string) => {
+ setFolded((was) => {
+ const next = new Set(was);
+ if (next.has(guid)) next.delete(guid);
+ else next.add(guid);
+ try {
+ window.localStorage.setItem(FOLDED_KEY, JSON.stringify([...next]));
+ } catch {
+ // Without storage the fold still works; it is forgotten on restart.
+ }
+ return next;
+ });
+ }, []);
const [selection, setSelection] = useState<Selection>({
type: "smart",
kind: "today",
@@ -171,11 +200,14 @@ export function RemindersView() {
const listGuid = inList ? selection.guid : null;
const readLists = useCallback(async () => {
- const [found, tally] = await Promise.all([
+ const [found, tally, folders] = await Promise.all([
api.reminderLists(),
api.reminderCounts(endOfToday()),
+ // An older library without groups is still a working one.
+ api.reminderGroups().catch(() => [] as ReminderGroup[]),
]);
setLists(Array.isArray(found) ? found : []);
+ setGroups(Array.isArray(folders) ? folders : []);
setCounts(tally);
setLoaded(true);
}, []);
@@ -618,115 +650,229 @@ export function RemindersView() {
}));
}, [threaded, inList, selection, lists, listSections, searching]);
- return (
- <div className="rem">
- <aside className="rem-lists" aria-label="Reminder lists">
- {/* Apple's own arrangement: the four built-in views as a grid of tiles, each
- with its glyph and its count, above the lists you made yourself. */}
- <div className="rem-smart-grid">
- {SMART.map((smart) => (
+ const countOf = (guid: string) => counts?.lists.find(([g]) => g === guid)?.[1] ?? 0;
+ const openList = inList ? (lists.find((l) => l.guid === listGuid) ?? null) : null;
+ const smartOpen =
+ selection.type === "smart" ? SMART.find((x) => x.kind === selection.kind) : undefined;
+ /** The colour the open view is drawn in: its list's, or its built-in view's. */
+ const accent = searching
+ ? "var(--text)"
+ : openList
+ ? colourOf(openList)
+ : (smartOpen?.colour ?? "var(--sys-blue)");
+
+ /**
+ * The sidebar in Apple's order: a list or group at the top level wherever it was walked,
+ * with a group's lists beneath it. Pinned lists are tiles instead, as on the phone.
+ */
+ const pinned = lists.filter((l) => l.pinned);
+ const topLevel = [
+ ...lists
+ .filter((l) => !l.pinned && !(l.groupGuid && groups.some((g) => g.guid === l.groupGuid)))
+ .map((list) => ({ kind: "list" as const, order: list.sortOrder, list })),
+ ...groups.map((group) => ({ kind: "group" as const, order: group.sortOrder, group })),
+ ].sort((a, b) => a.order - b.order);
+ const inGroup = (guid: string) => lists.filter((l) => !l.pinned && l.groupGuid === guid);
+
+ const listRow = (list: ReminderList, nested: boolean) => (
+ <div className={`rx-list-row${nested ? " nested" : ""}`} key={list.guid}>
+ {renaming === list.guid ? (
+ <input
+ className="rx-rename"
+ defaultValue={list.title}
+ autoFocus
+ aria-label={`Rename ${list.title}`}
+ onBlur={(e) => {
+ const title = e.target.value.trim();
+ setRenaming(null);
+ if (title && title !== list.title) {
+ void listWrite(() => api.reminderListRename(list.guid, title));
+ }
+ }}
+ onKeyDown={(e) => {
+ if (e.key === "Enter") e.currentTarget.blur();
+ if (e.key === "Escape") {
+ e.currentTarget.value = list.title;
+ e.currentTarget.blur();
+ }
+ }}
+ />
+ ) : (
+ <>
+ <button
+ className="rx-list"
+ aria-current={listGuid === list.guid}
+ onClick={() => {
+ setQuery("");
+ setSelection({ type: "list", guid: list.guid });
+ }}
+ onDoubleClick={() => setRenaming(list.guid)}
+ >
+ <span className="rx-badge" style={{ background: colourOf(list) }}>
+ <Glyph name={emblemGlyph(list.emblem)} />
+ </span>
+ <span className="rx-list-name">{list.title}</span>
+ <span className="rx-list-count">{countOf(list.guid)}</span>
+ </button>
+ <span className="rx-list-actions">
+ <button
+ className="rx-icon-button"
+ aria-label={`Rename ${list.title}`}
+ title="Rename"
+ onClick={() => setRenaming(list.guid)}
+ >
+ ✎
+ </button>
<button
- key={smart.kind}
- className="rem-smart"
- aria-current={
- selection.type === "smart" && selection.kind === smart.kind
- }
- aria-label={`${smart.title}, ${counts?.[smart.kind] ?? 0} reminders`}
- onClick={() => setSelection({ type: "smart", kind: smart.kind })}
+ className="rx-icon-button danger"
+ aria-label={`Delete ${list.title}`}
+ title="Delete"
+ onClick={() => {
+ // Deleting a list takes its reminders, so ask before doing it.
+ if (window.confirm(`Delete "${list.title}" and everything in it?`)) {
+ void listWrite(() => api.reminderListDelete(list.guid));
+ }
+ }}
>
- <span className="rem-smart-top">
- <span className="rem-smart-glyph" style={{ background: smart.colour }}>
- <Glyph name={smart.glyph} />
- </span>
- <span className="rem-smart-count">{counts?.[smart.kind] ?? 0}</span>
- </span>
- <span className="rem-smart-name">{smart.title}</span>
+ ×
</button>
- ))}
+ </span>
+ </>
+ )}
+ </div>
+ );
+
+ const tile = (
+ key: string,
+ title: string,
+ glyph: GlyphName,
+ colour: string,
+ count: number,
+ current: boolean,
+ choose: () => void,
+ ) => (
+ <button
+ key={key}
+ className="rx-tile"
+ aria-current={current}
+ aria-label={`${title}, ${count} reminders`}
+ style={{ "--tile": colour } as React.CSSProperties}
+ onClick={() => {
+ setQuery("");
+ choose();
+ }}
+ >
+ <span className="rx-tile-glyph">
+ <Glyph name={glyph} />
+ </span>
+ <span className="rx-tile-count">{count}</span>
+ <span className="rx-tile-name">{title}</span>
+ </button>
+ );
+
+ /** Where a reminder typed at the foot of the view is filed, when that is a choice. */
+ const addRow = targetListGuid && !searching && (
+ <form className="rx-add" onSubmit={add}>
+ <span className="rx-tick ghost" aria-hidden="true">
+ <Glyph name="plus" />
+ </span>
+ <input
+ value={draft}
+ onChange={(e) => setDraft(e.target.value)}
+ placeholder="New Reminder"
+ aria-label={
+ inList ? `Add a reminder to ${heading}` : `Add a reminder to ${targetList?.title ?? "a list"}`
+ }
+ disabled={syncing}
+ />
+ {/* From a built-in view, where it lands is a real choice, so it is shown — but only
+ once something is being typed, not as a permanent control on the screen. */}
+ {!inList && targetList && lists.length > 1 && draft.trim() && (
+ <Picker
+ className="rx-add-target"
+ label="List to add to"
+ value={targetListGuid ?? ""}
+ onChange={chooseList}
+ options={lists.map((l) => ({ value: l.guid, label: l.title }))}
+ />
+ )}
+ </form>
+ );
+
+ return (
+ <div className="rx" style={{ "--accent": accent } as React.CSSProperties}>
+ <aside className="rx-side" aria-label="Reminder lists">
+ <label className="rx-search">
+ <Glyph name="search" />
+ <input
+ type="search"
+ placeholder="Search"
+ aria-label="Search reminders"
+ value={query}
+ onChange={(e) => setQuery(e.target.value)}
+ onKeyDown={(e) => {
+ if (e.key === "Escape") setQuery("");
+ }}
+ />
+ </label>
+
+ <div className="rx-tiles">
+ {SMART.map((smart) =>
+ tile(
+ smart.kind,
+ smart.title,
+ smart.glyph,
+ smart.colour,
+ counts?.[smart.kind] ?? 0,
+ !searching && selection.type === "smart" && selection.kind === smart.kind,
+ () => setSelection({ type: "smart", kind: smart.kind }),
+ ),
+ )}
+ {pinned.map((list) =>
+ tile(
+ list.guid,
+ list.title,
+ emblemGlyph(list.emblem),
+ colourOf(list),
+ countOf(list.guid),
+ !searching && listGuid === list.guid,
+ () => setSelection({ type: "list", guid: list.guid }),
+ ),
+ )}
</div>
- <p className="rem-lists-heading">My Lists</p>
- {lists.map((list) => (
- <div className="rem-list-row" key={list.guid}>
- {renaming === list.guid ? (
- <input
- className="rem-list-rename"
- defaultValue={list.title}
- autoFocus
- aria-label={`Rename ${list.title}`}
- onBlur={(e) => {
- const title = e.target.value.trim();
- setRenaming(null);
- if (title && title !== list.title) {
- void listWrite(() =>
- api.reminderListRename(list.guid, title),
- );
- }
- }}
- onKeyDown={(e) => {
- if (e.key === "Enter") e.currentTarget.blur();
- if (e.key === "Escape") {
- e.currentTarget.value = list.title;
- e.currentTarget.blur();
- }
- }}
- />
+ <p className="rx-side-heading">My Lists</p>
+ <div className="rx-lists">
+ {topLevel.map((entry) =>
+ entry.kind === "list" ? (
+ listRow(entry.list, false)
) : (
- <>
+ <div className="rx-group" key={entry.group.guid}>
<button
- className="rem-list"
- aria-current={listGuid === list.guid}
- onClick={() =>
- setSelection({ type: "list", guid: list.guid })
- }
- onDoubleClick={() => setRenaming(list.guid)}
+ className="rx-group-row"
+ aria-expanded={!folded.has(entry.group.guid)}
+ onClick={() => toggleFolded(entry.group.guid)}
>
- <span
- className="rem-list-glyph"
- style={{ color: list.colour || "var(--gold)" }}
- >
- <Glyph name="list" />
+ <span className="rx-group-glyph">
+ <Glyph name="folder" />
</span>
- <span className="rem-list-name">{list.title}</span>
- <span className="rem-list-count">
- {counts?.lists.find(([guid]) => guid === list.guid)?.[1] ?? 0}
+ <span className="rx-list-name">{entry.group.title}</span>
+ <span className="rx-chevron">
+ <Glyph name="chevron" />
</span>
</button>
- <span className="rem-list-actions">
- <button
- className="rem-list-action"
- aria-label={`Rename ${list.title}`}
- onClick={() => setRenaming(list.guid)}
- >
- ✎
- </button>
- <button
- className="rem-list-action danger"
- aria-label={`Delete ${list.title}`}
- onClick={() => {
- // Deleting a list takes its reminders, so ask before doing it.
- if (
- window.confirm(
- `Delete "${list.title}" and everything in it?`,
- )
- ) {
- void listWrite(() => api.reminderListDelete(list.guid));
- }
- }}
- >
- ×
- </button>
- </span>
- </>
- )}
- </div>
- ))}
- {loaded && lists.length === 0 && <p className="badge">No lists yet</p>}
+ {!folded.has(entry.group.guid) &&
+ inGroup(entry.group.guid).map((list) => listRow(list, true))}
+ </div>
+ ),
+ )}
+ </div>
+ {loaded && lists.length === 0 && <p className="rx-side-empty">No lists yet</p>}
{addingList ? (
- <form onSubmit={createList}>
+ <form className="rx-new-list" onSubmit={createList}>
<input
- className="rem-list-rename"
+ className="rx-rename"
value={newList}
onChange={(e) => setNewList(e.target.value)}
placeholder="List name"
@@ -736,50 +882,36 @@ export function RemindersView() {
/>
</form>
) : (
- <button className="rem-list add" onClick={() => setAddingList(true)}>
- <span className="rem-list-name">Add List</span>
+ <button className="rx-add-list" onClick={() => setAddingList(true)}>
+ <Glyph name="plus" />
+ Add List
</button>
)}
</aside>
- <section className="rem-items">
- <header className="cal-bar">
- <div className="cal-nav">
- <h1>{searching ? "Search" : heading}</h1>
- {outstanding > 0 && <span className="badge">{outstanding}</span>}
- </div>
- <div className="cal-actions">
- {inList && (
- <button className="quiet" onClick={() => setShowDone((v) => !v)}>
- {showDone ? "Hide completed" : "Show completed"}
- </button>
- )}
- </div>
+ <section className="rx-main">
+ <header className="rx-head">
+ <h1>{searching ? `Results for “${query.trim()}”` : heading}</h1>
+ <span className="rx-head-count" aria-label={`${outstanding} to do`}>
+ {outstanding}
+ </span>
</header>
- <input
- className="notes-search"
- type="search"
- placeholder="Search"
- aria-label="Search reminders"
- value={query}
- onChange={(e) => setQuery(e.target.value)}
- onKeyDown={(e) => {
- if (e.key === "Escape") setQuery("");
- }}
- />
+ {inList && (
+ <div className="rx-subhead">
+ <button className="rx-link" onClick={() => setShowDone((v) => !v)}>
+ {showDone ? "Hide Completed" : "Show Completed"}
+ </button>
+ </div>
+ )}
{error && (
- <p className="error" role="alert">
+ <p className="rx-error" role="alert">
{error}
</p>
)}
- {/*
- * An account with no lists is a real account — a new one, or one whose lists have
- * all been deleted. A reminder cannot exist outside a list, so rather than the add
- * field quietly disappearing and leaving nothing to do, this says why and offers
- * the one thing that helps.
- */}
+ {/* An account with no lists: a reminder cannot exist outside one, so the one thing
+ that helps is offered instead of an add field with nowhere to go. */}
{lists.length === 0 && loaded && (
<div className="rem-nolists">
<p className="rem-nolists-line">Reminders live in lists, and there aren’t any yet.</p>
@@ -789,308 +921,243 @@ export function RemindersView() {
</div>
)}
- {targetListGuid && (
- <form className="rem-add" onSubmit={add}>
- <span className="tick ghost" aria-hidden="true" />
- <input
- value={draft}
- onChange={(e) => setDraft(e.target.value)}
- placeholder="Add a reminder"
- aria-label={
- inList
- ? `Add a reminder to ${heading}`
- : `Add a reminder to ${targetList?.title ?? "a list"}`
- }
- disabled={syncing}
- />
- {/* Inside a list it obviously goes there. From a smart view, where it lands is
- a real choice, so it is made here rather than decided for you. */}
- {!inList && targetList && lists.length > 0 && (
- <Picker
- className="rem-add-target"
- label="List to add to"
- value={targetListGuid ?? ""}
- onChange={chooseList}
- options={lists.map((l) => ({ value: l.guid, label: l.title }))}
- />
- )}
- </form>
- )}
-
{heldBack > 0 && (
- <p className="rem-more" role="status">
+ <p className="rx-capped" role="status">
Showing the first {MOST_AT_ONCE.toLocaleString()} — {heldBack.toLocaleString()} more
are in this list.
</p>
)}
{sections.map((section) => (
- <Fragment key={section.key}>
- {section.heading && (
- <h2
- className={`rem-section${section.dated ? " quiet" : ""}`}
- style={section.colour ? { color: section.colour } : undefined}
- >
- {section.heading}
- </h2>
- )}
- <ul className="rem-list-items">
- {section.rows.map(({ reminder, depth }) => {
- // The heading already names the day in the views that have one.
- const due =
- reminder.dueAt === null
- ? null
- : dueLabel(reminder.dueAt, section.dated);
- const isOpen = openGuid === reminder.guid;
- const repeat = repeatLabel(reminder);
- const justMoved = moved?.guid === reminder.guid ? moved.text : null;
- return (
- <li
- key={reminder.guid}
- className={`${reminder.completedAt ? "is-done" : ""}${
- depth > 0 ? " is-subtask" : ""
- }`.trim() || undefined}
+ <Fragment key={section.key}>
+ {section.heading && (
+ <h2
+ className={`rx-section${section.dated ? " is-quiet" : ""}`}
+ style={section.colour ? { color: section.colour } : undefined}
>
- <button
- className="tick"
- role="checkbox"
- aria-checked={Boolean(reminder.completedAt)}
- aria-label={reminder.title}
- disabled={busyGuid === reminder.guid}
- onClick={() => toggle(reminder)}
- >
- {/* Apple's empty circle is neutral wherever it appears; the colour is the
- reminder's own list, and it only shows once the thing is done. Borrowing
- the open list's colour painted every circle in a smart view gold, which
- said something untrue about where each reminder lived. */}
- {reminder.completedAt && (
- <span
- className="tick-fill"
- style={{
- background:
- lists.find((l) => l.guid === reminder.listGuid)?.colour ||
- "var(--gold)",
- }}
- />
- )}
- </button>
-
- <div className="rem-text">
- <div className="rem-title-row">
- {priorityMark(reminder.priority) && (
- <span
- className="rem-priority"
- role="img"
- aria-label={`${
- PRIORITIES.find((p) => p.value === reminder.priority)
- ?.label
- } priority`}
- >
- {priorityMark(reminder.priority)}
- </span>
- )}
- <input
- className="rem-title-edit"
- defaultValue={reminder.title}
- key={`${reminder.guid}-${reminder.title}`}
- aria-label={`Rename ${reminder.title}`}
+ {section.heading}
+ </h2>
+ )}
+ <ul className="rx-rows">
+ {section.rows.map(({ reminder, depth }) => {
+ const due =
+ reminder.dueAt === null ? null : dueLabel(reminder.dueAt, section.dated);
+ const isOpen = openGuid === reminder.guid;
+ const repeat = repeatLabel(reminder);
+ const justMoved = moved?.guid === reminder.guid ? moved.text : null;
+ const home = lists.find((l) => l.guid === reminder.listGuid);
+ const mark = priorityMark(reminder.priority);
+ return (
+ <li
+ key={reminder.guid}
+ className={`rx-row${reminder.completedAt ? " is-done" : ""}${
+ depth > 0 ? " is-subtask" : ""
+ }${isOpen ? " is-open" : ""}`}
+ >
+ <button
+ className="rx-tick"
+ role="checkbox"
+ aria-checked={Boolean(reminder.completedAt)}
+ aria-label={reminder.title}
disabled={busyGuid === reminder.guid}
- onBlur={(e) => void rename(reminder, e.target.value)}
- onKeyDown={(e) => {
- if (e.key === "Enter") e.currentTarget.blur();
- if (e.key === "Escape") {
- e.currentTarget.value = reminder.title;
- e.currentTarget.blur();
- }
- }}
+ style={{ "--tick": colourOf(home) } as React.CSSProperties}
+ onClick={() => toggle(reminder)}
/>
- </div>
- {reminder.notes && !isOpen && (
- <span className="rem-notes">{reminder.notes}</span>
- )}
-
- {/* Under the title, where Apple puts it. Out at the end of the row it sat
- a thousand pixels from the thing it describes on a wide window. */}
- {(due || repeat || justMoved) && (
- <span className="rem-meta">
- {justMoved ? (
- <span className="rem-moved" role="status">
- Moved to {justMoved}
- </span>
- ) : (
- <>
- {/* Which list it came from, where the grouping does not already
- say so — Apple puts it here, before the time. */}
- {showListName && (
- <span className="rem-from">
- {lists.find((l) => l.guid === reminder.listGuid)?.title ??
- "Reminders"}
- </span>
- )}
- {due && (
- <span className={`rem-due${due.overdue ? " overdue" : ""}`}>
- {due.text}
- </span>
- )}
- {repeat && (
- <span className="rem-repeat" title={repeat}>
- <span aria-hidden="true">↻</span>
- <span className="rem-repeat-word">
- {repeatWord(reminder)}
- </span>
- <span className="visually-hidden">{repeat}</span>
- </span>
- )}
- </>
- )}
- </span>
- )}
- {isOpen && (
- <div className="rem-detail">
- <label>
- <span>Due</span>
- <input
- type="datetime-local"
- defaultValue={toInputValue(reminder.dueAt)}
- onBlur={(e) => void setDue(reminder, e.target.value)}
- />
- </label>
- <div className="rem-field">
- <span>Nesting</span>
- <span className="rem-nesting">
- <button
- className="quiet"
- disabled={busyGuid === reminder.guid || depth > 0}
- onClick={() => void indent(reminder)}
+ <div className="rx-text">
+ <div className="rx-title-row">
+ {mark && (
+ <span
+ className="rx-priority"
+ role="img"
+ aria-label={`${
+ PRIORITIES.find((p) => p.value === reminder.priority)?.label
+ } priority`}
>
- Make subtask
- </button>
- <button
- className="quiet"
- disabled={busyGuid === reminder.guid || depth === 0}
- onClick={() => void outdent(reminder)}
- >
- Move out
- </button>
- </span>
- </div>
- <div className="rem-field">
- <span>Repeat</span>
- <Picker
- label={`Repeat for ${reminder.title}`}
- value={repeatKey(reminder)}
- disabled={busyGuid === reminder.guid || reminder.dueAt === null}
- onChange={(key) => void setRepeat(reminder, key)}
- options={
- repeatKey(reminder) === "custom"
- ? [
- // A schedule this menu doesn't express must still be
- // shown, and choosing anything else would silently
- // replace it.
- { value: "custom", label: repeat ?? "Custom" },
- ...REPEATS.map((o) => ({ value: o.key, label: o.label })),
- ]
- : REPEATS.map((o) => ({ value: o.key, label: o.label }))
- }
+ {mark}
+ </span>
+ )}
+ <input
+ className="rx-title"
+ defaultValue={reminder.title}
+ key={`${reminder.guid}-${reminder.title}`}
+ aria-label={`Rename ${reminder.title}`}
+ disabled={busyGuid === reminder.guid}
+ onBlur={(e) => void rename(reminder, e.target.value)}
+ onKeyDown={(e) => {
+ if (e.key === "Enter") e.currentTarget.blur();
+ if (e.key === "Escape") {
+ e.currentTarget.value = reminder.title;
+ e.currentTarget.blur();
+ }
+ }}
/>
</div>
- {reminder.dueAt === null && (
- <p className="rem-repeat-note">
- Give this a date before asking it to repeat.
- </p>
+ {reminder.notes && !isOpen && (
+ <span className="rx-notes">{reminder.notes}</span>
)}
- {repeat && (
- <p className="rem-repeat-note">Ticking it moves it to the next one.</p>
+ {(due || repeat || justMoved || (showListName && home)) && (
+ <span className="rx-meta">
+ {justMoved ? (
+ <span className="rx-moved" role="status">
+ Moved to {justMoved}
+ </span>
+ ) : (
+ <>
+ {showListName && (
+ <span className="rx-from">{home?.title ?? "Reminders"}</span>
+ )}
+ {due && (
+ <span className={`rx-due${due.overdue ? " overdue" : ""}`}>
+ {due.text}
+ </span>
+ )}
+ {repeat && (
+ <span className="rx-repeat" title={repeat}>
+ <span aria-hidden="true">↻</span> {repeatWord(reminder)}
+ <span className="visually-hidden">{repeat}</span>
+ </span>
+ )}
+ </>
+ )}
+ </span>
+ )}
+
+ {isOpen && (
+ <div className="rx-detail">
+ <label className="rx-field">
+ <span>Date</span>
+ <input
+ type="datetime-local"
+ defaultValue={toInputValue(reminder.dueAt)}
+ onBlur={(e) => void setDue(reminder, e.target.value)}
+ />
+ </label>
+ <div className="rx-field">
+ <span>Repeat</span>
+ <Picker
+ label={`Repeat for ${reminder.title}`}
+ value={repeatKey(reminder)}
+ disabled={busyGuid === reminder.guid || reminder.dueAt === null}
+ onChange={(key) => void setRepeat(reminder, key)}
+ options={
+ repeatKey(reminder) === "custom"
+ ? [
+ // A schedule this menu doesn't express must still be
+ // shown, and choosing anything else would replace it.
+ { value: "custom", label: repeat ?? "Custom" },
+ ...REPEATS.map((o) => ({ value: o.key, label: o.label })),
+ ]
+ : REPEATS.map((o) => ({ value: o.key, label: o.label }))
+ }
+ />
+ </div>
+ {reminder.dueAt === null && (
+ <p className="rx-hint">Give this a date before asking it to repeat.</p>
+ )}
+ <div className="rx-field">
+ <span>Priority</span>
+ <Picker
+ label={`Priority for ${reminder.title}`}
+ value={String(reminder.priority)}
+ disabled={busyGuid === reminder.guid}
+ onChange={(v) => void setPriority(reminder, Number(v))}
+ options={PRIORITIES.map((p) => ({
+ value: String(p.value),
+ label: p.label,
+ }))}
+ />
+ </div>
+ <div className="rx-field">
+ <span>List</span>
+ <Picker
+ label={`List for ${reminder.title}`}
+ value={reminder.listGuid}
+ disabled={busyGuid === reminder.guid}
+ onChange={(guid) => void moveToList(reminder, guid)}
+ options={lists.map((l) => ({ value: l.guid, label: l.title }))}
+ />
+ </div>
+ <label className="rx-field">
+ <span>Notes</span>
+ <textarea
+ defaultValue={reminder.notes ?? ""}
+ rows={2}
+ onBlur={(e) => void setNotes(reminder, e.target.value)}
+ />
+ </label>
+ <div className="rx-detail-actions">
+ {depth > 0 ? (
+ <button
+ className="rx-link"
+ disabled={busyGuid === reminder.guid}
+ onClick={() => void outdent(reminder)}
+ >
+ Move Out of Subtasks
+ </button>
+ ) : (
+ <button
+ className="rx-link"
+ disabled={busyGuid === reminder.guid}
+ onClick={() => void indent(reminder)}
+ >
+ Make Subtask
+ </button>
+ )}
+ <button
+ className="rx-link danger"
+ aria-label={`Delete ${reminder.title}`}
+ disabled={busyGuid === reminder.guid}
+ onClick={() => remove(reminder)}
+ >
+ Delete
+ </button>
+ </div>
+ </div>
)}
- {/* A pop-up button is not a labelled field: it names itself, and
- wrapping one in a <label> associates a label with nothing. */}
- <div className="rem-field">
- <span>Priority</span>
- <Picker
- label={`Priority for ${reminder.title}`}
- value={String(reminder.priority)}
- disabled={busyGuid === reminder.guid}
- onChange={(v) => void setPriority(reminder, Number(v))}
- options={PRIORITIES.map((p) => ({
- value: String(p.value),
- label: p.label,
- }))}
- />
- </div>
- <div className="rem-field">
- <span>List</span>
- <Picker
- label={`List for ${reminder.title}`}
- value={reminder.listGuid}
- disabled={busyGuid === reminder.guid}
- onChange={(guid) => void moveToList(reminder, guid)}
- options={lists.map((l) => ({ value: l.guid, label: l.title }))}
- />
- </div>
- <label>
- <span>Notes</span>
- <textarea
- defaultValue={reminder.notes ?? ""}
- rows={2}
- onBlur={(e) =>
- void setNotes(reminder, e.target.value)
- }
- />
- </label>
</div>
- )}
- </div>
- <span className="rem-trailing">
- <button
- className={`rem-flag${reminder.flagged ? " on" : ""}`}
- aria-label={
- reminder.flagged
- ? `Unflag ${reminder.title}`
- : `Flag ${reminder.title}`
- }
- aria-pressed={reminder.flagged}
- disabled={busyGuid === reminder.guid}
- onClick={() => flag(reminder)}
- >
- ⚑
- </button>
- <button
- className="rem-more"
- aria-label={
- isOpen
- ? `Close details for ${reminder.title}`
- : `Details for ${reminder.title}`
- }
- aria-expanded={isOpen}
- onClick={() => setOpenGuid(isOpen ? null : reminder.guid)}
- >
- ⋯
- </button>
- <button
- className="rem-delete"
- aria-label={`Delete ${reminder.title}`}
- disabled={busyGuid === reminder.guid}
- onClick={() => remove(reminder)}
- >
- ×
- </button>
- </span>
- </li>
- );
- })}
- </ul>
- </Fragment>
+ <span className="rx-trailing">
+ <button
+ className="rx-icon-button"
+ aria-label={
+ isOpen ? `Close details for ${reminder.title}` : `Details for ${reminder.title}`
+ }
+ aria-expanded={isOpen}
+ onClick={() => setOpenGuid(isOpen ? null : reminder.guid)}
+ >
+ <Glyph name="info" />
+ </button>
+ <button
+ className={`rx-icon-button rx-flag${reminder.flagged ? " on" : ""}`}
+ aria-label={
+ reminder.flagged ? `Unflag ${reminder.title}` : `Flag ${reminder.title}`
+ }
+ aria-pressed={reminder.flagged}
+ disabled={busyGuid === reminder.guid}
+ onClick={() => flag(reminder)}
+ >
+ <Glyph name="flagged" />
+ </button>
+ </span>
+ </li>
+ );
+ })}
+ </ul>
+ </Fragment>
))}
- {loaded && items.length === 0 && !error && (
- <p className="cal-empty">
- {inList
- ? showDone
- ? "Nothing in this list."
- : "All done here."
- : "Nothing here."}
+ {addRow}
+
+ {loaded && items.length === 0 && !error && lists.length > 0 && (
+ <p className="rx-empty">
+ {searching
+ ? "No reminders match."
+ : inList
+ ? showDone
+ ? "Nothing in this list."
+ : "All done here."
+ : "Nothing here."}
</p>
)}
</section>
diff --git a/src/styles/app.css b/src/styles/app.css
index c7a4118..82bb3a8 100644
--- a/src/styles/app.css
+++ b/src/styles/app.css
@@ -658,19 +658,6 @@
/* The content pane holds the grid, so it must not scroll independently. */
.content:has(.cal) { display: flex; flex-direction: column; overflow: hidden; }
-/* ---- reminders ------------------------------------------------------------------
- Apple Reminders: lists on the left, items on the right, a ring that fills when ticked. */
-
-.rem {
- display: grid;
- /* Wide enough for a real list name and its count side by side. At 176px "Quizzes &
- Exams" was cut to "Quizzes & Ex…" and the four tiles had eighty pixels each. */
- grid-template-columns: 212px 1fr;
- gap: 20px;
- height: 100%;
- min-height: 0;
-}
-
.rem-lists {
overflow-y: auto;
padding-right: 4px;
@@ -698,184 +685,6 @@
.rem-list:focus-visible { outline: 3px solid var(--gold-ring); outline-offset: -1px; }
.rem-list-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
-/* Apple puts the number on every entry, and it is what makes a sidebar worth glancing at.
- Tabular figures so the column does not jitter as counts change. */
-.rem-list-count {
- flex: none;
- font-size: var(--t-11);
- color: var(--text-3);
- font-variant-numeric: tabular-nums;
-}
-
-/* ── The built-in views, arranged the way Reminders arranges them ───────────────────────
- Four tiles above the lists you made: a filled glyph in the view's own colour, the count
- large on the right, the name beneath. Two across, because that is what fits a sidebar. */
-.rem-smart-grid {
- display: grid;
- grid-template-columns: 1fr 1fr;
- gap: 6px;
- margin-bottom: 4px;
-}
-
-.rem-smart {
- display: flex;
- flex-direction: column;
- gap: 4px;
- min-width: 0;
- border: 0;
- padding: 9px 10px 10px;
- border-radius: var(--r-plateau);
- background: color-mix(in srgb, var(--text) 5%, transparent);
- color: var(--text);
- font: inherit;
- text-align: left;
- cursor: pointer;
- transition: background 140ms var(--ease);
-}
-
-.rem-smart:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
-.rem-smart[aria-current="true"] { background: var(--gold-tint); box-shadow: inset 0 0 0 1px var(--gold-ring); }
-.rem-smart:focus-visible { outline: 3px solid var(--gold-ring); outline-offset: -1px; }
-
-.rem-smart-top {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 6px;
-}
-
-.rem-smart-glyph {
- flex: none;
- width: 21px;
- height: 21px;
- border-radius: var(--r-pill);
- display: grid;
- place-items: center;
- color: #fff;
-}
-
-/* Drawn at 16 and shown at 12, so the stroke stays crisp rather than soft. */
-.rem-smart-glyph svg { width: 12px; height: 12px; }
-
-/* A list's own colour, on the same 16px grid the heading aligns to. */
-.rem-list-glyph {
- flex: none;
- width: 16px;
- height: 16px;
- display: grid;
- place-items: center;
-}
-
-.rem-smart-count {
- font-size: var(--t-22);
- font-weight: 620;
- font-variant-numeric: tabular-nums;
- letter-spacing: -0.3px;
-}
-
-.rem-smart-name {
- font-size: var(--t-11);
- font-weight: 550;
- color: var(--text-2);
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-
-.rem-items { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
-
-/* Rows run the width of the pane, as they do in Reminders. Capping them left the list
- stranded in the left third of a wide window with its separators ending in mid-air. */
-.rem-items > * { width: 100%; }
-
-.rem-list-items {
- list-style: none;
- margin: 0;
- padding: 0;
- overflow-y: auto;
- min-height: 0;
-}
-
-/*
- * A row runs the width of the pane, but what is in it does not.
- *
- * The separators span everything — capping the row itself left the list stranded in the left
- * third of a wide window with its lines ending in mid-air. But with the text on a single
- * stretching column, the flag, menu and delete buttons were pushed to the far edge: on a
- * nineteen-hundred-pixel window they sat about thirteen hundred pixels from the reminder they
- * act on, which is a long way to travel to tick something off.
- *
- * The text is given a reading measure and the buttons follow it, with the spare width taking
- * up the slack at the end. The line still reaches both edges.
- */
-.rem-list-items li {
- display: grid;
- grid-template-columns: 18px minmax(0, 72ch) auto minmax(0, 1fr);
- align-items: start;
- gap: 10px;
- padding: 7px 8px;
- border-bottom: 1px solid var(--separator);
-}
-
-.rem-list-items li:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
-
-/* A subtask is indented to the parent's text, so the tick marks line up under the title
- rather than under the parent's tick — which is what makes the nesting readable. */
-.rem-list-items li.is-subtask { padding-left: 36px; }
-
-/* Apple's ring: an outline that fills with the list's colour when ticked. */
-.tick {
- width: 18px;
- height: 18px;
- margin-top: 1px;
- border: 1.5px solid var(--field-edge);
- border-radius: var(--r-pill);
- background: none;
- cursor: pointer;
- padding: 0;
- display: grid;
- place-items: center;
- flex: none;
-}
-
-.tick:disabled { opacity: 0.5; cursor: progress; }
-.tick:focus-visible { outline: 3px solid var(--gold-ring); outline-offset: 2px; }
-.tick-fill { width: 10px; height: 10px; border-radius: var(--r-pill); }
-
-.rem-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
-.rem-title-row { display: flex; align-items: baseline; gap: 5px; min-width: 0; }
-
-.rem-nesting { display: flex; gap: 6px; }
-.rem-title-row .rem-title-edit { flex: 1; min-width: 0; }
-.rem-title { font-size: var(--t-13); }
-.rem-notes {
- font-size: var(--t-11);
- color: var(--text-2);
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-
-/* The line under a title: when it is due, and whether it comes back. */
-.rem-meta {
- display: flex;
- align-items: center;
- gap: 6px;
- min-width: 0;
-}
-
-.rem-due {
- font-size: var(--t-11);
- color: var(--text-2);
- font-variant-numeric: tabular-nums;
- white-space: nowrap;
-}
-
-.is-done .rem-title { color: var(--text-3); text-decoration: line-through; }
-.is-done .rem-notes { color: var(--text-3); }
-
-.content:has(.rem) { display: flex; flex-direction: column; overflow: hidden; }
-
/* A reminder in the calendar reads as a task, not an event: a ring rather than a dot. */
.chip.reminder .chip-title { color: var(--text); }
@@ -899,64 +708,6 @@
border-color: var(--text-3);
}
-/* Adding a reminder sits where the next row would, the way Apple's does. */
-.rem-add {
- display: grid;
- /* A third column only when the target tag is present; an empty third track when it is
- not costs nothing. Fixed to 18px 1fr before, the tag had nowhere to go but the row
- below, which wrapped "To-Do" onto two lines of its own. */
- grid-template-columns: 18px 1fr auto;
- align-items: center;
- gap: 10px;
- padding: 7px 8px;
- border-bottom: 1px solid var(--separator);
-}
-
-.rem-add input {
- border: 0;
- background: none;
- color: var(--text);
- font: inherit;
- font-size: var(--t-13);
- outline: none;
- width: 100%;
-}
-
-.rem-add input::placeholder { color: var(--text-3); }
-
-/* The destination list, chosen rather than assumed. Sized to sit quietly in the add row
- rather than compete with the field it follows. */
-.rem-add-target { max-width: 150px; }
-.rem-add-target .picker-button { font-size: var(--t-11); padding: 3px 8px; }
-.rem-add:focus-within { background: color-mix(in srgb, var(--text) 4%, transparent); }
-
-/* A ring outline that is clearly not actionable, so the row reads as a draft. */
-.tick.ghost {
- border-style: dashed;
- border-color: var(--field-edge);
- cursor: default;
-}
-
-.rem-trailing { display: flex; align-items: center; gap: 6px; }
-
-.rem-delete {
- border: 0;
- background: none;
- color: var(--text-3);
- font-size: var(--t-15);
- line-height: 1;
- padding: 2px 5px;
- border-radius: var(--r-field);
- cursor: pointer;
- opacity: 0;
-}
-
-/* Destructive actions stay out of the way until wanted, but must remain keyboard-reachable. */
-.rem-list-items li:hover .rem-delete,
-.rem-delete:focus-visible { opacity: 1; }
-.rem-delete:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
-.rem-delete:focus-visible { outline: 3px solid var(--gold-ring); outline-offset: 1px; }
-
/* ---- notes ----------------------------------------------------------------------
Apple Notes: folders, then a list of notes, then the note itself. */
@@ -1517,182 +1268,14 @@ textarea.note-text:disabled {
color: var(--text-3);
}
-/* The title is editable in place, so it must read as text until it is focused. */
-.rem-title-edit {
- border: 0;
- background: none;
- color: inherit;
- font: inherit;
- font-size: var(--t-13);
- padding: 1px 3px;
- margin-left: -3px;
- border-radius: 4px;
- width: 100%;
- outline: none;
-}
-
-/* No hover of its own: the row is already the highlight, and two of them stacked read as
- a grey slab dropped across the title. Editing shows itself when the caret arrives. */
-.rem-title-edit:focus { background: var(--field); box-shadow: 0 0 0 2px var(--gold-ring); }
-.is-done .rem-title-edit { color: var(--text-3); text-decoration: line-through; }
-
-.rem-detail {
- display: flex;
- flex-direction: column;
- gap: 6px;
- margin: 6px 0 2px;
- padding: 8px 9px;
- border-radius: var(--r-field);
- background: color-mix(in srgb, var(--text) 4.5%, transparent);
-}
-
-.rem-detail label,
-.rem-detail .rem-field { display: grid; grid-template-columns: 48px 1fr; gap: 8px; align-items: start; }
-.rem-detail label > span,
-.rem-detail .rem-field > span { font-size: var(--t-11); color: var(--text-2); padding-top: 5px; }
-
-.rem-detail input,
-.rem-detail select,
-.rem-detail textarea {
- font: inherit;
- font-size: var(--t-13);
- color: var(--text);
- background: var(--field);
- border: 1px solid var(--field-edge);
- border-radius: var(--r-field);
- padding: 4px 7px;
- outline: none;
- resize: vertical;
-}
-
-.rem-detail input:focus,
-.rem-detail select:focus,
-.rem-detail textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-ring); }
-
-/* Apple marks priority before the title, in its accent, and lets the marks pile up so
- urgency is legible at a glance rather than needing to be read. */
-.rem-priority {
- flex: none;
- align-self: baseline;
- color: var(--gold-strong);
- font-size: var(--t-13);
- font-weight: 650;
- letter-spacing: -0.5px;
-}
-
-/* Overdue is the one thing in this list that should catch the eye. */
-.rem-due.overdue { color: var(--danger); }
-
-/* A repeat never completes, it moves. The glyph says so at a glance; the confirmation
- says where it went, because otherwise the row simply reappears and reads as a no-op. */
-.rem-repeat {
- font-size: var(--t-11);
- color: var(--text-3);
- line-height: 1;
-}
-
-.rem-moved {
- font-size: var(--t-11);
- font-weight: 590;
- color: var(--gold-strong);
- white-space: nowrap;
- animation: rem-moved-in 240ms var(--ease-spring) both;
-}
-
@keyframes rem-moved-in {
from { opacity: 0; transform: translateY(-4px); }
to { opacity: 1; transform: none; }
}
-.rem-repeat-note {
- margin: 0;
- /* Aligned with the fields it sits under, not with their labels. */
- padding-left: 56px;
- font-size: var(--t-11);
- color: var(--text-3);
-}
-
-.rem-flag,
-.rem-more {
- border: 0;
- background: none;
- color: var(--text-3);
- font-size: var(--t-13);
- line-height: 1;
- padding: 3px 5px;
- border-radius: var(--r-field);
- cursor: pointer;
- opacity: 0;
-}
-
-.rem-flag.on { opacity: 1; color: var(--gold); }
-
-.rem-list-items li:hover .rem-flag,
-.rem-list-items li:hover .rem-more,
-.rem-flag:focus-visible,
-.rem-more:focus-visible { opacity: 1; }
-
-.rem-flag:hover, .rem-more:hover { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }
-.rem-flag:focus-visible, .rem-more:focus-visible { outline: 3px solid var(--gold-ring); outline-offset: 1px; }
-
-/* A row holding an open detail panel needs the controls at the top, not centred. */
-.rem-list-items li { align-items: start; }
-.rem-trailing { padding-top: 2px; }
-
-/* List management sits in the sidebar, with its controls out of the way until hovered. */
-/*
- * A list row spans the same width as the cards above it.
- *
- * The rename and delete buttons used to sit in the row's flow, which took thirty-seven pixels
- * off every row and left the column with two different widths — the cards one, the lists
- * another. They float over the end of the row now, appearing on hover the way they did before,
- * and the row itself reaches the same edge the cards do.
- */
-.rem-list-row { position: relative; display: flex; align-items: center; }
-.rem-list-row .rem-list { flex: 1; min-width: 0; padding-right: 54px; }
-
-.rem-list-actions {
- position: absolute;
- right: 2px;
- display: flex;
- gap: 1px;
-}
-
-.rem-list-action {
- border: 0;
- background: none;
- color: var(--text-3);
- font-size: var(--t-11);
- line-height: 1;
- padding: 4px 5px;
- border-radius: var(--r-field);
- cursor: pointer;
- opacity: 0;
- flex: none;
-}
-
-.rem-list-row:hover .rem-list-action,
-.rem-list-action:focus-visible { opacity: 1; }
-.rem-list-action:hover { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }
-.rem-list-action.danger:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
-.rem-list-action:focus-visible { outline: 3px solid var(--gold-ring); outline-offset: 1px; }
-
.rem-list.add { color: var(--text-3); }
.rem-list.add:hover { color: var(--text-2); }
-.rem-list-rename {
- width: 100%;
- font: inherit;
- font-size: var(--t-13);
- color: var(--text);
- background: var(--field);
- border: 1px solid var(--gold);
- border-radius: var(--r-field);
- padding: 5px 8px;
- outline: none;
- box-shadow: 0 0 0 3px var(--gold-ring);
-}
-
/* The day inspector: what is on the selected day, and the one place events are written.
Apple puts this beside the month; at this width it reads better beneath it, where it can
use the full measure for a form. */
@@ -2321,51 +1904,6 @@ button.cal-day-item:hover { background: color-mix(in srgb, var(--sheet) 92%, var
font-size: var(--t-13);
}
-/* Said plainly when a view holds more than it was handed, rather than stopping in silence. */
-.rem-more {
- margin: 0 0 6px;
- padding: 8px 10px;
- border-radius: var(--r-field);
- background: color-mix(in srgb, var(--text) 5%, transparent);
- color: var(--text-2);
- font-size: var(--t-11);
-}
-
-/*
- * The headings Apple puts through its smart lists — Morning, Tomorrow, or the name of the
- * list a reminder came from. Every one of Apple's smart lists is grouped; showing them as one
- * flat run is most of why this screen felt unlike the real thing.
- */
-.rem-section {
- margin: 14px 0 2px;
- padding: 0 2px;
- font-size: var(--t-15);
- font-weight: 700;
- letter-spacing: -0.01em;
- color: var(--text);
-}
-
-.rem-section:first-child { margin-top: 2px; }
-
-/*
- * A time of day is a quieter heading than a date or a list name — which is how Apple weights
- * them: Morning and Afternoon sit back, Overdue and Tomorrow do not.
- */
-.rem-section.quiet {
- font-size: var(--t-13);
- color: var(--text-2);
-}
-
-/* A section with nothing under it still belongs — Apple leaves Tonight showing. */
-.rem-section + .rem-list-items:empty { min-height: 8px; }
-
-/* Which list a reminder came from, beside its time. */
-.rem-from { color: var(--text-2); }
-
-/* The repeat, said rather than only drawn. */
-.rem-repeat { display: inline-flex; align-items: center; gap: 3px; }
-.rem-repeat-word { font-size: inherit; }
-
/* Read aloud but not drawn — the full wording of a repeat, where the row shows the short one. */
.visually-hidden {
position: absolute;
diff --git a/src/styles/reminders.css b/src/styles/reminders.css
new file mode 100644
index 0000000..87381ee
--- /dev/null
+++ b/src/styles/reminders.css
@@ -0,0 +1,515 @@
+/* Reminders, laid out the way macOS Reminders is.
+ *
+ * Everything here is scoped under `.rx`. The screen's old rules were spread through app.css
+ * and collided — one class name meant a button in one place and a notice in another — so
+ * this file is the only place Reminders is styled. */
+
+:root {
+ /* Apple's system colours, which are what its built-in views are drawn in. They shift
+ between light and dark, so they are not the same six hex values in both. */
+ --sys-blue: #007aff;
+ --sys-red: #ff3b30;
+ --sys-gray: #8e8e93;
+ --sys-orange: #ff9500;
+}
+
+@media (prefers-color-scheme: dark) {
+ :root {
+ --sys-blue: #0a84ff;
+ --sys-red: #ff453a;
+ --sys-gray: #98989d;
+ --sys-orange: #ff9f0a;
+ }
+}
+
+.content:has(.rx) { display: flex; flex-direction: column; overflow: hidden; }
+
+.rx {
+ flex: 1;
+ min-height: 0;
+ display: grid;
+ grid-template-columns: 236px minmax(0, 1fr);
+}
+
+/* ---- sidebar ---------------------------------------------------------------- */
+
+.rx-side {
+ display: flex;
+ flex-direction: column;
+ gap: 2px;
+ min-height: 0;
+ overflow-y: auto;
+ padding: 2px 12px 16px 2px;
+ border-right: 1px solid var(--separator);
+}
+
+.rx-search {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ height: 28px;
+ margin-bottom: 10px;
+ padding: 0 8px;
+ border-radius: var(--r-field);
+ background: color-mix(in srgb, var(--text) 7%, transparent);
+ color: var(--text-3);
+}
+.rx-search svg { width: 13px; height: 13px; flex: none; }
+.rx-search input {
+ flex: 1;
+ min-width: 0;
+ border: 0;
+ background: none;
+ color: var(--text);
+ font: inherit;
+ font-size: var(--t-13);
+ outline: none;
+}
+.rx-search input::placeholder { color: var(--text-3); }
+.rx-search:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--sys-blue) 35%, transparent); }
+
+/* The tiles: glyph top left, count top right, name beneath. Chosen, a tile takes its own
+ colour and everything on it turns white — which is how Apple marks the open one. */
+.rx-tiles {
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ gap: 8px;
+ margin-bottom: 14px;
+}
+
+.rx-tile {
+ display: grid;
+ grid-template-columns: auto 1fr;
+ grid-template-rows: auto auto;
+ align-items: center;
+ row-gap: 6px;
+ padding: 8px 9px 7px;
+ border: 0;
+ border-radius: 10px;
+ background: color-mix(in srgb, var(--text) 7%, transparent);
+ color: var(--text);
+ font: inherit;
+ text-align: left;
+ cursor: default;
+}
+.rx-tile:hover { background: color-mix(in srgb, var(--text) 10%, transparent); }
+.rx-tile:focus-visible { outline: 3px solid color-mix(in srgb, var(--tile) 45%, transparent); outline-offset: 1px; }
+
+.rx-tile-glyph {
+ display: grid;
+ place-items: center;
+ width: 26px;
+ height: 26px;
+ border-radius: 50%;
+ background: var(--tile);
+ color: #fff;
+}
+.rx-tile-glyph svg { width: 15px; height: 15px; }
+
+.rx-tile-count {
+ justify-self: end;
+ font-size: 21px;
+ font-weight: 700;
+ line-height: 1;
+ font-variant-numeric: tabular-nums;
+ letter-spacing: -0.02em;
+}
+
+.rx-tile-name {
+ grid-column: 1 / -1;
+ color: var(--text-2);
+ font-size: var(--t-13);
+ font-weight: 600;
+ line-height: 1.1;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.rx-tile[aria-current="true"] { background: var(--tile); color: #fff; }
+.rx-tile[aria-current="true"] .rx-tile-glyph { background: #fff; color: var(--tile); }
+.rx-tile[aria-current="true"] .rx-tile-name { color: #fff; }
+
+/* On the same left edge as the list badges beneath it, where a source list puts a heading. */
+.rx-side-heading {
+ margin: 0 0 4px;
+ padding: 0 5px;
+ color: var(--text-3);
+ font-size: var(--t-11);
+ font-weight: 600;
+}
+
+.rx-lists { display: flex; flex-direction: column; gap: 1px; }
+
+.rx-list-row { position: relative; display: flex; align-items: center; }
+.rx-list-row.nested { padding-left: 18px; }
+
+.rx-list,
+.rx-group-row {
+ flex: 1;
+ min-width: 0;
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ height: 32px;
+ padding: 0 8px 0 5px;
+ border: 0;
+ border-radius: 7px;
+ background: none;
+ color: var(--text);
+ font: inherit;
+ font-size: var(--t-13);
+ text-align: left;
+ cursor: default;
+}
+.rx-list:hover,
+.rx-group-row:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
+.rx-list[aria-current="true"] { background: color-mix(in srgb, var(--text) 12%, transparent); }
+.rx-list:focus-visible,
+.rx-group-row:focus-visible { outline: 3px solid color-mix(in srgb, var(--sys-blue) 40%, transparent); outline-offset: -1px; }
+
+.rx-badge {
+ display: grid;
+ place-items: center;
+ flex: none;
+ width: 24px;
+ height: 24px;
+ border-radius: 50%;
+ color: #fff;
+}
+.rx-badge svg { width: 14px; height: 14px; }
+
+.rx-group-glyph {
+ display: grid;
+ place-items: center;
+ flex: none;
+ width: 24px;
+ height: 24px;
+ color: var(--text-2);
+}
+.rx-group-glyph svg { width: 17px; height: 17px; }
+
+.rx-list-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
+.rx-group-row { width: 100%; }
+.rx-group-row .rx-list-name { font-weight: 600; }
+
+.rx-list-count {
+ min-width: 18px;
+ color: var(--text-3);
+ font-size: var(--t-13);
+ font-variant-numeric: tabular-nums;
+ text-align: right;
+}
+
+.rx-chevron { display: grid; place-items: center; color: var(--text-3); transition: transform 180ms var(--ease); }
+.rx-chevron svg { width: 12px; height: 12px; }
+.rx-group-row[aria-expanded="true"] .rx-chevron { transform: rotate(90deg); }
+
+/* Rename and delete wait until a list is pointed at, over where its count sits. */
+.rx-list-actions {
+ position: absolute;
+ right: 4px;
+ display: flex;
+ gap: 2px;
+ opacity: 0;
+ pointer-events: none;
+}
+.rx-list-row:hover .rx-list-actions,
+.rx-list-row:focus-within .rx-list-actions { opacity: 1; pointer-events: auto; }
+.rx-list-row:hover .rx-list-count,
+.rx-list-row:focus-within .rx-list-count { visibility: hidden; }
+
+.rx-rename {
+ flex: 1;
+ height: 30px;
+ padding: 0 8px;
+ border: 1px solid var(--field-edge);
+ border-radius: 7px;
+ background: var(--field);
+ color: var(--text);
+ font: inherit;
+ font-size: var(--t-13);
+ outline: none;
+}
+.rx-rename:focus { border-color: var(--sys-blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sys-blue) 30%, transparent); }
+.rx-new-list { display: flex; margin-top: 4px; }
+
+.rx-add-list {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ margin-top: auto;
+ padding: 10px 8px 0;
+ border: 0;
+ background: none;
+ color: var(--text-2);
+ font: inherit;
+ font-size: var(--t-13);
+ cursor: default;
+}
+.rx-add-list svg { width: 14px; height: 14px; }
+.rx-add-list:hover { color: var(--text); }
+
+.rx-side-empty { margin: 4px 8px; color: var(--text-3); font-size: var(--t-13); }
+
+/* ---- the open view ---------------------------------------------------------- */
+
+.rx-main {
+ min-height: 0;
+ overflow-y: auto;
+ padding: 0 4px 24px 26px;
+}
+
+/* The view's name in its own colour, its count at the far end of the same line. */
+.rx-head {
+ display: flex;
+ align-items: baseline;
+ justify-content: space-between;
+ gap: 16px;
+ padding: 2px 14px 10px 0;
+ color: var(--accent);
+}
+.rx-head h1 {
+ margin: 0;
+ min-width: 0;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ font-size: 26px;
+ font-weight: 700;
+ letter-spacing: -0.02em;
+ line-height: 1.15;
+}
+.rx-head-count { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.15; }
+
+.rx-subhead { display: flex; justify-content: flex-end; padding: 0 14px 6px 0; margin-top: -4px; }
+
+.rx-link {
+ padding: 2px 0;
+ border: 0;
+ background: none;
+ color: var(--sys-blue);
+ font: inherit;
+ font-size: var(--t-13);
+ cursor: default;
+}
+.rx-link:hover { text-decoration: underline; }
+.rx-link.danger { color: var(--sys-red); }
+.rx-link:disabled { opacity: 0.5; }
+
+.rx-error { margin: 0 14px 8px 0; color: var(--danger); font-size: var(--t-13); }
+
+.rx-capped {
+ margin: 0 14px 8px 0;
+ padding: 7px 10px;
+ border-radius: var(--r-field);
+ background: color-mix(in srgb, var(--text) 5%, transparent);
+ color: var(--text-2);
+ font-size: var(--t-11);
+}
+
+/* A heading within the view: a list name or a day in its weight, a time of day quieter. */
+.rx-section {
+ margin: 18px 14px 2px 30px;
+ color: var(--text);
+ font-size: var(--t-15);
+ font-weight: 700;
+ letter-spacing: -0.01em;
+}
+/* Not `.quiet`: that is the app's quiet button, and borrowing it drew each time-of-day
+ heading as a button. */
+.rx-section.is-quiet { color: var(--text-2); font-weight: 600; }
+.rx-section:first-of-type { margin-top: 4px; }
+
+.rx-rows { margin: 0; padding: 0; list-style: none; }
+
+/* A row: circle, then the text. The line between rows starts where the text does, as on
+ the phone, and the last row of a group has none. */
+.rx-row {
+ position: relative;
+ display: grid;
+ grid-template-columns: 20px minmax(0, 1fr) auto;
+ column-gap: 10px;
+ align-items: start;
+ padding: 7px 14px 7px 0;
+}
+.rx-row::after {
+ content: "";
+ position: absolute;
+ left: 30px;
+ right: 0;
+ bottom: 0;
+ height: 1px;
+ background: var(--separator);
+}
+.rx-row:last-child::after { display: none; }
+.rx-row.is-subtask { margin-left: 30px; }
+
+.rx-tick {
+ position: relative;
+ width: 20px;
+ height: 20px;
+ margin-top: 1px;
+ padding: 0;
+ border: 1.5px solid color-mix(in srgb, var(--text) 32%, transparent);
+ border-radius: 50%;
+ background: none;
+ cursor: default;
+}
+.rx-tick:hover { border-color: var(--tick); }
+.rx-tick:focus-visible { outline: 3px solid color-mix(in srgb, var(--tick) 40%, transparent); outline-offset: 2px; }
+.rx-tick:disabled { opacity: 0.5; }
+.rx-tick[aria-checked="true"] { border-color: var(--tick); }
+.rx-tick[aria-checked="true"]::after {
+ content: "";
+ position: absolute;
+ inset: 2.5px;
+ border-radius: 50%;
+ background: var(--tick);
+}
+.rx-tick.ghost {
+ display: grid;
+ place-items: center;
+ border-style: dashed;
+ color: var(--text-3);
+}
+.rx-tick.ghost svg { width: 11px; height: 11px; }
+
+.rx-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
+.rx-title-row { display: flex; align-items: baseline; gap: 4px; min-width: 0; }
+
+.rx-title {
+ flex: 1;
+ min-width: 0;
+ padding: 0;
+ border: 0;
+ background: none;
+ color: var(--text);
+ font: inherit;
+ font-size: var(--t-13);
+ line-height: 20px;
+ outline: none;
+}
+.rx-title:focus { box-shadow: 0 1px 0 var(--accent); }
+.is-done .rx-title { color: var(--text-3); }
+
+.rx-priority { color: var(--tick, var(--accent)); font-weight: 700; font-size: var(--t-13); }
+
+.rx-notes {
+ color: var(--text-2);
+ font-size: var(--t-11);
+ line-height: 1.35;
+ overflow: hidden;
+ display: -webkit-box;
+ -webkit-line-clamp: 2;
+ -webkit-box-orient: vertical;
+}
+
+/* One size and one colour for everything under the title, so nothing on it competes. */
+.rx-meta {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: baseline;
+ gap: 6px;
+ color: var(--text-2);
+ font-size: var(--t-11);
+ line-height: 1.4;
+}
+.rx-due.overdue { color: var(--sys-red); }
+.rx-repeat { display: inline-flex; gap: 3px; }
+.rx-moved { color: var(--accent); font-weight: 600; }
+
+/* Info and flag wait at the end of the row until it is pointed at. A flag that is set is
+ information, not a control, so it stays. */
+.rx-trailing { display: flex; align-items: center; gap: 2px; padding-top: 1px; }
+.rx-trailing .rx-icon-button { opacity: 0; }
+.rx-row:hover .rx-icon-button,
+.rx-row:focus-within .rx-icon-button,
+.rx-row.is-open .rx-icon-button,
+.rx-icon-button.rx-flag.on { opacity: 1; }
+.rx-icon-button.rx-flag.on { color: var(--sys-orange); }
+
+.rx-icon-button {
+ display: grid;
+ place-items: center;
+ width: 22px;
+ height: 22px;
+ padding: 0;
+ border: 0;
+ border-radius: 6px;
+ background: none;
+ color: var(--text-3);
+ font: inherit;
+ font-size: var(--t-13);
+ cursor: default;
+}
+.rx-icon-button svg { width: 15px; height: 15px; }
+.rx-icon-button:hover { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }
+.rx-icon-button.danger:hover { color: var(--sys-red); }
+.rx-icon-button:focus-visible { outline: 3px solid color-mix(in srgb, var(--sys-blue) 40%, transparent); opacity: 1; }
+.rx-icon-button:disabled { opacity: 0.4; }
+
+.rx-detail {
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+ margin-top: 10px;
+ padding: 12px;
+ border-radius: 10px;
+ background: color-mix(in srgb, var(--text) 5%, transparent);
+}
+.rx-field {
+ display: grid;
+ grid-template-columns: 64px minmax(0, 1fr);
+ gap: 10px;
+ align-items: center;
+}
+.rx-field > span { color: var(--text-2); font-size: var(--t-11); }
+.rx-field input,
+.rx-field textarea {
+ width: 100%;
+ padding: 5px 8px;
+ border: 1px solid var(--field-edge);
+ border-radius: 6px;
+ background: var(--field);
+ color: var(--text);
+ font: inherit;
+ font-size: var(--t-13);
+ outline: none;
+ resize: vertical;
+}
+.rx-field input:focus,
+.rx-field textarea:focus { border-color: var(--sys-blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sys-blue) 28%, transparent); }
+.rx-hint { margin: -2px 0 0 74px; color: var(--text-3); font-size: var(--t-11); }
+.rx-detail-actions { display: flex; justify-content: space-between; margin-top: 2px; }
+
+/* The last row: where a new reminder is typed. */
+.rx-add {
+ display: grid;
+ grid-template-columns: 20px minmax(0, 1fr) auto;
+ column-gap: 10px;
+ align-items: center;
+ padding: 8px 14px 8px 0;
+}
+.rx-add input {
+ min-width: 0;
+ padding: 0;
+ border: 0;
+ background: none;
+ color: var(--text);
+ font: inherit;
+ font-size: var(--t-13);
+ line-height: 20px;
+ outline: none;
+}
+.rx-add input::placeholder { color: var(--text-3); }
+.rx-add-target { max-width: 160px; }
+.rx-add-target .picker-button { font-size: var(--t-11); padding: 3px 8px; }
+
+.rx-empty { margin: 28px 0 0; color: var(--text-3); font-size: var(--t-15); text-align: center; }
+
+@media (max-width: 720px) {
+ .rx { grid-template-columns: 1fr; }
+ .rx-side { border-right: 0; border-bottom: 1px solid var(--separator); max-height: 45vh; padding-right: 2px; }
+ .rx-main { padding-left: 2px; }
+}