Spaces:
Sleeping
Sleeping
Commit Β·
ee952d0
1
Parent(s): 9bf4a3d
Fix file uploader styling and show deploy timestamp
Browse files- Make the resume uploader visible: tag-agnostic dropzone selector (Streamlit now renders <section>), plus styled Browse button, instruction text, and icon (was black-on-black)
- Show latest code-update (deploy) date/time in IST on the setup header, from HEAD git commit time with a source-file mtime fallback
Co-authored-by: Cursor <cursoragent@cursor.com>
ui.py
CHANGED
|
@@ -108,16 +108,47 @@ p, span, label, .stMarkdown { color: #0F172A; }
|
|
| 108 |
.stProgress > div > div { background: linear-gradient(90deg, #2563EB, #7C3AED) !important; }
|
| 109 |
|
| 110 |
/* ββ File uploader ββ */
|
| 111 |
-
|
|
|
|
|
|
|
| 112 |
background: #FFFFFF !important;
|
| 113 |
border: 2px dashed #CBD5E1 !important;
|
| 114 |
border-radius: 12px !important;
|
| 115 |
transition: all 0.2s ease;
|
| 116 |
}
|
| 117 |
-
|
| 118 |
border-color: #2563EB !important;
|
| 119 |
background: #F0F4FF !important;
|
| 120 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 121 |
|
| 122 |
/* ββ Inputs ββ */
|
| 123 |
.stTextInput > div > div > input,
|
|
@@ -843,6 +874,42 @@ def _readiness_level(pct):
|
|
| 843 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 844 |
# HEADER
|
| 845 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 846 |
has_resume = os.path.exists("data/resume/resume.pdf")
|
| 847 |
sheets_ok, sheets_status = _sheets_configured()
|
| 848 |
|
|
@@ -857,6 +924,9 @@ with hdr_l:
|
|
| 857 |
<div class="jaa-header" style="padding-bottom: 12px;">
|
| 858 |
<div class="jaa-header-left"></div>
|
| 859 |
<span class="jaa-header-badge">{"β³" if st.session_state.running else "β¨"} {status_text}</span>
|
|
|
|
|
|
|
|
|
|
| 860 |
</div>""")
|
| 861 |
|
| 862 |
with hdr_r:
|
|
|
|
| 108 |
.stProgress > div > div { background: linear-gradient(90deg, #2563EB, #7C3AED) !important; }
|
| 109 |
|
| 110 |
/* ββ File uploader ββ */
|
| 111 |
+
/* Tag-agnostic: recent Streamlit renders the dropzone as <section>, so the old
|
| 112 |
+
`div[...]` selector missed it and the default dark theme showed (black-on-black). */
|
| 113 |
+
[data-testid="stFileUploaderDropzone"] {
|
| 114 |
background: #FFFFFF !important;
|
| 115 |
border: 2px dashed #CBD5E1 !important;
|
| 116 |
border-radius: 12px !important;
|
| 117 |
transition: all 0.2s ease;
|
| 118 |
}
|
| 119 |
+
[data-testid="stFileUploaderDropzone"]:hover {
|
| 120 |
border-color: #2563EB !important;
|
| 121 |
background: #F0F4FF !important;
|
| 122 |
}
|
| 123 |
+
/* Dropzone instruction text + icon (were dark-on-dark / invisible) */
|
| 124 |
+
[data-testid="stFileUploaderDropzone"] *,
|
| 125 |
+
[data-testid="stFileUploaderDropzoneInstructions"],
|
| 126 |
+
[data-testid="stFileUploaderDropzoneInstructions"] * {
|
| 127 |
+
color: #334155 !important;
|
| 128 |
+
}
|
| 129 |
+
[data-testid="stFileUploaderDropzone"] svg,
|
| 130 |
+
[data-testid="stFileUploaderDropzoneInstructions"] svg {
|
| 131 |
+
fill: #2563EB !important;
|
| 132 |
+
color: #2563EB !important;
|
| 133 |
+
}
|
| 134 |
+
/* "Browse files" button inside the dropzone (was black background on black) */
|
| 135 |
+
[data-testid="stFileUploaderDropzone"] button {
|
| 136 |
+
background: #2563EB !important;
|
| 137 |
+
color: #FFFFFF !important;
|
| 138 |
+
border: 1px solid #2563EB !important;
|
| 139 |
+
border-radius: 8px !important;
|
| 140 |
+
font-weight: 600 !important;
|
| 141 |
+
}
|
| 142 |
+
[data-testid="stFileUploaderDropzone"] button:hover {
|
| 143 |
+
background: #1D4ED8 !important;
|
| 144 |
+
border-color: #1D4ED8 !important;
|
| 145 |
+
color: #FFFFFF !important;
|
| 146 |
+
}
|
| 147 |
+
/* Uploaded-file chip row */
|
| 148 |
+
[data-testid="stFileUploaderFile"],
|
| 149 |
+
[data-testid="stFileUploaderFile"] * {
|
| 150 |
+
color: #334155 !important;
|
| 151 |
+
}
|
| 152 |
|
| 153 |
/* ββ Inputs ββ */
|
| 154 |
.stTextInput > div > div > input,
|
|
|
|
| 874 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 875 |
# HEADER
|
| 876 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 877 |
+
@st.cache_data(ttl=300, show_spinner=False)
|
| 878 |
+
def _deploy_timestamp_ist() -> str:
|
| 879 |
+
"""Latest code-update (deploy) time in IST.
|
| 880 |
+
|
| 881 |
+
Prefers the HEAD git commit time (matches what GitHub/HF deployed); falls
|
| 882 |
+
back to the newest mtime among ui.py + src/*.py if git isn't available.
|
| 883 |
+
"""
|
| 884 |
+
from datetime import datetime, timezone, timedelta
|
| 885 |
+
ist = timezone(timedelta(hours=5, minutes=30))
|
| 886 |
+
here = os.path.dirname(os.path.abspath(__file__))
|
| 887 |
+
ts = None
|
| 888 |
+
try:
|
| 889 |
+
import subprocess
|
| 890 |
+
out = subprocess.run(
|
| 891 |
+
["git", "log", "-1", "--format=%cI"],
|
| 892 |
+
capture_output=True, text=True, timeout=4, cwd=here,
|
| 893 |
+
)
|
| 894 |
+
s = (out.stdout or "").strip()
|
| 895 |
+
if s:
|
| 896 |
+
ts = datetime.fromisoformat(s)
|
| 897 |
+
except Exception:
|
| 898 |
+
ts = None
|
| 899 |
+
if ts is None:
|
| 900 |
+
try:
|
| 901 |
+
cands = [os.path.join(here, "ui.py")]
|
| 902 |
+
src_dir = os.path.join(here, "src")
|
| 903 |
+
if os.path.isdir(src_dir):
|
| 904 |
+
cands += [os.path.join(src_dir, f) for f in os.listdir(src_dir)
|
| 905 |
+
if f.endswith(".py")]
|
| 906 |
+
mt = max(os.path.getmtime(p) for p in cands if os.path.exists(p))
|
| 907 |
+
ts = datetime.fromtimestamp(mt, tz=timezone.utc)
|
| 908 |
+
except Exception:
|
| 909 |
+
ts = datetime.now(timezone.utc)
|
| 910 |
+
return ts.astimezone(ist).strftime("%d %b %Y, %I:%M %p IST")
|
| 911 |
+
|
| 912 |
+
|
| 913 |
has_resume = os.path.exists("data/resume/resume.pdf")
|
| 914 |
sheets_ok, sheets_status = _sheets_configured()
|
| 915 |
|
|
|
|
| 924 |
<div class="jaa-header" style="padding-bottom: 12px;">
|
| 925 |
<div class="jaa-header-left"></div>
|
| 926 |
<span class="jaa-header-badge">{"β³" if st.session_state.running else "β¨"} {status_text}</span>
|
| 927 |
+
</div>
|
| 928 |
+
<div style="font-size:0.78rem; color:#64748B; margin:-4px 0 4px; font-weight:500;">
|
| 929 |
+
π’ Last code update (deployed): {_deploy_timestamp_ist()}
|
| 930 |
</div>""")
|
| 931 |
|
| 932 |
with hdr_r:
|