From aa256005801c7ea708325eaaa93b5520f05ddd34 Mon Sep 17 00:00:00 2001 From: Momentry Studio Date: Sat, 25 Jul 2026 15:51:38 +0800 Subject: [PATCH] refactor: remove identity/pending concepts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - identity_uuid → group_uuid - Remove status: 'pending' - Remove starred: false - Keep only: face, FS, face group --- src/views/PeopleView.vue | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/src/views/PeopleView.vue b/src/views/PeopleView.vue index 835f1a5..68ed31f 100644 --- a/src/views/PeopleView.vue +++ b/src/views/PeopleView.vue @@ -50,7 +50,7 @@
-
+
@@ -283,7 +283,7 @@

Select Target Group

Choose which group to keep. Other selected groups will be merged into this one.

-
+
@@ -313,7 +313,7 @@
-
+
@@ -537,7 +537,7 @@ function isFaceSelected(t: any): boolean { } function isGroupSelected(c: any): boolean { - return selectedGroups.value.includes(c.identity_uuid) + return selectedGroups.value.includes(c.group_uuid) } function isClusterTraceSelected(t: any): boolean { @@ -650,11 +650,9 @@ const faceGroups = computed(() => { const defaultName = `group ${String(idx + 1).padStart(2, '0')}` if (!c.name) c.name = defaultName return { - identity_uuid: `cluster_${c.cluster_id ?? c.group_id}`, - identity_id: `cluster_${String(c.cluster_id ?? c.group_id).padStart(2, '0')}`, + group_uuid: `group_${c.cluster_id ?? c.group_id}`, + group_id: c.cluster_id ?? c.group_id, name: c.name, - status: 'pending', - starred: false, trace_count: c.trace_count, representative_trace: repTraceId, cluster_id: c.cluster_id ?? c.group_id, @@ -936,9 +934,9 @@ async function loadClusterResults() { for (const tid of traceIds) { const s = suggestions[String(tid)] if (s) { - const key = s.identity_uuid + const key = s.group_uuid if (!identityCounts[key]) { - identityCounts[key] = { name: s.name, uuid: s.identity_uuid, count: 0 } + identityCounts[key] = { name: s.name, uuid: s.group_uuid, count: 0 } } identityCounts[key].count++ } @@ -1471,12 +1469,12 @@ async function createNewIdentityFromFace() { fileUuid: c.file_uuid, traceIds: c.trace_id ? [c.trace_id] : undefined }) - if (result?.identity_uuid) { + if (result?.group_uuid) { faceDetailModal.value.show = false if (c.trace_id) { unassignedTracesCache.value = unassignedTracesCache.value.filter((t: any) => t.trace_id !== c.trace_id) } - const cleanUuid = result.identity_uuid.replace(/-/g, '') + const cleanUuid = result.group_uuid.replace(/-/g, '') router.push(`/people/${cleanUuid}`) } else { alert(t('people.detail.create_identity_failed')) @@ -1512,7 +1510,7 @@ function toggleFaceSelection(t: any) { } function toggleGroupSelection(c: any) { - const key = c.identity_uuid + const key = c.group_uuid const idx = selectedGroups.value.indexOf(key) if (idx >= 0) { selectedGroups.value.splice(idx, 1) @@ -1634,7 +1632,7 @@ async function batchDeleteGroups() { if (!selectedGroups.value.length) return const groupIds = Array.from(selectedGroups.value) - const groupsToDelete = faceGroups.value.filter((c: any) => groupIds.includes(c.identity_uuid)) + const groupsToDelete = faceGroups.value.filter((c: any) => groupIds.includes(c.group_uuid)) let totalTraces = 0 const allTraceIds: number[] = [] @@ -1687,7 +1685,7 @@ async function batchMergeGroups() { const groupIds = Array.from(selectedGroups.value) console.log('[batchMergeGroups] groupIds:', groupIds) - mergeCandidateGroups.value = faceGroups.value.filter((c: any) => groupIds.includes(c.identity_uuid)) + mergeCandidateGroups.value = faceGroups.value.filter((c: any) => groupIds.includes(c.group_uuid)) console.log('[batchMergeGroups] mergeCandidateGroups:', mergeCandidateGroups.value.length) showMergeTargetModal.value = true @@ -1697,7 +1695,7 @@ async function executeMerge(targetGroupId: string) { console.log('[executeMerge] targetGroupId:', targetGroupId) showMergeTargetModal.value = false - const targetGroup = faceGroups.value.find((c: any) => c.identity_uuid === targetGroupId) + const targetGroup = faceGroups.value.find((c: any) => c.group_uuid === targetGroupId) console.log('[executeMerge] targetGroup:', targetGroup) if (!targetGroup) return @@ -1710,7 +1708,7 @@ async function executeMerge(targetGroupId: string) { const groupIds = Array.from(selectedGroups.value) const sourceGroupIds = groupIds.filter(id => id !== targetGroupId) - const sourceGroups = faceGroups.value.filter((c: any) => sourceGroupIds.includes(c.identity_uuid)) + const sourceGroups = faceGroups.value.filter((c: any) => sourceGroupIds.includes(c.group_uuid)) console.log('[executeMerge] sourceGroups:', sourceGroups.length) const sourceGroupNames = sourceGroups.map(g => g.name).filter(Boolean) @@ -1831,7 +1829,7 @@ async function createNewGroupAndMove() { traceIds: traceList.map(t => t.trace_id) }) - if (result?.identity_uuid) { + if (result?.group_uuid) { clearSelection() await refresh() }