feat: hide Streamlit chrome for app-like appearance

Add shared hide_streamlit_chrome() helper that removes header bar,
hamburger menu, footer, and deploy button via CSS injection. Called
on every page. Add .streamlit/config.toml with minimal toolbar mode.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-29 01:20:54 +00:00
parent f2fdc10af7
commit 35ea21ad33
12 changed files with 85 additions and 6 deletions

View File

@@ -21,17 +21,15 @@ if str(_project_root) not in sys.path:
# Page config
# ---------------------------------------------------------------------------
from src.gui.components import hide_streamlit_chrome
st.set_page_config(
page_title="DataTools — Data Cleaning Mastery",
page_icon="🧹",
layout="wide",
)
# Hide the Deploy button from the toolbar
st.markdown(
"<style>[data-testid='stAppDeployButton'] {display: none;}</style>",
unsafe_allow_html=True,
)
hide_streamlit_chrome()
# ---------------------------------------------------------------------------

View File

@@ -1,4 +1,4 @@
"""Reusable Streamlit widgets for the deduplicator GUI."""
"""Reusable Streamlit widgets for the DataTools GUI."""
from __future__ import annotations
@@ -24,6 +24,45 @@ from src.core.config import (
from src.core.normalizers import NormalizerType
# ---------------------------------------------------------------------------
# App chrome — hide Streamlit default UI for app-like feel
# ---------------------------------------------------------------------------
_HIDE_CHROME_CSS = """
<style>
/* Hide Streamlit header bar */
header[data-testid="stHeader"] {
display: none !important;
}
/* Hide hamburger menu */
button[kind="header"] {
display: none !important;
}
#MainMenu {
display: none !important;
}
/* Hide footer */
footer {
display: none !important;
}
/* Hide deploy button */
[data-testid="stAppDeployButton"] {
display: none !important;
}
/* Reclaim top padding lost from hidden header */
.stAppViewBlockContainer,
[data-testid="stAppViewBlockContainer"] {
padding-top: 1rem !important;
}
</style>
"""
def hide_streamlit_chrome() -> None:
"""Inject CSS to hide Streamlit's default header, menu, and footer."""
st.markdown(_HIDE_CHROME_CSS, unsafe_allow_html=True)
# ---------------------------------------------------------------------------
# Config panel (advanced options)
# ---------------------------------------------------------------------------

View File

@@ -19,10 +19,12 @@ from src.core.io import read_file, list_sheets, detect_encoding, detect_delimite
from src.gui.components import (
apply_review_decisions,
config_panel,
hide_streamlit_chrome,
match_group_card,
results_summary,
)
hide_streamlit_chrome()
# ---------------------------------------------------------------------------
# Session state defaults

View File

@@ -11,6 +11,10 @@ _project_root = Path(__file__).resolve().parent.parent.parent.parent
if str(_project_root) not in sys.path:
sys.path.insert(0, str(_project_root))
from src.gui.components import hide_streamlit_chrome
hide_streamlit_chrome()
# ---------------------------------------------------------------------------
# Header
# ---------------------------------------------------------------------------

View File

@@ -11,6 +11,10 @@ _project_root = Path(__file__).resolve().parent.parent.parent.parent
if str(_project_root) not in sys.path:
sys.path.insert(0, str(_project_root))
from src.gui.components import hide_streamlit_chrome
hide_streamlit_chrome()
# ---------------------------------------------------------------------------
# Header
# ---------------------------------------------------------------------------

View File

@@ -11,6 +11,10 @@ _project_root = Path(__file__).resolve().parent.parent.parent.parent
if str(_project_root) not in sys.path:
sys.path.insert(0, str(_project_root))
from src.gui.components import hide_streamlit_chrome
hide_streamlit_chrome()
# ---------------------------------------------------------------------------
# Header
# ---------------------------------------------------------------------------

View File

@@ -11,6 +11,10 @@ _project_root = Path(__file__).resolve().parent.parent.parent.parent
if str(_project_root) not in sys.path:
sys.path.insert(0, str(_project_root))
from src.gui.components import hide_streamlit_chrome
hide_streamlit_chrome()
# ---------------------------------------------------------------------------
# Header
# ---------------------------------------------------------------------------

View File

@@ -11,6 +11,10 @@ _project_root = Path(__file__).resolve().parent.parent.parent.parent
if str(_project_root) not in sys.path:
sys.path.insert(0, str(_project_root))
from src.gui.components import hide_streamlit_chrome
hide_streamlit_chrome()
# ---------------------------------------------------------------------------
# Header
# ---------------------------------------------------------------------------

View File

@@ -11,6 +11,10 @@ _project_root = Path(__file__).resolve().parent.parent.parent.parent
if str(_project_root) not in sys.path:
sys.path.insert(0, str(_project_root))
from src.gui.components import hide_streamlit_chrome
hide_streamlit_chrome()
# ---------------------------------------------------------------------------
# Header
# ---------------------------------------------------------------------------

View File

@@ -11,6 +11,10 @@ _project_root = Path(__file__).resolve().parent.parent.parent.parent
if str(_project_root) not in sys.path:
sys.path.insert(0, str(_project_root))
from src.gui.components import hide_streamlit_chrome
hide_streamlit_chrome()
# ---------------------------------------------------------------------------
# Header
# ---------------------------------------------------------------------------

View File

@@ -11,6 +11,10 @@ _project_root = Path(__file__).resolve().parent.parent.parent.parent
if str(_project_root) not in sys.path:
sys.path.insert(0, str(_project_root))
from src.gui.components import hide_streamlit_chrome
hide_streamlit_chrome()
# ---------------------------------------------------------------------------
# Header
# ---------------------------------------------------------------------------