From 604debb9a91f96a226cff59b9ba7873836153463 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 16 May 2026 20:31:36 +0000 Subject: [PATCH] revert(home): keep per-tool grouping for per-file findings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Restoring ``render_findings_panel`` on the home page. Previous commit (c575efd) inlined a flat renderer that dropped the per-tool grouping and the "Open " jump links โ€” that was an over-correction. The user only wanted the bottom tool-card grid gone (already removed in ff2eaeb). The grouping inside the findings panel is what lets a user land on a specific finding and one-click into the cleaner that fixes it; without it they'd have to guess which sidebar entry to open. Tool-card grid stays removed. Sidebar nav is unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/gui/app.py | 42 ++++++++++-------------------------------- 1 file changed, 10 insertions(+), 32 deletions(-) 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"))