From 1c40740686619339c498fc16073e37eb7b384c36 Mon Sep 17 00:00:00 2001 From: Young Lee <8462583+yl8976@users.noreply.github.com> Date: Fri, 6 Feb 2026 01:17:03 -0800 Subject: [PATCH] feat(admin): async bulk delete with toasts --- AGENTS.md | 1 + README.md | 1 + src/routes/admin.ts | 683 ++++++++++++++++++++++++++++++++------- src/scripts/index.ts | 3 + src/scripts/toast.ts | 101 ++++++ src/styles/components.ts | 129 ++++++++ 6 files changed, 809 insertions(+), 109 deletions(-) create mode 100644 src/scripts/toast.ts diff --git a/AGENTS.md b/AGENTS.md index ef10613..6222a7f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -81,6 +81,7 @@ Notes: - Use **Table** view for bulk delete. - Table columns are resizable and sortable; widths persist per-browser via localStorage. - **Select Results** selects all rows currently shown by the search filter; **Clear Selection** unselects everything. +- Bulk deletes are performed asynchronously (batched requests) so the UI stays responsive. - Avoid wildcard deletion; prefer search + small batches to reduce risk of deleting legitimate feeds. ## Cloudflare/Wrangler conventions diff --git a/README.md b/README.md index e79f5dd..788e2eb 100644 --- a/README.md +++ b/README.md @@ -115,6 +115,7 @@ npm run build - Long titles/URLs are truncated; hover to see the full value. Click to copy. - Drag the column separators to resize; click headers to sort (double-click a separator to reset width). 4. Use **Select Results** to select the filtered rows, then click **Delete Selected**. + - Bulk deletes run in small batches so the UI stays responsive. Keep the tab open until it finishes. 5. For legitimate feeds that got spam emails, open **Emails**, filter by subject, then **Select Results** and **Delete Selected**. ## Upgrading dependencies diff --git a/src/routes/admin.ts b/src/routes/admin.ts index b535e96..f0c6bf6 100644 --- a/src/routes/admin.ts +++ b/src/routes/admin.ts @@ -337,13 +337,15 @@ app.get("/", async (c) => { ? html`
No feeds were selected.