From f010ee57cfce9bfbf768486a45cc918247b646b2 Mon Sep 17 00:00:00 2001 From: "Bobby Abellana (aider)" Date: Tue, 11 Feb 2025 11:05:44 -0800 Subject: [PATCH] fix: Update directory browsing to correctly sync input fields and session state --- src/streamlit_app.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/streamlit_app.py b/src/streamlit_app.py index 57f41f8..f8ba947 100644 --- a/src/streamlit_app.py +++ b/src/streamlit_app.py @@ -155,24 +155,30 @@ with col1: help=f"You can upload multiple {file_type} files" ) else: # Select Directory + # Source Directory source_dir = st.text_input("Source Directory Path", value=st.session_state.get('source_dir', ''), + key='source_dir_input', help="Enter the full path to the directory containing files to process") source_browse = st.button("Browse Source Directory") if source_browse: path = get_directory_path("Select Source Directory") if path: st.session_state['source_dir'] = path + st.session_state['source_dir_input'] = path st.experimental_rerun() - + + # Destination Directory dest_dir = st.text_input("Destination Directory Path", value=st.session_state.get('dest_dir', ''), + key='dest_dir_input', help="Enter the full path where processed files will be saved") dest_browse = st.button("Browse Destination Directory") if dest_browse: path = get_directory_path("Select Destination Directory") if path: st.session_state['dest_dir'] = path + st.session_state['dest_dir_input'] = path st.experimental_rerun() with col2: