From 784695e3a70e91b7aaea7cf620a0e6f7686d2f60 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 19 May 2026 01:04:42 +0000 Subject: [PATCH] fix(home,findings): reclaim top whitespace + add padding under finding head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two visual cleanups: 1. The block-container "claim padding" rule was a no-op — it targets the legacy ``stAppViewBlockContainer`` testid; Streamlit renamed it to ``stMainBlockContainer`` in the current release. Updated the selector list to match both, so the page title now sits close to the top edge again (~0.5rem from the hidden header) instead of inheriting Streamlit's default ~6rem header reservation. 2. ``.dt-finding-group-head`` margin tightened to ``margin: -1rem -1rem 0.75rem``: -1rem on top/sides still bleeds the head to the card edges, but +0.75rem on the bottom is breathing room between the head's bottom border and the first finding row, which were abutting before. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/gui/components/_legacy.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/gui/components/_legacy.py b/src/gui/components/_legacy.py index 1c5ab98..31a2ea4 100644 --- a/src/gui/components/_legacy.py +++ b/src/gui/components/_legacy.py @@ -83,10 +83,18 @@ footer { [data-testid="stSidebarNav"] a[href$="/close/"] { display: none !important; } -/* Reclaim top padding lost from hidden header. Slim the bottom too — - Streamlit's default leaves several rems below the last widget. */ +/* Reclaim top padding lost from hidden header. Streamlit's default + block-container padding-top is ~6rem (room for the header it ships). + We hide the header so reclaim that space — the page title should sit + close to the top edge. Slim the bottom too — Streamlit's default + leaves several rems below the last widget. + The testid was renamed from ``stAppViewBlockContainer`` (legacy) to + ``stMainBlockContainer`` in the current Streamlit release; match + both so the rule keeps working across versions. */ .stAppViewBlockContainer, -[data-testid="stAppViewBlockContainer"] { +[data-testid="stAppViewBlockContainer"], +.stMainBlockContainer, +[data-testid="stMainBlockContainer"] { padding-top: 0.5rem !important; padding-bottom: 0.75rem !important; } @@ -583,7 +591,11 @@ div[data-testid="stContainer"][data-border="true"] { padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--surface-hover); - margin: -1rem -1rem 0; + /* -1rem on top/sides bleeds the head to the card edges (the parent + ``st.container(border=True)`` has 1rem padding). +0.75rem on the + bottom is the breathing room before the first finding row — + without it the row sits flush against the head's bottom border. */ + margin: -1rem -1rem 0.75rem; border-radius: var(--r-lg) var(--r-lg) 0 0; } .dt-severity-dot {