From 0a61d522009ba40c489f5dbf9460028bb37acb61 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 16 May 2026 20:50:43 +0000 Subject: [PATCH] feat(text-cleaner): collapse options + auto-scroll to Results on run MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After clicking Clean Text the user was left at the bottom of the script with the Options block still expanded and no viewport movement — they had to scroll to find the Results. - Wrap the whole Options block in an outer ``st.expander("Options", expanded=not _has_result)``. After the Clean Text rerun, both Preview AND Options collapse, leaving the primary action button + Results as the only prominent elements above the fold. The inner Advanced-options expander is preserved as a nested expander (supported in Streamlit 1.36+; this repo pins 1.35+). - Add a 1px anchor div ``#textclean-results-anchor`` immediately before the Results subheader. - On Clean Text click, set a one-shot ``_textclean_scroll_to_results`` flag in session state; on the next render, pop the flag and inject a tiny ``st.components.v1.html`` iframe whose `` + """, + height=0, + )