feat(frontend): show keep-to-other distance in the duplicates view
deploy / deploy (push) Successful in 1m1s

Each action row now shows the perceptual distance (Δn) between the kept file
and that file, read from the new per-cluster distances; recomputed live when the
survivor pick changes. A transitively-linked pair with no stored distance shows
a muted Δ—.
This commit is contained in:
2026-06-22 22:42:14 +03:00
parent 78b5e86dd6
commit a16accf443
2 changed files with 55 additions and 3 deletions
+11 -1
View File
@@ -1,9 +1,19 @@
import { api } from '$lib/api/client';
import type { File } from '$lib/api/types';
/** A group of mutually similar files. */
/** A stored perceptual-hash (Hamming) distance between two files of a cluster. */
export interface DuplicatePairDistance {
a: string;
b: string;
distance: number;
}
/** A group of mutually similar files, with the pairwise distances known between
* them. A file linked into the cluster only transitively may lack a direct
* distance to some others, so that pair is absent. */
export interface DuplicateCluster {
files: File[];
distances?: DuplicatePairDistance[];
}
export interface DuplicateClusterPage {