()
| 19703 | // Preserve virtual-grid and grouped-highlight state before replacing the node. |
| 19704 | const preservedLayoutKey = fileItem.dataset.layoutKey || ''; |
| 19705 | const preservedParentGroupKey = fileItem.dataset.parentGroupKey || ''; |
| 19706 | const preserveGroupedClasses = [ |
| 19707 | 'parent-model-group-child', |
| 19708 | 'parent-model-group-child-start', |
| 19709 | 'parent-model-group-child-middle', |
| 19710 | 'parent-model-group-child-end', |
| 19711 | 'parent-model-group-child-single' |
| 19712 | ]; |
| 19713 | const groupedClassesToRestore = preserveGroupedClasses.filter(cls => fileItem.classList.contains(cls)); |
| 19714 | |
| 19715 | // Remove the old item |
| 19716 | fileItem.remove(); |
| 19717 | |
| 19718 | // Create a new item with the updated thumbnail |
| 19719 | const newItem = createModelItem(model, currentGridView); |
| 19720 | newItem.dataset.index = itemIndex; |
no test coverage detected