From 0c25d8014660e03762f5fe625e22f447a70ae907 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 5 May 2026 13:30:10 +0000 Subject: [PATCH] fix(gui): keep sidebar reopenable + add clean Quit button MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The chrome-hiding CSS was removing the Streamlit header wholesale, which also took the sidebar's expand chevron with it — a collapsed sidebar became unreopenable. Make the header transparent instead and explicitly preserve the sidebar collapsed-control. Also add a Quit button in the app footer that signals the Streamlit server (SIGTERM, falling back to SIGINT) so closing the GUI returns the shell prompt cleanly instead of leaving Python hung. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/gui/app.py | 13 +++++--- src/gui/components/__init__.py | 1 + src/gui/components/_legacy.py | 55 +++++++++++++++++++++++++++------- 3 files changed, 54 insertions(+), 15 deletions(-) diff --git a/src/gui/app.py b/src/gui/app.py index 2ace7bf..53693be 100644 --- a/src/gui/app.py +++ b/src/gui/app.py @@ -24,6 +24,7 @@ if str(_project_root) not in sys.path: from src.gui.components import ( findings_count_for_tool, hide_streamlit_chrome, + quit_button, upload_and_analyze_section, ) @@ -87,7 +88,11 @@ for row_start in range(0, len(TOOLS), 3): # --------------------------------------------------------------------------- st.divider() -st.caption( - "Runs locally. Your data never leaves this computer. " - "| DataTools v3.0" -) +footer_left, footer_right = st.columns([4, 1]) +with footer_left: + st.caption( + "Runs locally. Your data never leaves this computer. " + "| DataTools v3.0" + ) +with footer_right: + quit_button() diff --git a/src/gui/components/__init__.py b/src/gui/components/__init__.py index 0b7c26a..ede0990 100644 --- a/src/gui/components/__init__.py +++ b/src/gui/components/__init__.py @@ -41,6 +41,7 @@ from . import _legacy as _legacy # noqa: F401 (keep for direct access) __all__ = [ # Shared chrome / pickup / gate "hide_streamlit_chrome", + "quit_button", "pickup_or_upload", "require_normalization_gate", # Dedup widgets diff --git a/src/gui/components/_legacy.py b/src/gui/components/_legacy.py index 6892077..b38de87 100644 --- a/src/gui/components/_legacy.py +++ b/src/gui/components/_legacy.py @@ -3,6 +3,8 @@ from __future__ import annotations import io +import os +import signal from typing import Optional import pandas as pd @@ -30,25 +32,31 @@ from src.core.normalizers import NormalizerType _HIDE_CHROME_CSS = """