From 09b6ca6fc85a549b655b4cf92abaa27daac56cc4 Mon Sep 17 00:00:00 2001 From: Momentry Studio Date: Sun, 1 Nov 2026 14:40:58 +0800 Subject: [PATCH] Revert "fix: match cluster custom names by both cluster_id and name keys" This reverts commit 1f3bb31b2dc29f2a9b0381448f93c65c6312581e. --- src/store.ts | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/store.ts b/src/store.ts index 75dc022..a6f9ff8 100644 --- a/src/store.ts +++ b/src/store.ts @@ -382,10 +382,8 @@ export function setClusterResults(fileUuid: string, results: any[]) { const savedCache = JSON.parse(saved) const existing = savedCache[fileUuid] || [] for (const r of existing) { - // Use cluster_id as key (can be integer or string like "Person_0") - const key = r.cluster_id ?? r.name - if (key && r.name && !r.name.startsWith('Person_') && !r.name.startsWith('Trace ') && !r.name.startsWith('Face Trace ')) { - existingNames[String(key)] = r.name + if (r.cluster_id && r.name && !r.name.startsWith('Person_') && !r.name.startsWith('Trace ') && !r.name.startsWith('Face Trace ')) { + existingNames[r.cluster_id] = r.name } } console.log('[setClusterResults] Loaded custom names from localStorage:', existingNames) @@ -397,13 +395,10 @@ export function setClusterResults(fileUuid: string, results: any[]) { // Create new objects to trigger Vue reactivity const newResults = results.map(r => { const newR = { ...r, trace_ids: [...(r.trace_ids || [])] } - // Apply custom names - try matching by cluster_id first, then by original name - const cidKey = String(r.cluster_id ?? '') - const nameKey = r.name || '' - const customName = existingNames[cidKey] || existingNames[nameKey] - if (customName) { - newR.name = customName - console.log('[setClusterResults] Applied custom name:', customName, 'for cluster:', r.cluster_id, '(name:', r.name, ')') + // Apply custom names to new results + if (r.cluster_id && existingNames[r.cluster_id]) { + newR.name = existingNames[r.cluster_id] + console.log('[setClusterResults] Applied custom name:', existingNames[r.cluster_id], 'for cluster:', r.cluster_id) } return newR })