Update pages/type_text.py
Browse files- pages/type_text.py +30 -5
pages/type_text.py
CHANGED
@@ -221,11 +221,36 @@ if INTdesc_input is not None and st.button("Map to SBS codes", key="run_st_model
|
|
221 |
dfALL = pd.concat([dfALL, pd.DataFrame([dictA])], ignore_index=True)
|
222 |
|
223 |
st.dataframe(data=dfALL, hide_index=True)
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
229 |
|
230 |
display_format = "ask REASONING MODEL: Which, if any, of the following SBS descriptions corresponds best to " + INTdesc_input +"? "
|
231 |
#st.write(display_format)
|
|
|
221 |
dfALL = pd.concat([dfALL, pd.DataFrame([dictA])], ignore_index=True)
|
222 |
|
223 |
st.dataframe(data=dfALL, hide_index=True)
|
224 |
+
st.markdown("""
|
225 |
+
<div id="scroll-target" style="position: relative; bottom: 60px;"></div>
|
226 |
+
<script>
|
227 |
+
// Function that handles scrolling with an offset
|
228 |
+
function scrollWithOffset() {
|
229 |
+
// Find our target element
|
230 |
+
const target = document.getElementById('scroll-target');
|
231 |
+
if (!target) return;
|
232 |
+
|
233 |
+
// Get the main Streamlit container (parent document since Streamlit uses iframes)
|
234 |
+
const streamlitDoc = window.parent.document;
|
235 |
+
const mainContainer = streamlitDoc.querySelector('.main');
|
236 |
+
|
237 |
+
if (mainContainer) {
|
238 |
+
// Calculate position that accounts for the status bar
|
239 |
+
const scrollPosition = Math.max(0, mainContainer.scrollHeight - window.innerHeight + 60);
|
240 |
+
|
241 |
+
// Scroll the container
|
242 |
+
mainContainer.scrollTop = scrollPosition;
|
243 |
+
// Also try the window for good measure
|
244 |
+
window.parent.scrollTo(0, scrollPosition);
|
245 |
+
}
|
246 |
+
}
|
247 |
+
|
248 |
+
// Try scrolling after small delays to ensure everything is rendered
|
249 |
+
setTimeout(scrollWithOffset, 100);
|
250 |
+
setTimeout(scrollWithOffset, 300);
|
251 |
+
setTimeout(scrollWithOffset, 500);
|
252 |
+
</script>
|
253 |
+
""", unsafe_allow_html=True)
|
254 |
|
255 |
display_format = "ask REASONING MODEL: Which, if any, of the following SBS descriptions corresponds best to " + INTdesc_input +"? "
|
256 |
#st.write(display_format)
|