From 7bb315e0b6ccf6a7a08769a6f64fa3242e64acfa Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Fri, 11 Sep 2026 10:48:18 -0400 Subject: [PATCH] `mail`: a button off screen doesn't get to act MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `mark read` only paints on the inbox tab, but its act ran in every view — so it kept the box from wherever it was last drawn and could catch a click meant for something else entirely. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01KudmyUxKeWgznjpttRxWac --- .../public/aesthetic.computer/disks/mail.mjs | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/system/public/aesthetic.computer/disks/mail.mjs b/system/public/aesthetic.computer/disks/mail.mjs index e427ed9c77..fc5aeca617 100644 --- a/system/public/aesthetic.computer/disks/mail.mjs +++ b/system/public/aesthetic.computer/disks/mail.mjs @@ -294,17 +294,21 @@ function act({ event: e, net, needsPaint }) { if (busy) return; - readBtn?.act(e, async () => { - busy = true; - needsPaint(); - const res = await net.userRequest("POST", "/api/mail", { action: "read" }); - if (res.status === 200) { - mail.unread = 0; - mail.inbox.forEach((letter) => (letter.read = true)); - } - busy = false; - needsPaint(); - }); + // Only a button that's actually on screen may act — otherwise it keeps the + // box it had in another view and catches clicks meant for something else. + if (view === "inbox" && mail.unread > 0) { + readBtn?.act(e, async () => { + busy = true; + needsPaint(); + const res = await net.userRequest("POST", "/api/mail", { action: "read" }); + if (res.status === 200) { + mail.unread = 0; + mail.inbox.forEach((letter) => (letter.read = true)); + } + busy = false; + needsPaint(); + }); + } if (view !== "prefs" || !prefs) return; -- 2.51.2