yusenthebot
commited on
Commit
·
214de5b
1
Parent(s):
81fd60c
Fix: Replace st.dataframe with simple markdown to avoid Arrow row index error
Browse files- src/app/main_app.py +10 -19
src/app/main_app.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
| 1 |
###############################################################
|
| 2 |
# main_app.py — Agentic Language Partner UI (Streamlit)
|
| 3 |
###############################################################
|
| 4 |
-
import pandas as pd
|
| 5 |
import json
|
| 6 |
import random
|
| 7 |
import re
|
|
@@ -765,7 +764,6 @@ def ocr_tab(username: str):
|
|
| 765 |
###############################################################
|
| 766 |
|
| 767 |
def flashcards_tab(username: str):
|
| 768 |
-
import pandas as pd
|
| 769 |
import re
|
| 770 |
|
| 771 |
# ---------------------------------------------------------
|
|
@@ -1057,23 +1055,16 @@ def flashcards_tab(username: str):
|
|
| 1057 |
# DECK AT A GLANCE (FULL WIDTH)
|
| 1058 |
# =======================================================
|
| 1059 |
st.markdown("---")
|
| 1060 |
-
st.
|
| 1061 |
-
|
| 1062 |
-
|
| 1063 |
-
|
| 1064 |
-
|
| 1065 |
-
|
| 1066 |
-
"
|
| 1067 |
-
|
| 1068 |
-
|
| 1069 |
-
|
| 1070 |
-
"Reviews": c.get("reviews", 0),
|
| 1071 |
-
})
|
| 1072 |
-
|
| 1073 |
-
df = pd.DataFrame(df_rows)
|
| 1074 |
-
st.dataframe(df, height=min(500, len(cards) * 40 + 50), use_container_width=True, hide_index=True)
|
| 1075 |
-
else:
|
| 1076 |
-
st.info("No cards in this deck.")
|
| 1077 |
|
| 1078 |
|
| 1079 |
###############################################################
|
|
|
|
| 1 |
###############################################################
|
| 2 |
# main_app.py — Agentic Language Partner UI (Streamlit)
|
| 3 |
###############################################################
|
|
|
|
| 4 |
import json
|
| 5 |
import random
|
| 6 |
import re
|
|
|
|
| 764 |
###############################################################
|
| 765 |
|
| 766 |
def flashcards_tab(username: str):
|
|
|
|
| 767 |
import re
|
| 768 |
|
| 769 |
# ---------------------------------------------------------
|
|
|
|
| 1055 |
# DECK AT A GLANCE (FULL WIDTH)
|
| 1056 |
# =======================================================
|
| 1057 |
st.markdown("---")
|
| 1058 |
+
with st.expander("Deck at a glance", expanded=False):
|
| 1059 |
+
if cards:
|
| 1060 |
+
for i, c in enumerate(cards, start=1):
|
| 1061 |
+
front = c.get("front", "")
|
| 1062 |
+
back = c.get("back", "")
|
| 1063 |
+
score = c.get("score", 0)
|
| 1064 |
+
reviews = c.get("reviews", 0)
|
| 1065 |
+
st.markdown(f"**{i}.** {front} → {back} *(Score: {score}, Reviews: {reviews})*")
|
| 1066 |
+
else:
|
| 1067 |
+
st.info("No cards in this deck.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1068 |
|
| 1069 |
|
| 1070 |
###############################################################
|