fix: queue table not updating during uploads (virtual scrolling bug)
The in-place update path for virtual scrolling would silently skip the full DOM rebuild when row IDs didn't match due to sort order changes. The break statement only exited the for-loop but return still fired, preventing any update. Now tracks allMatch flag and falls through to innerHTML rebuild when needed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
261463bbe5
commit
3d8979797c
@ -850,12 +850,13 @@ function _renderVirtualRows(tbody) {
|
|||||||
if (startIdx === _lastVisibleRange.start && endIdx === _lastVisibleRange.end) {
|
if (startIdx === _lastVisibleRange.start && endIdx === _lastVisibleRange.end) {
|
||||||
const rows = tbody.querySelectorAll('.queue-row');
|
const rows = tbody.querySelectorAll('.queue-row');
|
||||||
if (rows.length === endIdx - startIdx) {
|
if (rows.length === endIdx - startIdx) {
|
||||||
|
let allMatch = true;
|
||||||
for (let i = 0; i < rows.length; i++) {
|
for (let i = 0; i < rows.length; i++) {
|
||||||
const job = _sortedJobsCache[startIdx + i];
|
const job = _sortedJobsCache[startIdx + i];
|
||||||
if (rows[i].dataset.jobId !== job.id) { break; } // identity mismatch, full rebuild below
|
if (rows[i].dataset.jobId !== job.id) { allMatch = false; break; }
|
||||||
_updateRowInPlace(rows[i], job);
|
_updateRowInPlace(rows[i], job);
|
||||||
}
|
}
|
||||||
return;
|
if (allMatch) return; // all rows updated in-place, no rebuild needed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_lastVisibleRange = { start: startIdx, end: endIdx };
|
_lastVisibleRange = { start: startIdx, end: endIdx };
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user