fix(dashboard): leggi righe selezionate da e.args nel callback selection

Il callback registrato via top_table.on("selection", ...) riceve un
GenericEventArguments di NiceGUI, non un TableSelectionEventArguments,
quindi l'attributo .selection non esiste e il click su una riga della
tabella "Top genomi" generava AttributeError. Le righe selezionate
arrivano nel payload Quasar come e.args["rows"].

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Adriano Dal Pastro
2026-05-15 05:38:42 +00:00
parent 14f130aa5a
commit 4b9cded966
+3 -2
View File
@@ -847,9 +847,10 @@ def genomes() -> None:
_render_detail(match.iloc[0].to_dict()) _render_detail(match.iloc[0].to_dict())
def on_row_selected(e: Any) -> None: def on_row_selected(e: Any) -> None:
if not e.selection: rows = (e.args or {}).get("rows") or []
if not rows:
return return
full_id = e.selection[0].get("_full_id") full_id = rows[0].get("_full_id")
if not full_id: if not full_id:
return return
state["selected_gid"] = full_id state["selected_gid"] = full_id