From e12615357d181948272ce26992be8824a2cec42f Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 29 Apr 2026 16:17:50 +0000 Subject: [PATCH] fix(gui): use page paths relative to streamlit entrypoint st.page_link resolves paths from the directory of the entrypoint file (src/gui/app.py), so the existing "src/gui/{page_slug}" prefix doubled up and produced StreamlitPageNotFoundError on first upload + analysis (reproducible on Windows; the stack trace from a Windows install surfaced the bug). The _TOOL_PAGE_PATHS map already stores the correct relative form ("pages/2_Text_Cleaner.py"); just pass the slug straight to st.page_link. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/gui/components.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/components.py b/src/gui/components.py index 4c52fab..0ca4739 100644 --- a/src/gui/components.py +++ b/src/gui/components.py @@ -778,7 +778,10 @@ def render_findings_panel(findings, *, header: str = "Detected issues") -> None: _render_one_finding(f) page_slug = _tool_page_slug(tool_id) if page_slug: - st.page_link(f"src/gui/{page_slug}", label=f"Open {tool_display_name(tool_id)} →") + # Streamlit resolves page paths relative to the entrypoint + # (src/gui/app.py), so a leading ``src/gui/`` would point + # outside the allowed page tree on Windows. + st.page_link(page_slug, label=f"Open {tool_display_name(tool_id)} →") if untargeted: with st.expander(