From 8a8d349224b861a48c350b5304692b228b965006 Mon Sep 17 00:00:00 2001 From: Javier Sagredo Date: Thu, 7 May 2026 00:49:42 +0200 Subject: [PATCH] =?utf8?q?Show=20class=E2=86=92assoc-family=20links=20in?= =?utf8?q?=20the=20instance=20view?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Until now the assoc-family edges only appeared in the classes view; the instance view of, say, BftCrypto would show its families (BftDSIGN, BftHash, …) only as descendants of the *individual* fam-instances surfaced for each instance. Add an `assoc` arrow straight from the focused class node to each entry of `ciAssocTypes`, so the user can see what families the class declares without having to find an instance that exercises them. Co-Authored-By: Claude Opus 4.7 (1M context) --- data/viewer.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/data/viewer.js b/data/viewer.js index 060c739..25684ad 100644 --- a/data/viewer.js +++ b/data/viewer.js @@ -722,6 +722,25 @@ // Focus class at the top. const focusedId = ensureClassNode(cls.ciName, { focused: true }); + // Associated type families of the focused class. Surface them up + // front (regardless of whether any current instance contributes a + // fam-instance) so the user can see at a glance which families + // the class declares — same `assoc` link the classes view shows. + cls.ciAssocTypes.forEach(famQn => { + const famNodeId = ensureFamilyNode(famQn); + const linkId = focusedId + '~~' + famNodeId; + if (!seenNodes.has(linkId)) { + seenNodes.add(linkId); + els.push({ group: 'edges', data: { + id: linkId, + source: focusedId, + target: famNodeId, + kind: 'assoc', + label: 'assoc', + }}); + } + }); + // One row of instance nodes, anchored to the focused class. insts.forEach((inst, idx) => { const instId = ensureInstanceNode(inst, cls.ciName, -- 2.54.0