fix(bulk): restore card selection when virtual scroller recreates cards

This commit is contained in:
Will Miao
2026-08-26 09:28:17 +08:00
parent 08895f77ff
commit 0b08ad283a
4 changed files with 172 additions and 3 deletions
+3 -2
View File
@@ -543,8 +543,9 @@ export function createModelCard(model, modelType) {
card.classList.add('excluded-model');
}
// Apply selection state if in bulk mode and this card is in the selected set (LoRA only)
if (modelType === MODEL_TYPES.LORA && state.bulkMode && state.selectedLoras.has(model.file_path)) {
// state.selectedModels resolves to the active page's set (selectedLoras
// included) - do not narrow this back to selectedLoras/LORA-only.
if (state.bulkMode && state.selectedModels.has(model.file_path)) {
card.classList.add('selected');
}