fix: handle empty groups after merge operation

Problem:
- After merge, source groups become empty
- Empty groups stay in UI as garbage data
- User sees empty groups with 0 faces

Solution:
- updateClusterAfterMerge() now removes source groups after merge
- Added removal from clusterAsPending computed property
- Ensures clean UI after merge operation

Behavior:
- Source group is deleted after all members merged to target
- Target group receives all members
- No empty groups left in UI

Related: merge functionality debug logging added in previous commit
This commit is contained in:
2026-07-25 13:25:16 +08:00
parent 361a01a025
commit c235d11d03

View File

@@ -1611,9 +1611,15 @@ function updateClusterAfterMerge(sourceGroupId: string, targetGroupId: string) {
const idx = clusters.findIndex((c: any) => c.identity_uuid === sourceGroupId)
if (idx >= 0) {
clusters.splice(idx, 1)
clusters.splice(idx, 1) // ← Remove empty source group
}
}
// Also remove from clusterAsPending computed
const idx2 = clusterAsPending.value.findIndex((c: any) => c.identity_uuid === sourceGroupId)
if (idx2 >= 0) {
clusterAsPending.value.splice(idx2, 1)
}
}
async function batchDeleteFaces() {