Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Make the tableDF container scrollable
Browse files
app.py
CHANGED
|
@@ -488,33 +488,35 @@ try:
|
|
| 488 |
# so we only show it once (on the first row for that speaker).
|
| 489 |
rendered_clip_for: set = set()
|
| 490 |
|
| 491 |
-
|
| 492 |
-
|
| 493 |
-
|
| 494 |
-
|
| 495 |
-
|
| 496 |
-
|
| 497 |
-
|
| 498 |
-
|
| 499 |
-
|
| 500 |
-
|
| 501 |
-
|
| 502 |
-
|
| 503 |
-
row_cols[
|
| 504 |
-
|
| 505 |
-
|
| 506 |
-
|
| 507 |
-
|
| 508 |
-
|
| 509 |
-
|
| 510 |
-
|
| 511 |
-
|
| 512 |
-
|
| 513 |
-
|
| 514 |
-
|
| 515 |
-
|
| 516 |
-
|
| 517 |
-
|
|
|
|
|
|
|
| 518 |
|
| 519 |
# -----------------------------------------------------------------------
|
| 520 |
# Charts (pie1, pie2, sunburst, treemap, timeline, bar)
|
|
|
|
| 488 |
# so we only show it once (on the first row for that speaker).
|
| 489 |
rendered_clip_for: set = set()
|
| 490 |
|
| 491 |
+
# ~52px per row gives roughly 10 visible rows before scrolling
|
| 492 |
+
with st.container(height=520, border=False):
|
| 493 |
+
for _, row in tableDF.iterrows():
|
| 494 |
+
row_cols = st.columns(col_widths)
|
| 495 |
+
display_sp = row["Speaker"]
|
| 496 |
+
|
| 497 |
+
# Map display name back to original SPEAKER_## for clip lookup
|
| 498 |
+
raw_key = next(
|
| 499 |
+
(sp for sp in speakerNames if raw_to_display.get(sp, sp) == display_sp),
|
| 500 |
+
display_sp,
|
| 501 |
+
)
|
| 502 |
+
|
| 503 |
+
row_cols[0].write(display_sp)
|
| 504 |
+
for i, col_name in enumerate(other_cols):
|
| 505 |
+
row_cols[i + 1].write(row[col_name])
|
| 506 |
+
|
| 507 |
+
if has_extras:
|
| 508 |
+
if raw_key in file_clips and raw_key not in rendered_clip_for:
|
| 509 |
+
rendered_clip_for.add(raw_key)
|
| 510 |
+
row_cols[-2].audio(file_clips[raw_key], format="audio/wav")
|
| 511 |
+
sp_segs = st.session_state.speakerSegments.get(currFile, {}).get(raw_key, [])
|
| 512 |
+
if has_waveform and sp_segs:
|
| 513 |
+
if row_cols[-1].button(
|
| 514 |
+
"🔀",
|
| 515 |
+
key=f"randomize_{currFile}_{raw_key}",
|
| 516 |
+
help="Try a different clip for this speaker",
|
| 517 |
+
):
|
| 518 |
+
randomize_speaker_clip(currFile, raw_key)
|
| 519 |
+
st.rerun()
|
| 520 |
|
| 521 |
# -----------------------------------------------------------------------
|
| 522 |
# Charts (pie1, pie2, sunburst, treemap, timeline, bar)
|