AIdeaText commited on
Commit
61baae9
verified
1 Parent(s): c950914

Update modules/studentact/current_situation_interface.py

Browse files
modules/studentact/current_situation_interface.py CHANGED
@@ -102,36 +102,29 @@ def display_current_situation_interface(lang_code, nlp_models, t):
102
  with st.container():
103
  input_col, results_col = st.columns([1,2])
104
 
105
- # Primero, agregar el CSS personalizado
106
- st.markdown("""
107
- <style>
108
- .stTextArea textarea {
109
- min-height: 800px !important;
110
- }
111
- </style>
112
- """, unsafe_allow_html=True)
113
-
114
  with input_col:
115
- # Text area con manejo de estado - usando t.get directamente
116
- text_input = st.text_area(
117
- t.get('input_prompt', "Escribe o pega tu texto aqu铆:"),
118
- height=800,
119
- key=f"text_area_{lang_code}", # Clave 煤nica por idioma
120
- value=st.session_state.text_input,
121
- help=t.get('help', "Este texto ser谩 analizado para darte recomendaciones personalizadas")
122
- )
123
-
124
- # Funci贸n para manejar cambios de texto
125
- if text_input != st.session_state.text_input:
126
- st.session_state.text_input = text_input
127
- st.session_state.show_results = False
128
-
129
- if st.button(
130
- t.get('analyze_button', "Analizar mi escritura"), # Usando t.get directamente
131
- type="primary",
132
- disabled=not text_input.strip(),
133
- use_container_width=True,
134
- ):
 
135
  try:
136
  with st.spinner(t.get('processing', "Analizando...")): # Usando t.get directamente
137
  doc = nlp_models[lang_code](text_input)
 
102
  with st.container():
103
  input_col, results_col = st.columns([1,2])
104
 
105
+ ###############################################################################################
 
 
 
 
 
 
 
 
106
  with input_col:
107
+ with st.form(key=f"text_input_form_{lang_code}"):
108
+ text_input = st.text_area(
109
+ t.get('input_prompt', "Escribe o pega tu texto aqu铆:"),
110
+ height=800,
111
+ key=f"text_area_{lang_code}",
112
+ value=st.session_state.text_input,
113
+ help=t.get('help', "Este texto ser谩 analizado para darte recomendaciones personalizadas")
114
+ )
115
+
116
+ submit_button = st.form_submit_button(
117
+ t.get('analyze_button', "Analizar mi escritura"),
118
+ type="primary",
119
+ use_container_width=True
120
+ )
121
+
122
+ if submit_button:
123
+ if text_input.strip():
124
+ st.session_state.text_input = text_input
125
+
126
+ #######################################################################
127
+ # C贸digo para an谩lisis...
128
  try:
129
  with st.spinner(t.get('processing', "Analizando...")): # Usando t.get directamente
130
  doc = nlp_models[lang_code](text_input)