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:
@@ -778,7 +778,10 @@ def render_findings_panel(findings, *, header: str = "Detected issues") -> None:
|
|||||||
_render_one_finding(f)
|
_render_one_finding(f)
|
||||||
page_slug = _tool_page_slug(tool_id)
|
page_slug = _tool_page_slug(tool_id)
|
||||||
if page_slug:
|
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:
|
if untargeted:
|
||||||
with st.expander(
|
with st.expander(
|
||||||
|
|||||||
Reference in New Issue
Block a user