Spaces:
Sleeping
Sleeping
Commit Β·
a0f64e8
1
Parent(s): b356a40
Fix UI scroll layout to freeze sidebar and input tabs
Browse files- frontend/app.py +15 -11
frontend/app.py
CHANGED
|
@@ -648,9 +648,12 @@ def chat_interface():
|
|
| 648 |
st.title(active_sess["title"] if active_sess else "Chat")
|
| 649 |
|
| 650 |
# ββ ALWAYS render history first ββββββββββββββββββββββββββββββββββββββββ
|
| 651 |
-
#
|
| 652 |
-
|
| 653 |
-
|
|
|
|
|
|
|
|
|
|
| 654 |
|
| 655 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 656 |
# STATE: PROCESSING
|
|
@@ -662,14 +665,15 @@ def chat_interface():
|
|
| 662 |
request_id = str(uuid.uuid4())
|
| 663 |
|
| 664 |
# Spinner appears BELOW the rendered history (user question visible above)
|
| 665 |
-
with
|
| 666 |
-
|
| 667 |
-
|
| 668 |
-
|
| 669 |
-
|
| 670 |
-
|
| 671 |
-
|
| 672 |
-
|
|
|
|
| 673 |
|
| 674 |
# Auth expired β logout
|
| 675 |
if result.get("error") == "AUTH_EXPIRED":
|
|
|
|
| 648 |
st.title(active_sess["title"] if active_sess else "Chat")
|
| 649 |
|
| 650 |
# ββ ALWAYS render history first ββββββββββββββββββββββββββββββββββββββββ
|
| 651 |
+
# Wrap history in a fixed-height scrolling container so the page doesn't grow
|
| 652 |
+
# infinitely, keeping the tabs and sidebar perfectly frozen.
|
| 653 |
+
chat_container = st.container(height=500, border=False)
|
| 654 |
+
with chat_container:
|
| 655 |
+
for msg in st.session_state.messages:
|
| 656 |
+
_render_message(msg)
|
| 657 |
|
| 658 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 659 |
# STATE: PROCESSING
|
|
|
|
| 665 |
request_id = str(uuid.uuid4())
|
| 666 |
|
| 667 |
# Spinner appears BELOW the rendered history (user question visible above)
|
| 668 |
+
with chat_container:
|
| 669 |
+
with st.spinner("Thinking..."):
|
| 670 |
+
result = api_solve(
|
| 671 |
+
text = last.get("content", ""),
|
| 672 |
+
image = last.get("image_data"),
|
| 673 |
+
session_id = active_sid,
|
| 674 |
+
request_id = request_id,
|
| 675 |
+
mode = st.session_state.current_mode,
|
| 676 |
+
)
|
| 677 |
|
| 678 |
# Auth expired β logout
|
| 679 |
if result.get("error") == "AUTH_EXPIRED":
|