feat(virtual_table): Auto-reload when injected row leaves viewport

When an injected row has been committed (injected_committed=true)
and scrolling moves it out of the visible area:
- Sets needs_reload=true in result
- Clears injection state

This triggers the panel to refetch data from DB, where the
new row will appear in its proper sorted position.
This commit is contained in:
reugenio 2025-12-28 02:28:55 +01:00
parent 08b10486d2
commit ca187e743e

View file

@ -571,6 +571,18 @@ pub fn virtualAdvancedTableRect(
} }
} }
// =========================================================================
// Detectar si la fila inyectada salió del viewport (requiere reload)
// =========================================================================
if (list_state.hasInjection()) {
// Solo hacer reload si la fila ya fue guardada (injected_committed)
// y ya no es visible en el viewport actual
if (list_state.injected_committed and !list_state.isInjectionVisible(visible_rows)) {
result.needs_reload = true;
list_state.clearInjection();
}
}
// ========================================================================= // =========================================================================
// Tips Proactivos (FASE I): Rotar tips cada ~10 segundos // Tips Proactivos (FASE I): Rotar tips cada ~10 segundos
// ========================================================================= // =========================================================================