Spaces:
Running
Running
Update modules/chatbot/sidebar_chat.py
Browse files
modules/chatbot/sidebar_chat.py
CHANGED
@@ -13,6 +13,7 @@ def display_sidebar_chat(lang_code: str, chatbot_t: dict):
|
|
13 |
lang_code: C贸digo del idioma
|
14 |
chatbot_t: Diccionario de traducciones del chatbot
|
15 |
"""
|
|
|
16 |
# Asegurar que tenemos las traducciones necesarias
|
17 |
default_translations = {
|
18 |
'error_message': 'An error occurred',
|
@@ -26,6 +27,31 @@ def display_sidebar_chat(lang_code: str, chatbot_t: dict):
|
|
26 |
translations = {**default_translations, **chatbot_t}
|
27 |
|
28 |
with st.sidebar:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
with st.expander(translations['expand_chat'], expanded=False):
|
30 |
try:
|
31 |
# Verificar si hay contexto sem谩ntico activo
|
|
|
13 |
lang_code: C贸digo del idioma
|
14 |
chatbot_t: Diccionario de traducciones del chatbot
|
15 |
"""
|
16 |
+
|
17 |
# Asegurar que tenemos las traducciones necesarias
|
18 |
default_translations = {
|
19 |
'error_message': 'An error occurred',
|
|
|
27 |
translations = {**default_translations, **chatbot_t}
|
28 |
|
29 |
with st.sidebar:
|
30 |
+
st.markdown("""
|
31 |
+
<style>
|
32 |
+
/* Contenedor principal del chat con altura fija y scroll */
|
33 |
+
div[data-testid="stExpanderContent"] > div {
|
34 |
+
max-height: 60vh;
|
35 |
+
overflow-y: auto;
|
36 |
+
padding-right: 10px;
|
37 |
+
}
|
38 |
+
|
39 |
+
/* Fija el input en la parte inferior */
|
40 |
+
div[data-testid="stHorizontalBlock"]:has(> div[data-testid="column"]) {
|
41 |
+
position: sticky;
|
42 |
+
bottom: 0;
|
43 |
+
background: white;
|
44 |
+
padding-top: 10px;
|
45 |
+
z-index: 100;
|
46 |
+
}
|
47 |
+
|
48 |
+
/* Asegura que el expander no afecte el layout */
|
49 |
+
section[data-testid="stSidebar"] > div {
|
50 |
+
overflow: visible !important;
|
51 |
+
}
|
52 |
+
</style>
|
53 |
+
""", unsafe_allow_html=True)
|
54 |
+
|
55 |
with st.expander(translations['expand_chat'], expanded=False):
|
56 |
try:
|
57 |
# Verificar si hay contexto sem谩ntico activo
|