feat: show version tag in sidebar footer

This commit is contained in:
pyr0ball 2026-02-26 14:39:47 -08:00
parent 2630c161db
commit 542ff86a43

View file

@ -8,6 +8,7 @@ Run: streamlit run app/app.py
bash scripts/manage-ui.sh start bash scripts/manage-ui.sh start
""" """
import logging import logging
import subprocess
import sys import sys
from pathlib import Path from pathlib import Path
@ -138,7 +139,20 @@ def _task_indicator():
detail = f" · {stage}" if stage else (f"{t.get('company')}" if t.get("company") else "") detail = f" · {stage}" if stage else (f"{t.get('company')}" if t.get("company") else "")
st.caption(f"{icon} {label}{detail}") st.caption(f"{icon} {label}{detail}")
@st.cache_resource
def _get_version() -> str:
try:
return subprocess.check_output(
["git", "describe", "--tags", "--always"],
cwd=Path(__file__).parent.parent,
text=True,
).strip()
except Exception:
return "dev"
with st.sidebar: with st.sidebar:
_task_indicator() _task_indicator()
st.divider()
st.caption(f"Peregrine {_get_version()}")
pg.run() pg.run()