Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -492,13 +492,6 @@ if not incomplete_with_desc.empty:
|
|
492 |
if suggestions:
|
493 |
suggestions_df = pd.DataFrame(suggestions, columns=["Title", "Suggested Subject"])
|
494 |
|
495 |
-
# --- Apply Style ---
|
496 |
-
styled_suggestions = (
|
497 |
-
suggestions_df.style
|
498 |
-
.background_gradient(cmap="Greens", subset=["Suggested Subject"])
|
499 |
-
.hide(axis="index")
|
500 |
-
)
|
501 |
-
|
502 |
# --- Display inside Dark Card ---
|
503 |
st.markdown("""
|
504 |
<div style='
|
@@ -510,22 +503,10 @@ if not incomplete_with_desc.empty:
|
|
510 |
'>
|
511 |
""", unsafe_allow_html=True)
|
512 |
|
513 |
-
# ---
|
514 |
-
st.
|
515 |
-
|
516 |
-
|
517 |
-
background-color: #2e2e2e !important;
|
518 |
-
color: lightgray !important;
|
519 |
-
}
|
520 |
-
</style>
|
521 |
-
""", unsafe_allow_html=True)
|
522 |
-
|
523 |
-
# --- Actual Table ---
|
524 |
-
st.dataframe(
|
525 |
-
styled_suggestions,
|
526 |
-
use_container_width=True,
|
527 |
-
hide_index=True,
|
528 |
-
height=min(300, len(suggestions) * 35 + 38)
|
529 |
)
|
530 |
|
531 |
st.markdown("</div>", unsafe_allow_html=True)
|
@@ -537,3 +518,4 @@ if not incomplete_with_desc.empty:
|
|
537 |
st.info("Enable AI Suggestions to view recommendations.")
|
538 |
else:
|
539 |
st.success("All records already have subjects or no usable text available.")
|
|
|
|
492 |
if suggestions:
|
493 |
suggestions_df = pd.DataFrame(suggestions, columns=["Title", "Suggested Subject"])
|
494 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
495 |
# --- Display inside Dark Card ---
|
496 |
st.markdown("""
|
497 |
<div style='
|
|
|
503 |
'>
|
504 |
""", unsafe_allow_html=True)
|
505 |
|
506 |
+
# --- Use st.table instead of st.dataframe for consistent dark styling ---
|
507 |
+
st.table(suggestions_df.style
|
508 |
+
.background_gradient(cmap="Greens", subset=["Suggested Subject"])
|
509 |
+
.hide(axis="index")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
510 |
)
|
511 |
|
512 |
st.markdown("</div>", unsafe_allow_html=True)
|
|
|
518 |
st.info("Enable AI Suggestions to view recommendations.")
|
519 |
else:
|
520 |
st.success("All records already have subjects or no usable text available.")
|
521 |
+
|