From be7191a5d18335e304ececd1ceb1dfe4b0efc194 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 17 May 2026 02:25:57 +0000 Subject: [PATCH] fix(footer): navigate to / instead of /home on Back to Home MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reported: clicking Back to Home in the sticky footer surfaced Streamlit's "Page not found — Running the app's main page" message in the user's build. Root cause: ``url_path="home"`` on the home page's ``st.Page`` registration is treated as an alias for the default page in some Streamlit minor versions, but the user's build doesn't honour the alias for the page that ALSO has ``default=True``. The default page is served at the root URL ``/``; ``/home`` is treated as a missing page on that build. Switch the footer anchor's href from ``"home"`` (which resolved to ``/home`` from any tool-page URL) to ``"./"`` (resolves to the current document's directory, which on a single-segment URL is the server root → default page → Home). Robust across Streamlit minor versions regardless of how the url_path alias is interpreted. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/gui/components/_legacy.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gui/components/_legacy.py b/src/gui/components/_legacy.py index 49d9b20..6903762 100644 --- a/src/gui/components/_legacy.py +++ b/src/gui/components/_legacy.py @@ -619,7 +619,15 @@ def render_sticky_footer() -> None: div.id = 'datatools-sticky-footer'; var a = doc.createElement('a'); a.className = 'datatools-sticky-footer-link'; - a.href = 'home'; + // Navigate to the app root (``/``) instead of ``/home``. The + // home page is registered with ``default=True``, which serves + // it at the root URL. ``/home`` is NOT a recognized URL on + // every Streamlit minor version even with ``url_path="home"`` + // — some builds reserve the alias only for non-default pages. + // Using ``./`` is robust against both: it resolves to the + // current document's directory, which on a single-segment + // tool-page URL like ``/01_deduplicator`` is the server root. + a.href = './'; a.target = '_self'; a.textContent = label; div.appendChild(a);