diff --git a/src/gui/app.py b/src/gui/app.py index 50028bb..adee202 100644 --- a/src/gui/app.py +++ b/src/gui/app.py @@ -31,8 +31,13 @@ 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, render_findings_panel - from src.gui.components._legacy import _run_analysis_on_upload + 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.i18n import t st.set_page_config( @@ -121,18 +126,39 @@ 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. + # 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. 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")) - else: - render_findings_panel(findings, header=f"๐Ÿ“„ {f.name}") + 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) st.divider() st.caption(t("chrome.footer"))