From 66f159f11056fd021bf9e153385ec454003f609d Mon Sep 17 00:00:00 2001 From: Javier Sagredo Date: Thu, 7 May 2026 02:39:04 +0200 Subject: [PATCH] Show only constructor names in data fam-instance node labels Node labels for data fam-instances now read `Family args = ConA | ConB` instead of `Family args = ConA Int Bool | ConB { x :: Char }`. Fields just pad the node visually and are rarely interesting at a glance. The side panel still renders the full constructor declaration (name + arg types or record fields) for when the detail is wanted. Co-Authored-By: Claude Opus 4.7 (1M context) --- data/viewer.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/data/viewer.js b/data/viewer.js index 0f81a65..5cc7e36 100644 --- a/data/viewer.js +++ b/data/viewer.js @@ -1382,13 +1382,13 @@ const args = renderArgsCompact(fi.fiArgs, fi.fiTyVars); const head = fi.fiFamily.qnName + (args ? ' ' + args : ''); if (fi.fiIsData) { - // Show the user-declared data constructors on the right-hand - // side, using `|` between alternatives. Empty fiDataCons (older - // dumps, or extraction edge cases) just degrade to the bare - // head with no `=`. + // Node label: just the constructor name(s), not the fields. + // Fields tend to be uninteresting at-a-glance and pad the + // node visually; the side panel still shows the full + // declaration for users who want the detail. const dcs = fi.fiDataCons || []; if (dcs.length === 0) return head; - const cons = dcs.map(dc => renderDataCon(dc, fi.fiTyVars)).join(' | '); + const cons = dcs.map(dc => dc.dcName || '?').join(' | '); return head + ' = ' + cons; } return head + ' = ' + renderArg(fi.fiRhs, fi.fiTyVars); -- 2.54.0