Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +44 -38
src/streamlit_app.py
CHANGED
|
@@ -42,7 +42,7 @@ st.set_page_config(page_title="Remittance Data Viewer", layout="wide")
|
|
| 42 |
# Custom CSS
|
| 43 |
st.markdown("""
|
| 44 |
<style>
|
| 45 |
-
/* Reduce spacing between form fields
|
| 46 |
.stTextInput > div > div > input,
|
| 47 |
.stTextArea > div > div > textarea,
|
| 48 |
.stSelectbox > div > div > div {
|
|
@@ -55,7 +55,7 @@ st.markdown("""
|
|
| 55 |
}
|
| 56 |
.stSelectbox { margin-bottom: 4px !important; }
|
| 57 |
|
| 58 |
-
/* Button styling
|
| 59 |
.stButton > button {
|
| 60 |
padding: 0.25rem 0.5rem !important;
|
| 61 |
font-size: 0.85rem !important;
|
|
@@ -78,52 +78,58 @@ st.markdown("""
|
|
| 78 |
[data-testid="column"] { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
|
| 79 |
[data-testid="stHorizontalBlock"] { gap: 0.5rem !important; }
|
| 80 |
|
| 81 |
-
/*
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
}
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
height: auto !important;
|
| 91 |
-
min-height: 100vh !important;
|
| 92 |
-
}
|
| 93 |
-
|
| 94 |
-
/* Force the Streamlit app column elements to be scrollable */
|
| 95 |
-
div[data-testid="column"], .stColumns, .stContainer {
|
| 96 |
-
max-height: calc(100vh - 160px) !important;
|
| 97 |
-
overflow-y: auto !important;
|
| 98 |
-
overflow-x: hidden !important;
|
| 99 |
-
position: relative !important;
|
| 100 |
}
|
| 101 |
|
| 102 |
-
/*
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
border: 1px solid #e6e6e6;
|
| 109 |
-
border-radius: 6px;
|
| 110 |
-
background: #ffffff;
|
| 111 |
}
|
| 112 |
|
| 113 |
-
/*
|
| 114 |
div[data-testid="column"] img,
|
| 115 |
div[data-testid="column"] canvas {
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
}
|
| 120 |
|
| 121 |
-
/*
|
| 122 |
-
div[data-testid="column"]::-webkit-scrollbar {
|
| 123 |
-
|
| 124 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
</style>
|
| 126 |
-
|
| 127 |
""", unsafe_allow_html=True)
|
| 128 |
|
| 129 |
def load_jsonl(file):
|
|
|
|
| 42 |
# Custom CSS
|
| 43 |
st.markdown("""
|
| 44 |
<style>
|
| 45 |
+
/* Reduce spacing between form fields */
|
| 46 |
.stTextInput > div > div > input,
|
| 47 |
.stTextArea > div > div > textarea,
|
| 48 |
.stSelectbox > div > div > div {
|
|
|
|
| 55 |
}
|
| 56 |
.stSelectbox { margin-bottom: 4px !important; }
|
| 57 |
|
| 58 |
+
/* Button styling */
|
| 59 |
.stButton > button {
|
| 60 |
padding: 0.25rem 0.5rem !important;
|
| 61 |
font-size: 0.85rem !important;
|
|
|
|
| 78 |
[data-testid="column"] { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
|
| 79 |
[data-testid="stHorizontalBlock"] { gap: 0.5rem !important; }
|
| 80 |
|
| 81 |
+
/* FIXED: Remove problematic viewport-based heights */
|
| 82 |
+
/* Instead use fixed pixel heights that work in iframes */
|
| 83 |
+
section[data-testid="stAppViewContainer"] {
|
| 84 |
+
overflow: visible !important;
|
| 85 |
}
|
| 86 |
+
|
| 87 |
+
.main .block-container {
|
| 88 |
+
overflow: visible !important;
|
| 89 |
+
padding-bottom: 1rem !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
}
|
| 91 |
|
| 92 |
+
/* Make columns scrollable with fixed height */
|
| 93 |
+
div[data-testid="column"] {
|
| 94 |
+
max-height: 85vh !important;
|
| 95 |
+
overflow-y: auto !important;
|
| 96 |
+
overflow-x: hidden !important;
|
| 97 |
+
position: relative !important;
|
|
|
|
|
|
|
|
|
|
| 98 |
}
|
| 99 |
|
| 100 |
+
/* Ensure images don't expand the column */
|
| 101 |
div[data-testid="column"] img,
|
| 102 |
div[data-testid="column"] canvas {
|
| 103 |
+
max-width: 100% !important;
|
| 104 |
+
height: auto !important;
|
| 105 |
+
display: block !important;
|
| 106 |
}
|
| 107 |
|
| 108 |
+
/* Custom scrollbar styling */
|
| 109 |
+
div[data-testid="column"]::-webkit-scrollbar {
|
| 110 |
+
width: 10px;
|
| 111 |
+
height: 10px;
|
| 112 |
+
}
|
| 113 |
+
div[data-testid="column"]::-webkit-scrollbar-thumb {
|
| 114 |
+
border-radius: 8px;
|
| 115 |
+
background-color: rgba(0,0,0,0.3);
|
| 116 |
+
border: 2px solid transparent;
|
| 117 |
+
background-clip: padding-box;
|
| 118 |
+
}
|
| 119 |
+
div[data-testid="column"]::-webkit-scrollbar-thumb:hover {
|
| 120 |
+
background-color: rgba(0,0,0,0.5);
|
| 121 |
+
}
|
| 122 |
+
div[data-testid="column"]::-webkit-scrollbar-track {
|
| 123 |
+
background: rgba(0,0,0,0.05);
|
| 124 |
+
border-radius: 8px;
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
/* Firefox scrollbar */
|
| 128 |
+
div[data-testid="column"] {
|
| 129 |
+
scrollbar-width: thin;
|
| 130 |
+
scrollbar-color: rgba(0,0,0,0.3) rgba(0,0,0,0.05);
|
| 131 |
+
}
|
| 132 |
</style>
|
|
|
|
| 133 |
""", unsafe_allow_html=True)
|
| 134 |
|
| 135 |
def load_jsonl(file):
|