Spaces:
Running
Running
Commit Β·
c10ff53
1
Parent(s): 42189b1
temp setup file browser
Browse files- streamlit-client/app.py +22 -3
streamlit-client/app.py
CHANGED
|
@@ -573,6 +573,24 @@ if st.session_state.view_mode == "case_study":
|
|
| 573 |
st.markdown(m["content"])
|
| 574 |
if m.get("intermediate_state"):
|
| 575 |
render_intermediate_state(m["intermediate_state"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 576 |
st.stop()
|
| 577 |
|
| 578 |
# Live mode: require API key - enhanced login page
|
|
@@ -749,8 +767,8 @@ with col4:
|
|
| 749 |
|
| 750 |
st.divider()
|
| 751 |
|
| 752 |
-
# Workspace Code File Browser
|
| 753 |
-
if st_file_browser is not None:
|
| 754 |
base = _case_study_base()
|
| 755 |
memo_workspaces = []
|
| 756 |
if base.exists():
|
|
@@ -818,9 +836,10 @@ if st_file_browser is not None:
|
|
| 818 |
show_upload_file=False,
|
| 819 |
show_preview=True,
|
| 820 |
)
|
| 821 |
-
|
| 822 |
with st.expander("π Workspace Files (Agent Code)", expanded=False):
|
| 823 |
st.info("Install `streamlit-file-browser` to browse workspace files.")
|
|
|
|
| 824 |
|
| 825 |
for m in st.session_state.messages:
|
| 826 |
with st.chat_message(m["role"]):
|
|
|
|
| 573 |
st.markdown(m["content"])
|
| 574 |
if m.get("intermediate_state"):
|
| 575 |
render_intermediate_state(m["intermediate_state"])
|
| 576 |
+
|
| 577 |
+
# File browser for case study mode β browse workspace of selected case
|
| 578 |
+
if st_file_browser is not None:
|
| 579 |
+
case_dir = selected_path.parent
|
| 580 |
+
ws_dir = case_dir / "workspace"
|
| 581 |
+
browse_path = ws_dir if ws_dir.exists() else case_dir
|
| 582 |
+
with st.expander("π Workspace Files (Agent Code)", expanded=False):
|
| 583 |
+
st.caption(f"Browsing: `{browse_path.resolve()}`")
|
| 584 |
+
st_file_browser(
|
| 585 |
+
str(browse_path.resolve()),
|
| 586 |
+
key="case_study_file_browser",
|
| 587 |
+
show_choose_file=True,
|
| 588 |
+
show_download_file=True,
|
| 589 |
+
show_delete_file=False,
|
| 590 |
+
show_new_folder=False,
|
| 591 |
+
show_upload_file=False,
|
| 592 |
+
show_preview=True,
|
| 593 |
+
)
|
| 594 |
st.stop()
|
| 595 |
|
| 596 |
# Live mode: require API key - enhanced login page
|
|
|
|
| 767 |
|
| 768 |
st.divider()
|
| 769 |
|
| 770 |
+
# Workspace Code File Browser β hidden from live/agent chat (shown in case_study mode only)
|
| 771 |
+
if st.session_state.view_mode != "live" and st_file_browser is not None:
|
| 772 |
base = _case_study_base()
|
| 773 |
memo_workspaces = []
|
| 774 |
if base.exists():
|
|
|
|
| 836 |
show_upload_file=False,
|
| 837 |
show_preview=True,
|
| 838 |
)
|
| 839 |
+
elif st.session_state.view_mode != "live":
|
| 840 |
with st.expander("π Workspace Files (Agent Code)", expanded=False):
|
| 841 |
st.info("Install `streamlit-file-browser` to browse workspace files.")
|
| 842 |
+
# When view_mode == "live", file browser is hidden from agent chat
|
| 843 |
|
| 844 |
for m in st.session_state.messages:
|
| 845 |
with st.chat_message(m["role"]):
|