harry-lu-0708 Cursor commited on
Commit
1192d37
·
1 Parent(s): 385a160

Case Study: hide memo_*, default to Kepler Exoplanets

Browse files
Files changed (1) hide show
  1. streamlit-client/app.py +3 -2
streamlit-client/app.py CHANGED
@@ -407,7 +407,7 @@ def list_available_chat_files() -> list[tuple[Path, dict]]:
407
  results = []
408
  seen = set()
409
  for base in get_case_study_memory_paths():
410
- dirs = [d for d in base.iterdir() if d.is_dir() and (d / "chat_history.json").exists()]
411
  dirs.sort(key=lambda x: x.stat().st_mtime if x.exists() else 0, reverse=True)
412
  for memo_dir in dirs:
413
  chat_file = memo_dir / "chat_history.json"
@@ -511,7 +511,8 @@ if st.session_state.view_mode == "case_study":
511
 
512
  options = [m["label"] for _, m in available]
513
  paths = [p for p, _ in available]
514
- idx = st.selectbox("Select case study", range(len(options)), format_func=lambda i: options[i], key="casestudy_select")
 
515
  selected_path = paths[idx]
516
  loaded = load_chat_from_file(selected_path)
517
  st.divider()
 
407
  results = []
408
  seen = set()
409
  for base in get_case_study_memory_paths():
410
+ dirs = [d for d in base.iterdir() if d.is_dir() and (d / "chat_history.json").exists() and not d.name.startswith("memo_")]
411
  dirs.sort(key=lambda x: x.stat().st_mtime if x.exists() else 0, reverse=True)
412
  for memo_dir in dirs:
413
  chat_file = memo_dir / "chat_history.json"
 
511
 
512
  options = [m["label"] for _, m in available]
513
  paths = [p for p, _ in available]
514
+ default_idx = next((i for i, p in enumerate(paths) if "Kepler_Exoplanets_Prediction" in str(p)), 0)
515
+ idx = st.selectbox("Select case study", range(len(options)), format_func=lambda i: options[i], index=default_idx, key="casestudy_select")
516
  selected_path = paths[idx]
517
  loaded = load_chat_from_file(selected_path)
518
  st.divider()