← back to Crazy News Channel
5x sweep 5: route every home link through goHome() via one delegated handler
2472ae0b01d45a63886c3c7ed4a6e9fc39727e08 · 2026-09-24 08:40:04 -0700 · Steve Abrams
The empty-state 'All Categories' link added in b868846 still native-navigated
to '#/', recreating the two-home-URLs bug. Replaced the per-link listeners
with a single delegated handler for a[href="#/"] so no home link can miss it.
Modified clicks (cmd/ctrl/shift/middle) are left to the browser.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VLjoHsyGTDeVCa1rdrAxnk
Files touched
Diff
commit 2472ae0b01d45a63886c3c7ed4a6e9fc39727e08
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Thu Sep 24 08:40:04 2026 -0700
5x sweep 5: route every home link through goHome() via one delegated handler
The empty-state 'All Categories' link added in b868846 still native-navigated
to '#/', recreating the two-home-URLs bug. Replaced the per-link listeners
with a single delegated handler for a[href="#/"] so no home link can miss it.
Modified clicks (cmd/ctrl/shift/middle) are left to the browser.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VLjoHsyGTDeVCa1rdrAxnk
---
index.html | 20 +++++++-------------
1 file changed, 7 insertions(+), 13 deletions(-)
diff --git a/index.html b/index.html
index 7e00257..a0c277f 100644
--- a/index.html
+++ b/index.html
@@ -1374,7 +1374,6 @@ const els = {
articleView: document.getElementById("articleView"),
channelHeading: document.getElementById("channelHeading"),
categoryBackLink: document.getElementById("categoryBackLink"),
- brandLink: document.getElementById("brandLink"),
categoryBlurb: document.getElementById("categoryBlurb"),
featuresGrid: document.getElementById("featuresGrid"),
featuresEmptyNote: document.getElementById("featuresEmptyNote"),
@@ -2611,18 +2610,13 @@ function init() {
document.querySelectorAll('input[name="category"]').forEach((input) => {
input.addEventListener("change", (e) => onCategoryChange(e.target.value));
});
- els.categoryBackLink.addEventListener("click", (e) => {
- // Same-page hash change; goHome() renders synchronously so the
- // heading/focus updates immediately rather than waiting on hashchange.
- // Always Home — unlike goBackToGrid(), this link's job is unconditional.
- e.preventDefault();
- goHome();
- });
- // The logo/wordmark: same reasoning — intercepted so it always lands on
- // the one canonical home URL ("") instead of native-navigating to its
- // literal href ("#/"), which used to leave two different "home" URLs in
- // the history stack depending on which control the reader used.
- els.brandLink.addEventListener("click", (e) => {
+ // Every home link (logo, category-page back link, empty-state link, and
+ // any added later) goes through goHome(), so Home has one canonical URL
+ // ("") instead of the literal href "#/". Delegated on purpose: wiring
+ // each link separately is how the empty-state link got missed once.
+ document.addEventListener("click", (e) => {
+ const link = e.target.closest('a[href="#/"]');
+ if (!link || e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return;
e.preventDefault();
goHome();
});
← b868846 5x sweep 3: Cody's 3 verified findings — article back/Escape
·
back to Crazy News Channel
·
5x: final report, Cody SHIP IT on 2472ae0 4d10d98 →