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.

Notes: no new note inside Recently Deleted

Yashwanth Kamireddi97eea80401f5
diff --git a/.uiverify/notes-trash.mjs b/.uiverify/notes-trash.mjs
index b36161f..084bda1 100644
--- a/.uiverify/notes-trash.mjs
+++ b/.uiverify/notes-trash.mjs
@@ -40,6 +40,15 @@ const offered = await page.locator(".note-bar-actions button").allInnerTexts();
ok(offered.includes("Recover") && offered.includes("Delete Now"),
"a deleted note offers Recover and Delete Now", `it offered ${JSON.stringify(offered)}`);
+// Nothing is begun in Recently Deleted: New Note is dimmed there, and Ctrl+N starts nothing.
+ok(await page.getByRole("button", { name: "New note" }).isDisabled(), "New Note is dimmed in Recently Deleted",
+ "New Note could be pressed in Recently Deleted");
+await page.locator(".note-row").first().focus();
+await page.keyboard.press("Control+n");
+await page.waitForTimeout(300);
+ok(await page.locator('[aria-label="New note"][role="textbox"]').count() === 0, "and Ctrl+N begins no note there",
+ "Ctrl+N began a note inside Recently Deleted");
+
await page.getByRole("button", { name: "Delete Now" }).click();
await page.locator(".confirm").getByRole("button", { name: "Cancel" }).click();
await page.waitForTimeout(300);
diff --git a/src/screens/NotesView.tsx b/src/screens/NotesView.tsx
index 8b894e2..b14a195 100644
--- a/src/screens/NotesView.tsx
+++ b/src/screens/NotesView.tsx
@@ -789,6 +789,9 @@ export function NotesView() {
);
const create = useCallback(async () => {
+ // Nothing is written in Recently Deleted, as in Notes, where New Note is dimmed there: a
+ // note begun here was made inside the deleted notes, and went with them.
+ if (folder === TRASH_FOLDER) return;
// What was typed a moment ago is handed over first, to the note it was typed in.
editorRef.current?.flushChange();
if (composingRef.current) await commitComposing();
@@ -1445,7 +1448,7 @@ export function NotesView() {
aria-label="New note"
title="New Note"
onClick={() => void create()}
- disabled={busy}
+ disabled={busy || folder === TRASH_FOLDER}
>
<SquarePen size={18} strokeWidth={2} aria-hidden="true" />
</button>