Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -239,18 +239,19 @@ def PredictionsList():
|
|
| 239 |
label = fmt_row(i, prob, tid, tok_disp)
|
| 240 |
|
| 241 |
# Use Div so pointer events are reliable; accept *args to handle any signature
|
| 242 |
-
|
|
|
|
| 243 |
classes=["rowbtn"],
|
| 244 |
-
style={"justifyContent":"flex-start","width":"100%"},
|
| 245 |
-
|
| 246 |
on_click=lambda *args, tid=tid: append_token(tid),
|
|
|
|
| 247 |
on_mouse_enter=lambda *args, tid=tid: preview_token(tid),
|
| 248 |
on_mouse_over=lambda *args, tid=tid: preview_token(tid),
|
| 249 |
on_mouse_move=lambda *args, tid=tid: preview_token(tid),
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
solara.Text(label)
|
| 254 |
|
| 255 |
# ---------- Page ----------
|
| 256 |
@solara.component
|
|
|
|
| 239 |
label = fmt_row(i, prob, tid, tok_disp)
|
| 240 |
|
| 241 |
# Use Div so pointer events are reliable; accept *args to handle any signature
|
| 242 |
+
solara.Button(
|
| 243 |
+
label,
|
| 244 |
classes=["rowbtn"],
|
| 245 |
+
style={"justifyContent": "flex-start", "width": "100%"},
|
| 246 |
+
# click to append
|
| 247 |
on_click=lambda *args, tid=tid: append_token(tid),
|
| 248 |
+
# hover preview (bind several to be robust)
|
| 249 |
on_mouse_enter=lambda *args, tid=tid: preview_token(tid),
|
| 250 |
on_mouse_over=lambda *args, tid=tid: preview_token(tid),
|
| 251 |
on_mouse_move=lambda *args, tid=tid: preview_token(tid),
|
| 252 |
+
on_focus=lambda *args, tid=tid: preview_token(tid), # keyboard focus
|
| 253 |
+
)
|
| 254 |
+
|
|
|
|
| 255 |
|
| 256 |
# ---------- Page ----------
|
| 257 |
@solara.component
|