From 9e918a50ab8b2735a901905fc78208150f2f0985 Mon Sep 17 00:00:00 2001 From: Dymas Date: Sun, 17 May 2026 21:29:21 +0200 Subject: [PATCH] Show newest queue log lines first --- CHANGELOG.md | 4 ++++ README.md | 3 ++- VERSION | 2 +- app_support.py | 2 +- search_page.py | 2 +- test_app.py | 3 +++ 6 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb2c97a..652991c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.32.2 - 2026-05-17 + +- Changed Search page queue log rendering to show the newest lines first instead of oldest-first. + ## 0.32.1 - 2026-05-17 - Suppressed stdout request logging for routine polling endpoints such as `/api/queue` and `/api/watchlist/refresh-status`, reducing noisy access-log spam during normal browser use. diff --git a/README.md b/README.md index 861dd38..15beb81 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A local web UI for a system-wide `ani-cli` install. -Current version: `0.32.1` +Current version: `0.32.2` ## Project Layout @@ -160,6 +160,7 @@ The app currently includes: - Optional scheduled background watchlist refreshes with Config page controls for enable/disable and refresh period. - Scheduled background refresh runs now log queue, start, and completion status to stdout so container logs show whether they finished successfully, with errors, or failed. - Routine browser polling endpoints such as the search-page queue poll and watchlist refresh-status poll now stay quiet in stdout request logs to reduce log spam. +- Queue job logs on the Search page now render newest lines first for easier at-a-glance progress checking. - Search and Watchlist polling now use a shared serial browser polling helper so slow responses do not cause overlapping poll requests to pile up in the background. - That shared browser polling helper now also tears itself down on page unload and uses chained `setTimeout` scheduling instead of a bare repeating interval. - Controlled shutdown and runtime reset now cancel active download workers when waiting for teardown, reducing the chance of orphaned background downloads outliving the web process. diff --git a/VERSION b/VERSION index fd9620c..989b29c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.32.1 +0.32.2 diff --git a/app_support.py b/app_support.py index 2ec4b09..7c39f29 100644 --- a/app_support.py +++ b/app_support.py @@ -16,7 +16,7 @@ from uuid import uuid4 PROJECT_ROOT = Path(__file__).resolve().parent ANI_CLI = os.environ.get("ANI_CLI_BIN") or shutil.which("ani-cli") or "ani-cli" APP_NAME = "ani-cli-web" -VERSION = "0.32.1" +VERSION = "0.32.2" ALLANIME_BASE = "allanime.day" ALLANIME_API = f"https://api.{ALLANIME_BASE}" ALLANIME_REFERER = "https://allmanga.to" diff --git a/search_page.py b/search_page.py index 255c78b..6120945 100644 --- a/search_page.py +++ b/search_page.py @@ -632,7 +632,7 @@ INDEX_HTML = r""" for (const job of jobs) { const item = document.createElement("article"); item.className = "job"; - const log = (job.log || []).slice(-28).join("\n"); + const log = [...(job.log || [])].slice(-28).reverse().join("\n"); item.innerHTML = `
diff --git a/test_app.py b/test_app.py index cf72557..bd92a31 100644 --- a/test_app.py +++ b/test_app.py @@ -1444,6 +1444,9 @@ class TemplateHelperTests(unittest.TestCase): self.assertIn("queueRequestId", APP.INDEX_HTML) self.assertIn("if (requestId !== state.queueRequestId) return data;", APP.INDEX_HTML) + def test_search_page_renders_queue_logs_newest_first(self): + self.assertIn('[...(job.log || [])].slice(-28).reverse().join("\\n")', APP.INDEX_HTML) + def test_pages_share_browser_api_helper(self): self.assertIn("async function api(path, options = {})", APP.INDEX_HTML) self.assertIn("async function api(path, options = {})", APP.CONFIG_HTML)