From 49654160fa188ca5f6376602b41c9f33e80e764a Mon Sep 17 00:00:00 2001 From: Javier Sagredo Date: Thu, 7 May 2026 02:49:09 +0200 Subject: [PATCH] Dedupe the side-panel "Subclasses (in this program)" list A single class can appear twice as a subclass of the same class (e.g. `class (Foo a, Foo b) => Bar a b` produces two SuperclassEdges with target Foo). The reverse-index push happens per-edge, which is the right granularity for chain reasoning, but the side-panel list was rendering each entry verbatim and so duplicated subclass names. Add a per-render dedup set keyed on the subclass's qid so each subclass shows up at most once. Co-Authored-By: Claude Opus 4.7 (1M context) --- data/viewer.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/data/viewer.js b/data/viewer.js index 362c98c..e8de238 100644 --- a/data/viewer.js +++ b/data/viewer.js @@ -1763,10 +1763,17 @@ }) .join(''); const subEntries = subclassesByClass.get(cid) || []; + // Dedupe by subclass qid: a single class can list the same + // superclass twice in ciSuperclasses (e.g. `class (Foo a, Foo b) + // => Bar a b` produces two SuperclassEdges with the same target), + // which would otherwise show as duplicate rows here. + const seenSubs = new Set(); const subs = subEntries.length === 0 ? '
none
' : subEntries .map(({subclass}) => { const sid = qid(subclass.ciName); + if (seenSubs.has(sid)) return ''; + seenSubs.add(sid); return `
` + `${escape(subclass.ciName.qnName)}
`; }) -- 2.54.0