From df6b0b97675ce69efba68f7895291ba67436208e Mon Sep 17 00:00:00 2001 From: ph4nt0mer Date: Sun, 30 Aug 2026 01:54:15 +0800 Subject: [PATCH] fix: keep duplicate group indices unique when selecting duplicates (#351) The duplicate group index was capped with '% 64' to limit color slots, but the same index is used as the group identity in 'select unique items from duplicates'. With more than 64 duplicate groups the indices wrap around, so later groups had every item selected (nothing kept). Drop the modulo so each group keeps a unique index; colors still differ via the golden-angle hue. --- webapp/src/components/VaultPage.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webapp/src/components/VaultPage.tsx b/webapp/src/components/VaultPage.tsx index 88fd844..58a77cb 100644 --- a/webapp/src/components/VaultPage.tsx +++ b/webapp/src/components/VaultPage.tsx @@ -382,7 +382,9 @@ export default function VaultPage(props: VaultPageProps) { } const groupIndexByKey = new Map(); Array.from(groupKeys).sort().forEach((groupKey, index) => { - groupIndexByKey.set(groupKey, index % 64); + // Keep indices unique (no modulo): they are used both for group colors and + // as the group identity when selecting duplicate items to delete. + groupIndexByKey.set(groupKey, index); }); const byId = new Map(); for (const [cipherId, groupKey] of groupKeyById.entries()) {