mirror of
https://github.com/lWolvesl/antigravity-usage-monitor.git
synced 2026-11-26 17:09:28 +08:00
feat(panel): add experimental modern UI, sliding switchers, cycle range, and fluid animations
This commit is contained in:
@@ -131,7 +131,11 @@ const keyedListState = new WeakMap();
|
||||
* Keyed incremental list reconciler.
|
||||
* Reuses existing DOM nodes by key and patches only changed items in-place.
|
||||
*/
|
||||
export function patchKeyedList(container, items, { keyFn, sigFn, createRow, updateRow }) {
|
||||
export function patchKeyedList(
|
||||
container,
|
||||
items,
|
||||
{ keyFn = (_, i) => i, sigFn, createRow, updateRow, destroyRow } = {}
|
||||
) {
|
||||
if (!container) return;
|
||||
let map = keyedListState.get(container);
|
||||
if (!map) {
|
||||
@@ -175,6 +179,7 @@ export function patchKeyedList(container, items, { keyFn, sigFn, createRow, upda
|
||||
if (record.el.parentNode === container) {
|
||||
container.removeChild(record.el);
|
||||
}
|
||||
destroyRow?.(record.refs, record.el);
|
||||
map.delete(oldKey);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user