From 2c8afdef79778b778897e35ef41ca73697498581 Mon Sep 17 00:00:00 2001
From: nmemmert <67961292+nmemmert@users.noreply.github.com>
Date: Fri, 23 Oct 2026 09:32:56 -0400
Subject: [PATCH] Keyboard shortcuts for mail and a shortcut list, offline help
and refresh on return, push alerts for new mail
---
mail.js | 8 +++++++-
public/index.html | 1 +
public/keys.js | 27 +++++++++++++++++++++++++++
public/reminders.js | 3 ++-
public/shell.js | 18 ++++++++++++++++--
public/style.css | 1 +
public/sw.js | 2 +-
push.js | 18 ++++++++++++++++--
8 files changed, 71 insertions(+), 7 deletions(-)
create mode 100644 public/keys.js
diff --git a/mail.js b/mail.js
index c8abc60..f3b5f51 100644
--- a/mail.js
+++ b/mail.js
@@ -329,4 +329,10 @@ async function handle(req, res) {
} catch (e) { json(res, e.status || 400, { error: e.message }); }
}
-module.exports = { enabled, outlookOn, handle, callback, secretStatus, recipients, textToHtml };
+/** The newest messages in each connected account's Inbox (for the push alerts). One account that fails does not stop the others. */
+async function newest() {
+ const out = [];
+ for (const a of accounts()) { try { const r = await withTimeout(providerOf(a).list(a, { folder: 'inbox', skip: 0, q: '' }), 15000); for (const m of r.items.slice(0, 10)) out.push({ id: a.id + ':' + m.id, subject: m.subject, from: (m.from && (m.from.name || m.from.address)) || '', read: !!m.read }); } catch { /* skipped this round */ } }
+ return out;
+}
+module.exports = { newest, enabled, outlookOn, handle, callback, secretStatus, recipients, textToHtml };
diff --git a/public/index.html b/public/index.html
index b2e8c1d..8bbbd6f 100644
--- a/public/index.html
+++ b/public/index.html
@@ -80,6 +80,7 @@
+