From ef00fe3adb9acfdc590fcade3ba60a9f5d690f30 Mon Sep 17 00:00:00 2001 From: Vinta Chen Date: Sun, 27 Sep 2026 02:04:41 +0800 Subject: [PATCH] fix: restore hidden group headings when navigating to a jump link After sorting by a column, or while a search hid a group, category page group headings stayed hidden, so the header's jump links (and any use-case heading link) pointed at a hidden element and did nothing. Co-Authored-By: Claude --- website/static/main.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/website/static/main.js b/website/static/main.js index 919aefd4..30871c9f 100644 --- a/website/static/main.js +++ b/website/static/main.js @@ -364,6 +364,24 @@ sortHeaders.forEach(function (th) { }); }); +// Group headings are hidden while sorted flat or filtered out by search, so a link to one must restore them first +document.addEventListener("click", function (e) { + const link = e.target.closest('a[href*="#"]'); + if (!link || link.pathname !== location.pathname) return; + const heading = document.getElementById(decodeURIComponent(link.hash.slice(1))); + const groupRow = heading ? heading.closest(".group-row") : null; + if (!groupRow) return; + if (activeSort.col !== "editorial") { + activeSort = defaultSort; + sortRows(); + updateSortIndicators(); + } + if (groupRow.hidden && searchInput) { + searchInput.value = ""; + applyFilters(); + } +}); + if (searchInput) { let searchTimer; searchInput.addEventListener("input", function () {