simple-text-analyzer / clear_session.py
egumasa's picture
more sophistication indice selection
42f8800
import streamlit as st
from web_app.session_manager import SessionManager
st.title("πŸ”„ Session State Reset")
st.write("## Current Session State")
st.write("Reference lists currently loaded:")
if hasattr(st.session_state, 'reference_lists') and st.session_state.reference_lists:
for name, data in st.session_state.reference_lists.items():
st.write(f"- **{name}**")
else:
st.write("No reference lists loaded")
st.write("---")
if st.button("πŸ—‘οΈ Clear All Session State", type="primary"):
# Clear all session state
for key in list(st.session_state.keys()):
del st.session_state[key]
# Reinitialize
SessionManager.initialize_session_state()
st.success("βœ… Session state cleared! Please refresh the page.")
st.balloons()
st.write("### Instructions:")
st.write("1. Click 'Clear All Session State' above")
st.write("2. Refresh your browser page")
st.write("3. Go back to the Lexical Sophistication tool")
st.write("4. Re-select your reference lists")
st.write("5. You should now see smart defaults!")