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.
This commit is contained in:
ph4nt0mer
2026-08-30 01:54:15 +08:00
committed by GitHub
parent 64037695b8
commit df6b0b9767
+3 -1
View File
@@ -382,7 +382,9 @@ export default function VaultPage(props: VaultPageProps) {
} }
const groupIndexByKey = new Map<string, number>(); const groupIndexByKey = new Map<string, number>();
Array.from(groupKeys).sort().forEach((groupKey, index) => { 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<string, number>(); const byId = new Map<string, number>();
for (const [cipherId, groupKey] of groupKeyById.entries()) { for (const [cipherId, groupKey] of groupKeyById.entries()) {