Bhuvi13 commited on
Commit
4c50b01
·
verified ·
1 Parent(s): ffffda8

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. 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 (unchanged) */
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 (unchanged) */
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
- /* Active OCR field highlighting */
82
- .ocr-active {
83
- border: 2px solid #ff4b4b !important;
84
- box-shadow: 0 0 5px rgba(255, 75, 75, 0.5) !important;
85
  }
86
-
87
- /* Make sure the top-level containers allow children to create scroll contexts */
88
- html, body, #root, #root>div, [data-testid="stAppViewContainer"], .block-container, .css-1lcbmhc, .main {
89
- overflow: visible !important;
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
- /* small helper scroll classes (if you wrap with these) */
103
- .left-scroll, .right-scroll {
104
- max-height: calc(100vh - 160px);
105
- overflow-y: auto;
106
- overflow-x: auto;
107
- padding: 8px;
108
- border: 1px solid #e6e6e6;
109
- border-radius: 6px;
110
- background: #ffffff;
111
  }
112
 
113
- /* make canvas/images not expand the column */
114
  div[data-testid="column"] img,
115
  div[data-testid="column"] canvas {
116
- max-width: 100% !important;
117
- height: auto !important;
118
- display: block !important;
119
  }
120
 
121
- /* subtle WebKit scrollbar */
122
- div[data-testid="column"]::-webkit-scrollbar { width: 10px; height: 10px; }
123
- div[data-testid="column"]::-webkit-scrollbar-thumb { border-radius: 8px; background-color: rgba(0,0,0,0.12); }
124
- div[data-testid="column"]::-webkit-scrollbar-track { background: transparent; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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):