diff --git a/src/gui/app.py b/src/gui/app.py index adee202..f4f04f9 100644 --- a/src/gui/app.py +++ b/src/gui/app.py @@ -31,13 +31,8 @@ if str(_project_root) not in sys.path: def _home_page() -> None: """Render the home page โ€” multi-file upload + per-file analysis.""" - from src.gui.components import hide_streamlit_chrome - from src.gui.components._legacy import ( - _render_one_finding, - _run_analysis_on_upload, - _SEVERITY_ICON, - ) - from src.core.text_clean import hidden_char_css + from src.gui.components import hide_streamlit_chrome, render_findings_panel + from src.gui.components._legacy import _run_analysis_on_upload from src.i18n import t st.set_page_config( @@ -126,39 +121,22 @@ def _home_page() -> None: if findings_by_file: st.divider() - # Hidden-char badge CSS is needed once for any finding-sample - # tables ``_render_one_finding`` may emit further down. - st.markdown(hidden_char_css(), unsafe_allow_html=True) - # Preserve uploader order so the user sees results in the same - # order they appear in the file list above. Findings render as - # a flat list per file โ€” no per-tool grouping, no "Open " - # buttons. Tool discovery happens in the sidebar. + # order they appear in the file list above. Each file's findings + # render via ``render_findings_panel`` so the per-tool grouping + # (and the "Open " jump link under each group) is kept โ€” + # that's how the user reaches the cleaner that fixes a specific + # finding without hunting through the sidebar. for f in uploaded_files: if f.name not in findings_by_file: continue findings = findings_by_file[f.name] with st.container(border=True): - st.markdown(f"### ๐Ÿ“„ {f.name}") if not findings: + st.markdown(f"### ๐Ÿ“„ {f.name}") st.success(t("findings.none")) - continue - by_sev: dict[str, int] = {} - for finding in findings: - by_sev[finding.severity] = by_sev.get(finding.severity, 0) + 1 - summary = " ยท ".join( - t( - "findings.severity_summary_segment", - icon=_SEVERITY_ICON[s], - n=by_sev[s], - severity=s, - ) - for s in ("error", "warn", "info") if by_sev.get(s) - ) - if summary: - st.caption(summary) - for finding in findings: - _render_one_finding(finding) + else: + render_findings_panel(findings, header=f"๐Ÿ“„ {f.name}") st.divider() st.caption(t("chrome.footer"))