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) <noreply@anthropic.com>
This commit is contained in:
2026-04-29 16:17:50 +00:00
parent 90ceada2d1
commit e12615357d

View File

@@ -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(