Native iCloud apps for Windows and Linux, built in Rust. Notes, Reminders, Calendar, Contacts, Drive and Photos, offline and in sync with your iPhone.
Rust apple-notesapple-reminderscloudkitcrdtdesktop-appicloudicloud-calendaricloud-driveicloud-notesicloud-photosiphonelinuxlinux-desktoplocal-firstoffline-firstprivacyrusttauritauri-appwindows
Notes laid out the way Apple Notes is
Yashwanth Kamireddiaa909c9e0aa9
diff --git a/.uiverify/assert.mjs b/.uiverify/assert.mjsindex 607c457..651ef66 100644--- a/.uiverify/assert.mjs+++ b/.uiverify/assert.mjs@@ -491,7 +491,7 @@ let failures = 0;};});await page.goto("http://localhost:4173", { waitUntil: "networkidle" });- await page.getByRole("button", { name: "Notes", exact: true }).click();+ await page.locator(".nav-item", { hasText: "Notes" }).click();await page.waitForTimeout(300);await page.fill('input[aria-label="Search notes"]', "curt");await page.waitForTimeout(300);diff --git a/.uiverify/notes-compose.mjs b/.uiverify/notes-compose.mjsindex 84f1ab3..08c9d5a 100644--- a/.uiverify/notes-compose.mjs+++ b/.uiverify/notes-compose.mjs@@ -56,7 +56,7 @@ await ctx.addInitScript(() => {const page = await ctx.newPage();await page.goto("http://localhost:4173", { waitUntil: "networkidle" });-await page.getByRole("button", { name: "Notes", exact: true }).click();+await page.locator(".nav-item", { hasText: "Notes" }).click();await page.waitForTimeout(300);// Watch for the moment nothing is open, and for focus leaving the editor.@@ -73,18 +73,22 @@ await page.evaluate(() => {await page.getByRole("button", { name: "New note" }).click();await page.waitForTimeout(150);await page.keyboard.type("Shopping");-const box = await page.evaluateHandle(() => document.activeElement);await page.waitForTimeout(1600); // the pause: long enough to create the note+// Enter in the title goes on to the body, as in Notes.await page.keyboard.type("\nmilk and bread");await page.waitForTimeout(1600); // and long enough to save what followed-const result = await page.evaluate((box) => ({+const text = () => page.evaluate(() => {+ const t = document.querySelector(".note-editor .note-title")?.value ?? null;+ const r = document.querySelector(".note-editor .note-text")?.value ?? null;+ return { title: t, rest: r, focused: Boolean(document.activeElement?.closest(".note-editor")) };+});+const after = await text();+const result = await page.evaluate(() => ({creates: window.__creates.length,- sameBox: document.activeElement === box && box.isConnected,blank: window.__blank,- value: box.value,saves: window.__saves,-}), box);+}));let failures = 0;const ok = (pass, yes, no) => {@@ -92,13 +96,30 @@ const ok = (pass, yes, no) => {if (!pass) failures++;};ok(result.creates === 1, "one note is created, not several", `${result.creates} notes were created`);-ok(result.sameBox, "the box being typed into stays, focused", "the box was swapped or lost focus");+ok(after.focused, "typing stays in the note throughout", "focus fell out of the note");ok(result.blank === 0, "the note never disappears into “Select a note”", `“Select a note” showed ${result.blank} time(s)`);-ok(- result.value === "Shopping\nmilk and bread" &&- result.saves.some(([g, body]) => g === "N1" && body === "Shopping\nmilk and bread"),- "what was typed after the pause is saved onto that note",- `box says ${JSON.stringify(result.value)}, saves ${JSON.stringify(result.saves)}`-);+ok(after.title === "Shopping" && after.rest === "milk and bread",+ "the first line is the title and Enter carries on into the body",+ `title ${JSON.stringify(after.title)}, body ${JSON.stringify(after.rest)}`);+ok(result.saves.some(([g, body]) => g === "N1" && body === "Shopping\nmilk and bread"),+ "what was typed after the pause is saved onto that note", `saves ${JSON.stringify(result.saves)}`);++// Backspace at the start of the body joins it back onto the title, as in Notes.+await page.locator(".note-editor .note-text").focus();+await page.evaluate(() => document.querySelector(".note-editor .note-text").setSelectionRange(0, 0));+await page.keyboard.press("Backspace");+await page.waitForTimeout(150);+const joined = await text();+ok(joined.title === "Shoppingmilk and bread" && joined.rest === "",+ "Backspace at the start of the body joins it to the title", `after Backspace: ${JSON.stringify(joined)}`);++// Enter in the middle of the title splits it there.+await page.locator(".note-editor .note-title").focus();+await page.evaluate(() => document.querySelector(".note-editor .note-title").setSelectionRange(8, 8));+await page.keyboard.press("Enter");+await page.waitForTimeout(150);+const split = await text();+ok(split.title === "Shopping" && split.rest === "milk and bread",+ "Enter in the middle of the title splits the line there", `after Enter: ${JSON.stringify(split)}`);await b.close();process.exitCode = failures === 0 ? 0 : 1;diff --git a/.uiverify/notes-look.mjs b/.uiverify/notes-look.mjsnew file mode 100644index 0000000..1d9ba02--- /dev/null+++ b/.uiverify/notes-look.mjs@@ -0,0 +1,18 @@+// Notes at a given size, in the chosen engine, for looking at.+// ENGINE=webkit node .uiverify/notes-look.mjs <out-dir> [width] [height]+import { engine } from "./engine.mjs";+import { SERVICES, installStub } from "./stub.mjs";+const [out, w = "1920", h = "1040"] = process.argv.slice(2);+const b = await engine.launch();+for (const scheme of ["dark", "light"]) {+ const ctx = await b.newContext({ viewport: { width: +w, height: +h }, colorScheme: scheme });+ await ctx.addInitScript(installStub, { screen: "library", services: SERVICES, twoFactor: null,+ calendarFixture: true, notesFixture: true, contactsFixture: true, driveFixture: true, remindersFixture: true });+ const p = await ctx.newPage();+ await p.goto("http://localhost:4173", { waitUntil: "networkidle" });+ await p.locator(".nav-item", { hasText: "Notes" }).click();+ await p.waitForTimeout(500);+ await p.screenshot({ path: `${out}/notes-${scheme}-${w}.png` });+ await ctx.close();+}+await b.close();diff --git a/.uiverify/notes-model.test.mjs b/.uiverify/notes-model.test.mjsnew file mode 100644index 0000000..c43a626--- /dev/null+++ b/.uiverify/notes-model.test.mjs@@ -0,0 +1,40 @@+// The rules Notes' list and editor follow, checked directly.+import { test } from "node:test";+import assert from "node:assert/strict";+import { groupNotes, listDate, splitTitle, joinTitle } from "../src/screens/notes/model.ts";++const now = new Date(2026, 8, 30, 12, 0);+const at = (y, m, d, h = 9) => Math.floor(new Date(y, m, d, h).getTime() / 1000);+const note = (guid, modifiedAt, pinned = false) => ({ guid, folderGuid: null, title: guid, snippet: null, body: null,+ locked: false, pinned, createdAt: null, modifiedAt, editable: true, etag: null });++test("the list is grouped the way Notes groups it, pinned first", () => {+ const sections = groupNotes([+ note("old", at(2025, 2, 1)), note("aug", at(2026, 7, 10)), note("today", at(2026, 8, 30)),+ note("pin", at(2026, 0, 1), true), note("yday", at(2026, 8, 29)), note("week", at(2026, 8, 25)),+ note("month", at(2026, 8, 10)),+ ], now);+ assert.deepEqual(sections.map((s) => [s.key, s.notes.map((n) => n.guid)]), [+ ["pinned", ["pin"]], ["today", ["today"]], ["yesterday", ["yday"]], ["week", ["week"]],+ ["month", ["month"]], ["m7", ["aug"]], ["y2025", ["old"]],+ ]);+});++test("within a group the newest comes first", () => {+ const [today] = groupNotes([note("a", at(2026, 8, 30, 8)), note("b", at(2026, 8, 30, 11))], now);+ assert.deepEqual(today.notes.map((n) => n.guid), ["b", "a"]);+});++test("a row says the time today, Yesterday, the weekday, or the date", () => {+ assert.match(listDate(at(2026, 8, 30, 9), now), /9/);+ assert.equal(listDate(at(2026, 8, 29), now), "Yesterday");+ assert.equal(listDate(at(2026, 8, 27), now), new Date(2026, 8, 27).toLocaleDateString(undefined, { weekday: "long" }));+ assert.match(listDate(at(2026, 5, 1), now), /2026/);+});++test("splitting a note into title and the rest loses nothing", () => {+ for (const text of ["", "Title", "Title\n", "Title\nbody", "\nbody", "T\n\n\nlast\n"]) {+ const { title, rest } = splitTitle(text);+ assert.equal(joinTitle(title, rest, text.includes("\n")), text, JSON.stringify(text));+ }+});diff --git a/.uiverify/notes-trash.mjs b/.uiverify/notes-trash.mjsindex b29b5af..c3e7abd 100644--- a/.uiverify/notes-trash.mjs+++ b/.uiverify/notes-trash.mjs@@ -29,7 +29,7 @@ await ctx.addInitScript(() => {});const page = await ctx.newPage();await page.goto("http://localhost:4173", { waitUntil: "networkidle" });-await page.getByRole("button", { name: "Notes", exact: true }).click();+await page.locator(".nav-item", { hasText: "Notes" }).click();await page.getByRole("button", { name: "Recently Deleted" }).click();await page.waitForTimeout(500);diff --git a/.uiverify/stub.mjs b/.uiverify/stub.mjsindex b6a730f..ffea462 100644--- a/.uiverify/stub.mjs+++ b/.uiverify/stub.mjs@@ -114,7 +114,7 @@ export function installStub({ screen, services, twoFactor, calendarFixture, note];window.__TAURI_INTERNALS__ = {transformCallback: (cb) => cb,- invoke: async (cmd) => {+ invoke: async (cmd, args) => {switch (cmd) {case "auth_status":return { hasStoredSession: screen === "library", signedIn: screen === "library" };@@ -143,6 +143,12 @@ export function installStub({ screen, services, twoFactor, calendarFixture, notecase "note_save": case "note_delete": case "note_move": return null;case "note_create": return "Note/new";case "notes_in": return !notesFixture ? [] : noteList;+ case "note_body": return (noteList.find((n) => n.guid === args?.guid) ?? {}).body ?? null;+ case "note_counts": {+ const per = new Map();+ for (const n of noteList) per.set(n.folderGuid, (per.get(n.folderGuid) ?? 0) + 1);+ return [noteList.length, [...per.entries()]];+ }case "contact_save": return "C-new";case "contact_delete": return null;case "contacts_list": return !contactsFixture ? [] : contactList;diff --git a/check.sh b/check.shindex a2ce85a..af66ad2 100755--- a/check.sh+++ b/check.sh@@ -20,6 +20,7 @@ step "rust lint" cargo clippy --workspace --all-targets -- -D warningsstep "rust tests" cargo test --workspace --quietstep "typescript" npx tsc --noEmitstep "calendar layout" node --test .uiverify/calendar-model.test.mjs+step "notes layout" node --test .uiverify/notes-model.test.mjsstep "frontend build" npm run build# The browser checks need the built bundle served.diff --git a/crates/quince-core/src/notes.rs b/crates/quince-core/src/notes.rsindex de1d70b..7ab3532 100644--- a/crates/quince-core/src/notes.rs+++ b/crates/quince-core/src/notes.rs@@ -200,6 +200,26 @@ impl Library {})}+ /// How many notes each folder holds, by folder guid, and in all of them together.+ ///+ /// The sidebar puts a count beside every folder, as Notes does. "All" leaves Recently+ /// Deleted out — a note waiting to be purged is not one of your notes — and the trash is+ /// counted on its own line.+ pub fn note_counts(&self) -> Result<(i64, Vec<(String, i64)>)> {+ let mut stmt = self.conn.prepare(+ "SELECT coalesce(folder_guid, ''), count(*) FROM notes GROUP BY folder_guid",+ )?;+ let per: Vec<(String, i64)> = stmt+ .query_map([], |row| Ok((row.get(0)?, row.get(1)?)))?+ .collect::<rusqlite::Result<Vec<_>>>()?;+ let all = per+ .iter()+ .filter(|(guid, _)| guid != TRASH_FOLDER)+ .map(|(_, n)| n)+ .sum();+ Ok((all, per))+ }+pub fn note_folders(&self) -> Result<Vec<NoteFolder>> {let mut stmt = self.conn.prepare("SELECT guid, title, sort_order, parent_guid@@ -705,3 +725,54 @@ mod unreadable_tests {assert_eq!(lib.note_body("no-such-note").unwrap(), None);}}++#[cfg(test)]+mod count_tests {+ use super::*;++ fn note(guid: &str, folder: &str) -> Note {+ Note {+ guid: guid.into(),+ folder_guid: Some(folder.into()),+ title: guid.into(),+ snippet: None,+ body: None,+ locked: false,+ pinned: false,+ created_at: None,+ modified_at: None,+ editable: true,+ etag: None,+ }+ }++ #[test]+ fn every_folder_is_counted_and_all_leaves_out_the_trash() {+ let mut lib = Library::in_memory().unwrap();+ let folder = |guid: &str| NoteFolder {+ guid: guid.into(),+ title: guid.into(),+ sort_order: 0,+ parent_guid: None,+ };+ lib.put_note_folders(&[+ folder("DefaultFolder-CloudKit"),+ folder("Folder/work"),+ folder(TRASH_FOLDER),+ ])+ .unwrap();+ lib.put_notes(&[+ note("a", "DefaultFolder-CloudKit"),+ note("b", "DefaultFolder-CloudKit"),+ note("c", "Folder/work"),+ note("d", TRASH_FOLDER),+ ])+ .unwrap();+ let (all, per) = lib.note_counts().unwrap();+ assert_eq!(all, 3);+ let of = |g: &str| per.iter().find(|(f, _)| f == g).map(|(_, n)| *n);+ assert_eq!(of("DefaultFolder-CloudKit"), Some(2));+ assert_eq!(of("Folder/work"), Some(1));+ assert_eq!(of(TRASH_FOLDER), Some(1));+ }+}diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rsindex 8abd39d..ecac45e 100644--- a/src-tauri/src/main.rs+++ b/src-tauri/src/main.rs@@ -832,6 +832,13 @@ async fn notes_search(query: String, data: State<'_, Data>) -> UiResult<Vec<Note}/// Notes in a folder, or every note when no folder is given.+/// How many notes each folder holds, and all of them but Recently Deleted.+#[tauri::command]+async fn note_counts(data: State<'_, Data>) -> UiResult<(i64, Vec<(String, i64)>)> {+ let library = data.0.lock().await;+ library.note_counts().map_err(|e| e.to_string())+}+#[tauri::command]async fn notes_in(folder_guid: Option<String>, data: State<'_, Data>) -> UiResult<Vec<Note>> {let library = data.0.lock().await;@@ -1710,6 +1717,7 @@ fn main() {note_move,notes_in,notes_search,+ note_counts,contacts_list,contact_save,contact_delete,diff --git a/src/lib/ipc.ts b/src/lib/ipc.tsindex 8ade3dd..b489386 100644--- a/src/lib/ipc.ts+++ b/src/lib/ipc.ts@@ -108,6 +108,8 @@ export const api = {noteFolders: () => invoke<NoteFolder[]>("note_folders"),notesIn: (folderGuid: string | null) => invoke<Note[]>("notes_in", { folderGuid }),+ /** [notes outside Recently Deleted, [folder guid, count]…]. */+ noteCounts: () => invoke<[number, [string, number][]]>("note_counts"),/** Notes holding every word typed, from every folder but Recently Deleted. */notesSearch: (query: string) => invoke<Note[]>("notes_search", { query }),/**diff --git a/src/main.tsx b/src/main.tsxindex e8a6da8..fe6ed06 100644--- a/src/main.tsx+++ b/src/main.tsx@@ -5,6 +5,7 @@ import "./styles/tokens.css";import "./styles/app.css";import "./styles/reminders.css";import "./styles/calendar.css";+import "./styles/notes.css";ReactDOM.createRoot(document.getElementById("root")!).render(<React.StrictMode>diff --git a/src/screens/NotesView.tsx b/src/screens/NotesView.tsxindex 9fb94c5..9380aed 100644--- a/src/screens/NotesView.tsx+++ b/src/screens/NotesView.tsx@@ -1,31 +1,13 @@-import { useCallback, useEffect, useMemo, useRef, useState } from "react";+import { Fragment, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";+import { flushSync } from "react-dom";+import { Folder, FolderOpen, SquarePen, Trash2 } from "lucide-react";+import { editorDate, groupNotes, joinTitle, listDate, splitTitle } from "./notes/model";import { api, messageOf, nestFolders, type Note, type NoteFolder } from "../lib/ipc";import { useSync } from "../lib/sync";import { Picker } from "../components/Picker";const ALL = "__all__";-const when = (seconds: number | null) => {- if (seconds === null) return "";- const d = new Date(seconds * 1000);- const today = new Date();- const sameDay =- d.getFullYear() === today.getFullYear() &&- d.getMonth() === today.getMonth() &&- d.getDate() === today.getDate();- return sameDay- ? d.toLocaleTimeString(undefined, { hour: "numeric", minute: "2-digit" })- : d.toLocaleDateString(undefined, { day: "numeric", month: "short", year: "numeric" });-};--/** True when the body already opens with the title, which is Apple's usual case. */-function bodyRepeatsTitle(note: Note, body: string | null): boolean {- const text = body?.trimStart();- if (!text) return false;- const title = note.title.trim();- return title.length > 0 && text.startsWith(title);-}-/** Apple's Recently Deleted, by the record name that is the same in every language. */const TRASH_FOLDER = "TrashFolder-CloudKit";@@ -46,7 +28,19 @@ export function NotesView() {const [query, setQuery] = useState("");const searching = query.trim().length > 0;+ /** Notes outside Recently Deleted, and how many each folder holds. */+ const [counts, setCounts] = useState<{ all: number; per: Map<string, number> }>({+ all: 0,+ per: new Map(),+ });+const read = useCallback(async () => {+ api+ .noteCounts()+ .then(([all, per]) => setCounts({ all, per: new Map(per) }))+ .catch(() => {+ // Counts are a courtesy; the list is what matters.+ });const [found, list] = await Promise.all([api.noteFolders(),// Search reaches every folder, as Apple's does — a note is found wherever it is filed.@@ -315,6 +309,7 @@ export function NotesView() {);const editor = useRef<HTMLTextAreaElement | null>(null);+ const bodyEditor = useRef<HTMLTextAreaElement | null>(null);const create = useCallback(async () => {if (composingRef.current) await commitComposing();await flush();@@ -361,49 +356,104 @@ export function NotesView() {return () => window.clearTimeout(timer);}, [saved]);+ /** What the editor holds right now, whoever is writing it. */+ const text = composing ? composing.body : (draft ?? body ?? "");+ const { title: titleLine, rest } = splitTitle(text);+ const hadBreak = text.includes("\n");+ const canEdit = Boolean(composing) || Boolean(open && !open.locked && open.editable && body !== null);++ /** Every change to either half of the editor becomes one change to the whole note. */+ const apply = (next: string) => {+ if (composingRef.current) setComposing((c) => (c ? { ...c, body: next } : c));+ else type(next);+ };+ /**+ * Make a change that moves the cursor into the other half, all at once. Waiting a frame to+ * move focus left a gap a fast typist fills: the letter after Enter landed back in the+ * title. The change is applied and drawn synchronously, and focus moves in the same turn.+ */+ const moveWith = (next: string, el: HTMLTextAreaElement | null, at: number) => {+ flushSync(() => apply(next));+ if (!el) return;+ el.focus();+ el.setSelectionRange(at, at);+ };+ const place = (el: HTMLTextAreaElement | null, at: number) => {+ if (!el) return;+ el.focus();+ el.setSelectionRange(at, at);+ };++ // The title grows onto more lines as it is typed, as a heading does, rather than scrolling.+ useLayoutEffect(() => {+ const el = editor.current;+ if (!el) return;+ el.style.height = "0px";+ el.style.height = `${el.scrollHeight}px`;+ }, [titleLine, openGuid, composing]);++ const sections = useMemo(() => groupNotes(notes), [notes]);+ const heading = searching+ ? "Search"+ : folder === ALL+ ? "All iCloud"+ : (folders.find((f) => f.guid === folder)?.title ?? "Notes");+ const saveFailed = error !== null;+return (<div className="notes"><aside className="notes-folders" aria-label="Note folders">- <button- className="rem-list"- aria-current={folder === ALL}- onClick={() => setFolder(ALL)}- >- <span className="rem-list-name">All Notes</span>+ <p className="notes-side-heading">iCloud</p>+ <button className="notes-folder" aria-current={folder === ALL} onClick={() => setFolder(ALL)}>+ <FolderOpen className="notes-folder-glyph" size={16} strokeWidth={2} aria-hidden="true" />+ <span className="notes-folder-name">All iCloud</span>+ <span className="notes-folder-count">{counts.all || ""}</span></button>- {nestFolders(folders).map(({ folder: f, depth }) => (+ {nestFolders(folders)+ .filter(({ folder: f }) => f.guid !== TRASH_FOLDER)+ .map(({ folder: f, depth }) => (+ <button+ key={f.guid}+ className="notes-folder"+ aria-current={folder === f.guid}+ onClick={() => setFolder(f.guid)}+ style={depth > 0 ? { paddingLeft: `${8 + depth * 16}px` } : undefined}+ >+ <Folder className="notes-folder-glyph" size={16} strokeWidth={2} aria-hidden="true" />+ <span className="notes-folder-name">{f.title}</span>+ <span className="notes-folder-count">{counts.per.get(f.guid) || ""}</span>+ </button>+ ))}+ {folders.some((f) => f.guid === TRASH_FOLDER) && (<button- key={f.guid}- className="rem-list"- aria-current={folder === f.guid}- onClick={() => setFolder(f.guid)}- /* A folder inside another is shown inside it, the way it was filed. */- style={depth > 0 ? { paddingLeft: `${8 + depth * 14}px` } : undefined}+ className="notes-folder"+ aria-current={folder === TRASH_FOLDER}+ onClick={() => setFolder(TRASH_FOLDER)}>- <span className="rem-list-name">{f.title}</span>+ <Trash2 className="notes-folder-glyph" size={16} strokeWidth={2} aria-hidden="true" />+ <span className="notes-folder-name">Recently Deleted</span>+ <span className="notes-folder-count">{counts.per.get(TRASH_FOLDER) || ""}</span></button>- ))}+ )}</aside><section className="notes-list" aria-label="Notes">- <header className="cal-bar">- <div className="cal-nav">- <h1>- {searching- ? "Search"- : folder === ALL- ? "All Notes"- : folders.find((f) => f.guid === folder)?.title}- </h1>- <span className="badge">+ <header className="notes-list-head">+ <div className="notes-list-title">+ <h1>{heading}</h1>+ <span className="notes-list-count">{notes.length} {notes.length === 1 ? "note" : "notes"}</span></div>- <div className="cal-actions">- <button className="quiet" onClick={() => void create()} disabled={busy}>- New note- </button>- </div>+ <button+ className="notes-icon"+ aria-label="New note"+ title="New Note"+ onClick={() => void create()}+ disabled={busy}+ >+ <SquarePen size={18} strokeWidth={2} aria-hidden="true" />+ </button></header><inputclassName="notes-search"@@ -424,7 +474,7 @@ export function NotesView() {value={folder}onChange={setFolder}options={[- { value: ALL, label: "All Notes" },+ { value: ALL, label: "All iCloud" },...folders.map((f) => ({ value: f.guid, label: f.title })),]}/>@@ -432,97 +482,154 @@ export function NotesView() {{error && <p className="error" role="alert">{error}</p>}- <ul className="note-rows">- {notes.map((note) => (- <li key={note.guid}>- <button- className="note-row"- aria-current={openGuid === note.guid}- onClick={() => void selectNote(note.guid)}- >- <span className="note-row-title">- {note.pinned && <span className="pin" aria-label="Pinned">●</span>}- {note.title}- </span>- <span className="note-row-meta">- <span className="note-row-when">{when(note.modifiedAt)}</span>- <span className="note-row-snippet">- {note.locked ? "Locked" : note.snippet?.slice(0, 60) || "No text"}- </span>- </span>- </button>- </li>+ <div className="note-rows" role="list">+ {sections.map((section) => (+ <Fragment key={section.key}>+ <h2 className="notes-section">{section.heading}</h2>+ {section.notes.map((note) => (+ <div role="listitem" key={note.guid}>+ <button+ className="note-row"+ aria-current={openGuid === note.guid}+ onClick={() => void selectNote(note.guid)}+ >+ <span className="note-row-title">{note.title}</span>+ <span className="note-row-meta">+ <span className="note-row-when">{listDate(note.modifiedAt)}</span>+ <span className="note-row-snippet">+ {note.locked ? "Locked" : note.snippet?.slice(0, 80) || "No additional text"}+ </span>+ </span>+ </button>+ </div>+ ))}+ </Fragment>))}- </ul>+ </div>{loaded && notes.length === 0 && !error && (- <p className="cal-empty">No notes here.</p>+ <p className="cal-empty notes-empty">{searching ? "No results." : "No notes here."}</p>)}</section><article className="note-body" aria-label="Note">- {/*- * One editor for a new note and a saved one, always in the same place, so the box- * being typed into is never taken away when a new note becomes a real one. The- * slots above it are held open with `false` rather than removed, which is what lets- * React keep the same element — focus, cursor and selection with it.- */}- {!composing && open && !open.locked && !bodyRepeatsTitle(open, body) && (- <h2>{open.title}</h2>- )}- {!composing && open && !open.locked && (+ {(composing || open) && (<div className="note-bar"><p className="note-when">- {busy ? "Saving…" : dirty ? "Saving…" : saved ? "Saved" : when(open.modifiedAt)}+ {busy || (!saveFailed && (dirty || composing?.body.trim()))+ ? "Saving…"+ : saved+ ? "Saved"+ : editorDate(composing ? Math.floor(Date.now() / 1000) : (open?.modifiedAt ?? null))}</p>- <div className="note-bar-actions">- <Picker- label={`Folder for ${open.title}`}- value={open.folderGuid ?? ALL}- disabled={busy}- onChange={(guid) => void moveTo(guid)}- options={[- { value: ALL, label: "No folder" },- ...folders.map((f) => ({ value: f.guid, label: f.title })),- ]}- />- {inTrash && (- <button className="quiet" onClick={() => void recover()} disabled={busy}>- Recover- </button>- )}- <button className="quiet danger" onClick={() => void remove()} disabled={busy}>- {inTrash ? "Delete Now" : "Delete"}- </button>- </div>+ {!composing && open && !open.locked && (+ <div className="note-bar-actions">+ <Picker+ label={`Folder for ${open.title}`}+ value={open.folderGuid ?? ALL}+ disabled={busy}+ onChange={(guid) => void moveTo(guid)}+ options={[+ { value: ALL, label: "Notes" },+ ...folders+ .filter((f) => f.guid !== TRASH_FOLDER)+ .map((f) => ({ value: f.guid, label: f.title })),+ ]}+ />+ {inTrash && (+ <button className="quiet" onClick={() => void recover()} disabled={busy}>+ Recover+ </button>+ )}+ {inTrash ? (+ <button className="quiet danger" onClick={() => void remove()} disabled={busy}>+ Delete Now+ </button>+ ) : (+ <button+ className="notes-icon danger"+ aria-label="Delete"+ title="Delete"+ onClick={() => void remove()}+ disabled={busy}+ >+ <Trash2 size={17} strokeWidth={2} aria-hidden="true" />+ </button>+ )}+ </div>+ )}</div>)}- {composing || (open && !open.locked && open.editable && body !== null) ? (- <textarea- key="editor"- ref={editor}- className="note-text"- aria-label={composing ? "New note" : `Body of ${open?.title ?? "note"}`}- value={composing ? composing.body : (draft ?? body ?? "")}- placeholder={composing ? "New Note" : undefined}- onChange={(e) => {- const text = e.target.value;- if (composingRef.current) {- setComposing((c) => (c ? { ...c, body: text } : c));- } else {- type(text);- }- }}- onKeyDown={(e) => {- // Nothing needs saving by hand, but the reflex deserves an answer.- if ((e.metaKey || e.ctrlKey) && e.key === "s") {- e.preventDefault();++ {/*+ * One editor for a new note and a saved one, always in the same place, so the box+ * being typed into is never taken away when a new note becomes a real one. The+ * first line is a title field and the rest a body, but they are one text: Enter in+ * the title splits it, Backspace at the start of the body joins it, and what is+ * saved is always the two put back together.+ */}+ {canEdit ? (+ <div className="note-editor">+ <textarea+ key="title"+ ref={editor}+ className="note-title"+ rows={1}+ aria-label={composing ? "New note" : `Title of ${open?.title ?? "note"}`}+ placeholder={composing ? "New Note" : undefined}+ value={titleLine}+ spellCheck+ onChange={(e) => apply(joinTitle(e.target.value, rest, hadBreak))}+ onKeyDown={(e) => {+ const el = e.currentTarget;+ if (e.key === "Enter") {+ e.preventDefault();+ const at = el.selectionStart;+ moveWith(+ `${titleLine.slice(0, at)}\n${titleLine.slice(at)}${hadBreak ? `\n${rest}` : ""}`,+ bodyEditor.current,+ 0+ );+ } else if (e.key === "ArrowDown" && el.selectionStart === titleLine.length) {+ e.preventDefault();+ place(bodyEditor.current, 0);+ } else if ((e.metaKey || e.ctrlKey) && e.key === "s") {+ e.preventDefault();+ void (composingRef.current ? commitComposing() : flush());+ }+ }}+ onBlur={(e) => {+ if (e.relatedTarget === bodyEditor.current) return;void (composingRef.current ? commitComposing() : flush());- }- }}- onBlur={() => void (composingRef.current ? commitComposing() : flush())}- spellCheck- />+ }}+ />+ <textarea+ key="body"+ ref={bodyEditor}+ className="note-text"+ aria-label={composing ? "New note text" : `Body of ${open?.title ?? "note"}`}+ value={rest}+ spellCheck+ onChange={(e) => apply(joinTitle(titleLine, e.target.value, true))}+ onKeyDown={(e) => {+ const el = e.currentTarget;+ if (e.key === "Backspace" && el.selectionStart === 0 && el.selectionEnd === 0 && hadBreak) {+ e.preventDefault();+ moveWith(titleLine + rest, editor.current, titleLine.length);+ } else if (e.key === "ArrowUp" && !rest.slice(0, el.selectionStart).includes("\n")) {+ e.preventDefault();+ place(editor.current, titleLine.length);+ } else if ((e.metaKey || e.ctrlKey) && e.key === "s") {+ e.preventDefault();+ void (composingRef.current ? commitComposing() : flush());+ }+ }}+ onBlur={(e) => {+ if (e.relatedTarget === editor.current) return;+ void (composingRef.current ? commitComposing() : flush());+ }}+ />+ </div>) : open?.locked ? (<p className="cal-empty">This note is locked. Apple keeps it encrypted, so there is nothing here to show —@@ -535,15 +642,16 @@ export function NotesView() {Opening…</p>) : open ? (- <>- <pre className="note-text">{body}</pre>+ <div className="note-editor is-readonly">+ <h1 className="note-title">{splitTitle(body ?? "").title}</h1>+ <pre className="note-text">{splitTitle(body ?? "").rest}</pre><p className="note-readonly">Quince can’t yet save changes to this note without risking what is in it — itis very long, or its copy on iCloud is out of step with your devices — so it isread-only here. Editing it on an Apple device is safe, and after that Quince canusually edit it again.</p>- </>+ </div>) : (loaded && <p className="cal-empty">Select a note.</p>)}diff --git a/src/screens/notes/model.ts b/src/screens/notes/model.tsnew file mode 100644index 0000000..50d0d69--- /dev/null+++ b/src/screens/notes/model.ts@@ -0,0 +1,84 @@+/**+ * The rules Notes' list and editor follow, kept apart from drawing them so they can be tested.+ */+import type { Note } from "../../lib/ipc";++const midnight = (d: Date) => new Date(d.getFullYear(), d.getMonth(), d.getDate());+const daysBetween = (from: Date, to: Date) =>+ Math.round((midnight(to).getTime() - midnight(from).getTime()) / 864e5);++/** One run of the note list under a heading. */+export type Section = { key: string; heading: string; notes: Note[] };++/**+ * The list the way Notes groups it: Pinned first, then Today, Yesterday, Previous 7 Days,+ * Previous 30 Days, then each earlier month of this year by name, then each earlier year.+ * Within a group, most recently changed first. A group with nothing in it is not shown.+ */+export function groupNotes(notes: Note[], now = new Date()): Section[] {+ const out = new Map<string, Section>();+ const add = (key: string, heading: string, note: Note) => {+ const s = out.get(key) ?? { key, heading, notes: [] };+ s.notes.push(note);+ out.set(key, s);+ };+ const sorted = [...notes].sort((a, b) => (b.modifiedAt ?? 0) - (a.modifiedAt ?? 0));+ for (const note of sorted) {+ if (note.pinned) {+ add("pinned", "Pinned", note);+ continue;+ }+ if (note.modifiedAt === null) {+ add("undated", "Earlier", note);+ continue;+ }+ const when = new Date(note.modifiedAt * 1000);+ const ago = daysBetween(when, now);+ if (ago <= 0) add("today", "Today", note);+ else if (ago === 1) add("yesterday", "Yesterday", note);+ else if (ago <= 7) add("week", "Previous 7 Days", note);+ else if (ago <= 30) add("month", "Previous 30 Days", note);+ else if (when.getFullYear() === now.getFullYear())+ add(`m${when.getMonth()}`, when.toLocaleDateString(undefined, { month: "long" }), note);+ else add(`y${when.getFullYear()}`, String(when.getFullYear()), note);+ }+ // Map keeps insertion order, and notes went in newest first, so groups already run+ // newest first — Pinned aside, which always leads.+ const sections = [...out.values()];+ const pinned = sections.filter((s) => s.key === "pinned");+ return [...pinned, ...sections.filter((s) => s.key !== "pinned")];+}++/** The date a row shows: the time today, "Yesterday", the weekday this week, else the date. */+export function listDate(seconds: number | null, now = new Date()): string {+ if (seconds === null) return "";+ const when = new Date(seconds * 1000);+ const ago = daysBetween(when, now);+ if (ago <= 0) return when.toLocaleTimeString(undefined, { hour: "numeric", minute: "2-digit" });+ if (ago === 1) return "Yesterday";+ if (ago < 7) return when.toLocaleDateString(undefined, { weekday: "long" });+ return when.toLocaleDateString(undefined, { day: "numeric", month: "numeric", year: "numeric" });+}++/** The date at the top of the editor: "30 September 2026 at 10:02 PM". */+export function editorDate(seconds: number | null): string {+ if (seconds === null) return "";+ const when = new Date(seconds * 1000);+ const day = when.toLocaleDateString(undefined, { day: "numeric", month: "long", year: "numeric" });+ const time = when.toLocaleTimeString(undefined, { hour: "numeric", minute: "2-digit" });+ return `${day} at ${time}`;+}++/**+ * A note's text as the editor shows it: its first line, set as the title, and the rest.+ * Joining them back gives exactly the text that went in, so nothing is gained or lost by+ * editing the two halves.+ */+export function splitTitle(text: string): { title: string; rest: string } {+ const at = text.indexOf("\n");+ return at < 0 ? { title: text, rest: "" } : { title: text.slice(0, at), rest: text.slice(at + 1) };+}++export function joinTitle(title: string, rest: string, hadBreak: boolean): string {+ return rest.length > 0 || hadBreak ? `${title}\n${rest}` : title;+}diff --git a/src/styles/app.css b/src/styles/app.cssindex 3910e2e..d36c6fb 100644--- a/src/styles/app.css+++ b/src/styles/app.css@@ -633,215 +633,16 @@border-color: var(--text-3);}-/* ---- notes ----------------------------------------------------------------------- Apple Notes: folders, then a list of notes, then the note itself. */--.notes {- display: grid;- /* Wide enough for "Recently Deleted", which is the longest name Apple ever puts here and- the one that was being cut to "Recently Delet…". */- grid-template-columns: 184px minmax(260px, 320px) minmax(0, 1fr);- gap: 16px;- height: 100%;- min-height: 0;-}--.notes-folders {- overflow-y: auto;- border-right: 1px solid var(--separator);- padding: 0 10px 0 0;-}--.notes-list {- display: flex;- flex-direction: column;- min-height: 0;- border-right: 1px solid var(--separator);- padding: 0 14px;- /* Without this the header's actions overflow a 250px column and land on top of the note- body — a grid column does not shrink below its content unless told to. */- min-width: 0;-}--/* The list column is narrow, so its header stacks instead of spreading across one row. */-.notes-list .cal-bar {- flex-direction: column;- align-items: flex-start;- gap: 4px;- margin-bottom: 10px;-}--.notes-list .cal-bar h1 { font-size: var(--t-17); min-width: 0; }-.notes-list .cal-actions { gap: 10px; }--.note-rows { list-style: none; margin: 0; padding: 0; overflow-y: auto; min-height: 0; }--.note-row {- display: flex;- flex-direction: column;- gap: 3px;- width: 100%;- border: 0;- background: none;- color: var(--text);- font: inherit;- text-align: left;- padding: 9px 10px;- border-radius: var(--r-field);- cursor: pointer;-}--.note-row:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }-.note-row[aria-current="true"] { background: var(--gold-tint); }-.note-row:focus-visible { outline: 3px solid var(--gold-ring); outline-offset: -1px; }--.note-row-title {- font-size: var(--t-13);- font-weight: 600;- overflow: hidden;- text-overflow: ellipsis;- white-space: nowrap;-}-.pin { color: var(--gold); font-size: 9px; margin-right: 5px; vertical-align: 2px; }-/* Date and preview share a line beneath the title, which is how a note reads at a glance. */-.note-row-meta {- display: flex;- gap: 7px;- font-size: var(--t-11);- color: var(--text-2);- min-width: 0;- line-height: 1.4;-}--.note-row-when { flex: none; color: var(--text-3); }-.note-row-snippet { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }--/* A reading measure has to stay a measure, but stranding it against the left edge of a very- wide pane looks broken. Centre the column instead, which is what Apple does. */-.note-body {- overflow-y: auto;- min-height: 0;- padding: 4px 40px 40px;- display: flex;- flex-direction: column;- align-items: center;-}--.note-body > * {- width: 100%;- /* A measure that grows with the window instead of stopping dead: comfortable to read on- a laptop, and not a ribbon of text on a wide display. */- max-width: min(92ch, 100%);-}--.note-body h2 {- margin: 0 0 3px;- font-size: var(--t-22);- font-weight: 600;- letter-spacing: -0.021em;- line-height: 1.25;- /* A note with no real title borrows its first line, which can be a whole paragraph.- Two lines is enough to identify it. */- display: -webkit-box;- -webkit-line-clamp: 2;- -webkit-box-orient: vertical;- overflow: hidden;-}--.note-when {- margin: 0 0 20px;- color: var(--text-3);- font-size: var(--t-11);-}--.note-text {- margin: 0;- /* A note is prose, not code: inherit the interface face rather than a monospace default,- and give it a measure and leading meant for reading. */- font: inherit;- font-size: var(--t-15);- line-height: 1.6;- white-space: pre-wrap;- overflow-wrap: anywhere;- max-width: 68ch;-}--/* The editor is the same surface as the reader, with no border and no field chrome: typing- in a note should feel like writing on the page, which is how Apple's own editor reads. */-textarea.note-text {- width: 100%;- flex: 1;- min-height: 40vh;- resize: none;- border: 0;- padding: 0;- background: none;- color: inherit;-}--textarea.note-text:focus {- outline: none;-}--textarea.note-text:disabled {- color: var(--text-2);-}--.note-bar {- display: flex;- align-items: center;- gap: 10px;- flex-wrap: wrap;- padding-bottom: 10px;- margin-bottom: 14px;- border-bottom: 1px solid var(--separator);-}--/* The date leads, the actions follow it — not flung to the far end of the measure. */-.note-bar .note-when { margin: 0; margin-right: auto; }--.note-bar-actions {- display: flex;- align-items: center;- gap: 6px;-}--.note-bar-actions .picker { max-width: 170px; }-.quiet.danger { color: var(--danger); }-.note-readonly {- margin: 14px 0 0;- max-width: 68ch;- font-size: var(--t-11);- color: var(--text-3);-}---/* Apple gives Notes three columns; our service sidebar already takes one, so these have to- earn their width. Folders are few and short, the list carries two lines per row, and the- body gets everything left over. */-.notes { grid-template-columns: 184px minmax(260px, 320px) minmax(0, 1fr); gap: 0; }--/* Hidden while the folder column is visible; the media query below reveals it. Declared- first so equal specificity resolves in the query's favour. */-.notes-folder-picker { display: none; }-/* Four columns do not fit a half-screen window: at 958px the body was reduced to about200px, wrapping every few words. Below this width the folder column folds away and itschoice moves into the list, which is what Apple does when space runs out. */@media (max-width: 1180px) {- .notes { grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); }- .notes-folders { display: none; }- .notes-folder-picker { display: block; }}-.notes-folder-picker .picker { width: 100%; margin-bottom: 8px; }--.content:has(.notes) { display: flex; flex-direction: column; overflow: hidden; }-/* ---- contacts -------------------------------------------------------------------Apple Contacts: a searchable list, then the person. */@@ -1493,14 +1294,6 @@ textarea.note-text:disabled {font-size: var(--t-13);}-/* Shown while a note's own text is being fetched, in place of anything typeable. */-.note-loading {- margin: 0;- padding: 10px 2px;- color: var(--text-3);- font-size: var(--t-13);-}-/* Read aloud but not drawn — the full wording of a repeat, where the row shows the short one. */.visually-hidden {position: absolute;@@ -1567,21 +1360,6 @@ textarea.note-text:disabled {background: color-mix(in srgb, var(--text) 8%, transparent);}-/* Search above the list, where Apple puts it: quiet until typed in. */-.notes-search {- width: 100%;- margin: 0 0 8px;- padding: 6px 10px;- border: 0;- border-radius: var(--r-field);- background: color-mix(in srgb, var(--text) 7%, transparent);- color: var(--text);- font: inherit;- font-size: var(--t-13);-}-.notes-search::placeholder { color: var(--text-3); }-.notes-search:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--gold-ring); }-/* ---- uploads ---------------------------------------------------------------- */.upload-menu-wrap { position: relative; display: inline-flex; }diff --git a/src/styles/notes.css b/src/styles/notes.cssnew file mode 100644index 0000000..e96c27b--- /dev/null+++ b/src/styles/notes.css@@ -0,0 +1,242 @@+/* Notes, laid out the way Apple Notes is: folders, the list, the note. */++.content:has(.notes) { display: flex; flex-direction: column; overflow: hidden; padding-top: 18px; }++.notes {+ flex: 1;+ min-height: 0;+ display: grid;+ grid-template-columns: 208px minmax(250px, 320px) minmax(0, 1fr);+}++/* ---- folders -------------------------------------------------------------------- */++.notes-folders {+ display: flex;+ flex-direction: column;+ gap: 1px;+ min-height: 0;+ overflow-y: auto;+ padding: 2px 12px 12px;+ border-right: 1px solid var(--separator);+}+.notes-side-heading {+ margin: 0 0 4px;+ padding: 0 8px;+ color: var(--text-3);+ font-size: var(--t-11);+ font-weight: 600;+}+.notes-folder {+ display: flex;+ align-items: center;+ gap: 8px;+ height: 30px;+ padding: 0 8px;+ border: 0;+ border-radius: 7px;+ background: none;+ color: var(--text);+ font: inherit;+ font-size: var(--t-13);+ text-align: left;+ cursor: default;+}+.notes-folder:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }+.notes-folder[aria-current="true"] { background: color-mix(in srgb, var(--text) 12%, transparent); }+.notes-folder:focus-visible { outline: 3px solid var(--gold-ring); outline-offset: -1px; }+/* Apple's folders are drawn in the accent, which in Notes is its yellow — here, quince gold. */+.notes-folder-glyph { flex: none; color: var(--gold); }+.notes-folder-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }+.notes-folder-count { color: var(--text-3); font-variant-numeric: tabular-nums; }++/* ---- the list ------------------------------------------------------------------- */++.notes-list {+ display: flex;+ flex-direction: column;+ min-width: 0;+ min-height: 0;+ padding: 0 10px;+ border-right: 1px solid var(--separator);+}+.notes-list-head {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 8px;+ padding: 0 4px 10px;+}+.notes-list-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; }+.notes-list-title h1 {+ margin: 0;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ font-size: var(--t-17);+ font-weight: 700;+}+.notes-list-count { flex: none; color: var(--text-3); font-size: var(--t-13); }++.notes-icon {+ display: grid;+ place-items: center;+ flex: none;+ width: 30px;+ height: 28px;+ padding: 0;+ border: 0;+ border-radius: 7px;+ background: none;+ color: var(--text-2);+ cursor: default;+}+.notes-icon:hover { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }+.notes-icon.danger:hover { color: var(--danger); }+.notes-icon:focus-visible { outline: 3px solid var(--gold-ring); }+.notes-icon:disabled { opacity: 0.45; }++.notes-search {+ width: 100%;+ height: 28px;+ margin-bottom: 8px;+ padding: 0 10px;+ border: 0;+ border-radius: var(--r-field);+ background: color-mix(in srgb, var(--text) 7%, transparent);+ color: var(--text);+ font: inherit;+ font-size: var(--t-13);+ outline: none;+}+.notes-search::placeholder { color: var(--text-3); }+.notes-search:focus-visible { box-shadow: 0 0 0 3px var(--gold-ring); }++.notes-folder-picker { display: none; margin-bottom: 8px; }+.notes-folder-picker .picker { width: 100%; }++.note-rows { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -4px; padding: 0 4px 12px; }++/* A group's heading, as Notes writes "Today" or "Previous 7 Days" over the list. */+.notes-section {+ position: sticky;+ top: 0;+ z-index: 1;+ margin: 10px 0 2px;+ padding: 4px 10px;+ background: var(--bg);+ color: var(--text);+ font-size: var(--t-13);+ font-weight: 700;+}+.notes-section:first-child { margin-top: 0; }++.note-row {+ display: flex;+ flex-direction: column;+ gap: 2px;+ width: 100%;+ padding: 8px 10px 9px;+ border: 0;+ border-radius: 8px;+ background: none;+ color: var(--text);+ font: inherit;+ text-align: left;+ cursor: default;+}+/* Rows are separated by a hairline that stops short of the selected row, as in Notes. */+[role="listitem"] + [role="listitem"] > .note-row:not([aria-current="true"]) {+ box-shadow: inset 0 1px 0 var(--separator);+ border-radius: 0 0 8px 8px;+}+.note-row:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }+.note-row[aria-current="true"] { background: color-mix(in srgb, var(--gold) 26%, transparent); box-shadow: none; }+.note-row:focus-visible { outline: 3px solid var(--gold-ring); outline-offset: -1px; }+.note-row-title {+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ font-size: var(--t-13);+ font-weight: 700;+}+.note-row-meta { display: flex; gap: 8px; min-width: 0; font-size: var(--t-11); }+.note-row-when { flex: none; color: var(--text); font-variant-numeric: tabular-nums; }+.note-row-snippet { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); }++/* ---- the note ------------------------------------------------------------------- */++.note-body { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 0 0 0 28px; }+.note-bar {+ display: flex;+ align-items: center;+ gap: 10px;+ padding: 0 18px 12px 0;+}+/* The date the note was last changed, centred and quiet over the text, as Notes sets it. */+.note-when {+ flex: 1;+ margin: 0;+ color: var(--text-3);+ font-size: var(--t-11);+ text-align: center;+}+.note-bar-actions { display: flex; align-items: center; gap: 6px; }+.note-bar-actions .picker { max-width: 170px; }++.note-editor {+ flex: 1;+ display: flex;+ flex-direction: column;+ min-height: 0;+ overflow-y: auto;+ padding: 0 18px 24px 0;+}+.note-editor textarea {+ width: 100%;+ max-width: 76ch;+ padding: 0;+ border: 0;+ background: none;+ color: var(--text);+ font: inherit;+ resize: none;+ outline: none;+}+/* The first line is the note's title, and Notes sets it as one. Scoped to the editor so it+ outranks the textarea reset above, which had set it back to body size. */+.note-editor .note-title {+ margin: 0 0 6px;+ overflow: hidden;+ font-size: 24px;+ font-weight: 700;+ letter-spacing: -0.015em;+ line-height: 1.25;+}+textarea.note-title::placeholder { color: var(--text-3); }+.note-editor .note-text {+ flex: 1;+ min-height: 200px;+ margin: 0;+ font-size: var(--t-15);+ line-height: 1.55;+ white-space: pre-wrap;+ overflow-wrap: anywhere;+}+.note-editor.is-readonly .note-text { flex: none; min-height: 0; }+.note-readonly { max-width: 62ch; margin: 18px 0 0; color: var(--text-3); font-size: var(--t-11); }+.note-loading { margin: 0; padding: 10px 2px; color: var(--text-3); font-size: var(--t-13); }++/* ---- narrow windows --------------------------------------------------------------- */++/* The folders fold into a picker above the list first, and the list narrows after. */+@media (max-width: 1000px) {+ .notes { grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); }+ .notes-folders { display: none; }+ .notes-folder-picker { display: block; }+}+@media (max-width: 640px) {+ .notes { grid-template-columns: 1fr; grid-template-rows: minmax(0, 40%) minmax(0, 1fr); }+ .notes-list { border-right: 0; border-bottom: 1px solid var(--separator); padding-bottom: 8px; }+ .note-body { padding: 12px 0 0; }+}