perf(photos): append-only render eliminates DOM rebuild on scroll

Replace the innerHTML full-rebuild in _render() with two paths:
- _renderFull(): used for first load, group-mode change, and deletions
- _appendBatch(n): append-only for infinite-scroll pages — O(batch)
  instead of O(total). Existing <img> nodes are never destroyed,
  eliminating the visual flash and unnecessary DOM churn.

Also:
- Extract _renderTile() helper (DRY tile HTML generation)
- Extract _observeSentinel() helper
- Scope _setupVideoThumbnails(startIndex) to only process new tiles
- Add data-group attribute on headers for efficient CSS.escape lookup
- Fix stale WebP references in comments (now JPEG)
- Add virtual scrolling idea to TODO-LIST.md for future evaluation
This commit is contained in:
Diocrafts
2026-03-07 20:46:04 +01:00
parent b8638f5131
commit 2bc77a0bb1
2 changed files with 117 additions and 48 deletions
+4
View File
@@ -34,6 +34,10 @@ This document contains the task list for the development of OxiCloud, a minimali
- [x] Implement multiple file uploads
- [ ] Add progress indicators for long operations
- [x] Implement UI notifications for events
- [ ] Photos timeline: virtual scrolling
- Solo mantener en el DOM las filas visibles en el viewport + un margen. Al hacer scroll, reciclar los nodos que salen por arriba para los que entran por abajo.
- Ventajas: Funciona perfectamente con 50,000 fotos. Uso de memoria constante.
- Excesiva para ahora — evaluar cuando el volumen de fotos lo justifique.
## Phase 2: Authentication and Multi-User