diff --git a/src/gui/components/_legacy.py b/src/gui/components/_legacy.py index baea41d..85ce9a1 100644 --- a/src/gui/components/_legacy.py +++ b/src/gui/components/_legacy.py @@ -335,6 +335,55 @@ body, .stApp { box-shadow: none !important; } +/* ---------- Section header expand indicator ---------- + Swap Streamlit's default ``expand_more`` chevron in each sidebar + section header for a soft ``+`` / ``−`` pair. ``+`` when collapsed, + ``−`` (U+2212, visually balanced with +) when expanded. + + We hide any built-in icon Streamlit injects (svg or Material + Symbols span — exact element differs by Streamlit version) and + render our own glyph as a right-aligned pseudo-element keyed off + ``aria-expanded``. The button itself gets a touch of right padding + so the label doesn't run into the indicator. */ +[data-testid="stSidebarNavSectionHeader"] { + position: relative !important; +} +[data-testid="stSidebarNavSectionHeader"] button { + width: 100% !important; + padding-right: 22px !important; + background: transparent !important; + border: none !important; +} +[data-testid="stSidebarNavSectionHeader"] button svg, +[data-testid="stSidebarNavSectionHeader"] button [data-testid="stIconMaterial"], +[data-testid="stSidebarNavSectionHeader"] button span.material-symbols-rounded, +[data-testid="stSidebarNavSectionHeader"] button span.material-symbols-outlined, +[data-testid="stSidebarNavSectionHeader"] button span.material-icons, +[data-testid="stSidebarNavSectionHeader"] button span.material-icons-outlined { + display: none !important; +} +[data-testid="stSidebarNavSectionHeader"] button[aria-expanded]::after { + position: absolute; + right: 8px; + top: 50%; + transform: translateY(-50%); + font-size: 16px; + font-weight: 400; + line-height: 1; + color: var(--ink-tertiary); + transition: color 0.15s ease; + pointer-events: none; +} +[data-testid="stSidebarNavSectionHeader"] button[aria-expanded="false"]::after { + content: "+"; +} +[data-testid="stSidebarNavSectionHeader"] button[aria-expanded="true"]::after { + content: "\2212"; +} +[data-testid="stSidebarNavSectionHeader"] button:hover::after { + color: var(--ink) !important; +} + /* Inline + block code → mono with subtle accent chip. theme.py owns the family + size; this layer adds the warm-fill background. */ [data-testid="stMarkdownContainer"] code {