Javier Sagredo [Wed, 6 May 2026 22:36:11 +0000 (00:36 +0200)]
Document predicate-node dedup caveats in INTERNALS.md
New section between the resolution-chain determinism notes and the
"viewer is not doing" wrap-up, covering the structural-hash dedup,
the context-vs-superclass reduction asymmetry, tyvar-index aliasing
across instances, the role-sticky-to-context behaviour, and the
fact that predicate nodes are view-scoped (not persisted).
Javier Sagredo [Wed, 6 May 2026 22:33:10 +0000 (00:33 +0200)]
Unify unmatched superclass with context predicate node
Was: unmatched superclass → class node, edge "needs Foo a b (no
local match)".
Now: unmatched superclass → predicate node (the same one created
from a context constraint when the predicate happens to match,
otherwise a fresh role='extern' grey node), edge labelled
"superclass constraint".
This collapses the case where a constraint appears in *both* the
context and as an unmatched superclass — the user sees one node
with two edges ("instance context" + "superclass constraint")
instead of two disconnected nodes saying the same thing. When the
constraint is purely an external superclass, the grey 'extern'
predicate node makes "must exist somewhere outside this project"
visible at a glance.
Javier Sagredo [Wed, 6 May 2026 22:31:10 +0000 (00:31 +0200)]
Render instance context constraints as predicate nodes
Was: instance → class node, edge labelled "ctx: <args>".
Now: instance → predicate node ("Foo a b" rendered like a constraint),
edge labelled "instance context".
The new node kind 'predicate' deduplicates on a structural id
(class qid + JSON-stringified args), so the same constraint surfaces
once even when it appears in multiple superclass / context slots —
the next commit relies on this to merge unmatched-superclass
requirements with overlapping context predicates.
Side panel grows a renderPredicatePanel that explains the node's role
and links to the underlying class.
Javier Sagredo [Wed, 6 May 2026 22:27:58 +0000 (00:27 +0200)]
Shorten "superclass needed Foo a b" edge label to "superclass constraint"
The class + arg shape is already on the target node (matched instance,
or — after the next commit — a predicate node), so spelling it out on
the edge label was redundant. Plain "superclass constraint" describes
the relationship the edge depicts and lets the eye stay on the nodes.
Javier Sagredo [Wed, 6 May 2026 22:27:28 +0000 (00:27 +0200)]
Don't draw the predicate-class node alongside fam-resolves matches
The "fam-resolves" chain pulled the predicate class into the instance
view as a separate node and connected it to the matched instance with
a green "defines" edge — duplicating information already on the
matched-instance label. Drop the class anchor + defines edge here, the
same way commit 3a8e0ac handled the matched-superclass case.
Javier Sagredo [Wed, 6 May 2026 22:14:26 +0000 (00:14 +0200)]
Drop the instance → fam-instance "= (Rhs)" edge
The dotted-purple edge from a focused instance to its associated
fam-instance carried only the RHS label, which the fam-instance
node's own label already shows in full. Removing it cleans up the
instance view; the fam-instance still surfaces because the family
node points at it via fam-defines, which is enough to indicate the
context relevance.
Also drop the now-dead cytoscape style rule and the legend row.
Javier Sagredo [Wed, 6 May 2026 22:13:09 +0000 (00:13 +0200)]
Drop the "satisfies Foo" label on fam-resolves chain edges
The teal-dotted edge between a fam-instance and the matched class
instance already speaks for itself — its endpoints (and the side
panel on click) carry the same information the inline label was
trying to add. The label was just visual noise.
Javier Sagredo [Wed, 6 May 2026 22:12:43 +0000 (00:12 +0200)]
Remove the "via Bar" instance → family edge
The dashed light-purple arrow connecting an instance to a referenced
type family was visually opaque — readers couldn't tell what
relationship it depicted. Drop it from addFamilyLinksFromArgs along
with its cytoscape style rule and the help-legend row.
The fam-instance nodes the function surfaces and the fam-resolves
chain edges remain — those are the meaningful continuations from the
matched-superclass-instance node.
Javier Sagredo [Wed, 6 May 2026 22:11:33 +0000 (00:11 +0200)]
Don't draw the superclass class node when an instance matches locally
Previously every "superclass needed" arrow pulled in both the matched
instance node *and* a class node for the superclass — joined to the
matched instance by an extra "defines" edge. The class node duplicated
information already on the matched-instance label, just adding clutter.
Restrict the class-node side to the no-local-match branch, which still
needs somewhere for its needs-external edge to terminate.
Javier Sagredo [Wed, 6 May 2026 22:10:50 +0000 (00:10 +0200)]
Relabel "needs Foo" superclass edges to "superclass needed Foo"
The plain "needs Foo …" edge label in the instance view glossed
which kind of constraint we were displaying (context vs. superclass
vs. ambient). Make it explicit: this edge represents a *superclass*
requirement.
Javier Sagredo [Wed, 6 May 2026 22:10:09 +0000 (00:10 +0200)]
Add docs/INTERNALS.md (with neutral examples)
The internals walkthrough was sitting uncommitted from an earlier
session. Adding it now, with the Cardano-flavoured examples
(Ticked / Shelley / Byron / TxOut/LedgerState) swapped for neutral
Wrap / Foo Int / Element shapes — the doc explains classgraph
internals, not any particular downstream project's vocabulary.
Javier Sagredo [Wed, 6 May 2026 22:09:17 +0000 (00:09 +0200)]
Document setup for the two Emacs editor-link schemes
Step-by-step org-protocol setup (init.el snippet + xdg-mime desktop
entry + macOS pointer) plus a DIY emacs:// scheme path with a sample
emacsclient wrapper script. Both end with the "pick from dropdown"
step so the user can see the loop close.
Javier Sagredo [Wed, 6 May 2026 22:08:40 +0000 (00:08 +0200)]
Add two Emacs editor-link schemes
emacs://: a freeform URL the user maps to emacsclient via xdg-mime.
emacs-org://: the canonical org-protocol://open-source URL handler
that ships with Emacs once (require 'org-protocol) is loaded.
Javier Sagredo [Wed, 6 May 2026 22:07:56 +0000 (00:07 +0200)]
Don't recolor the focused type-family node
The [?focused] cytoscape rule used to paint every focused node dark
blue, which on the amber family node left dark-on-dark text that
couldn't be read. Split the rule: class nodes still go navy; family
nodes keep their amber palette and indicate focus via a thicker brown
border and larger text.
Javier Sagredo [Wed, 6 May 2026 22:07:21 +0000 (00:07 +0200)]
Rename Pin to Focus in the side-panel UI
Side-panel button is now "🎯 Focus" / "🎯 Unfocus" (was "📌 Pin" /
"📌 Unpin"). Hint text, help legend, counts line, and README all
updated. Internal identifiers (focusSet, pinClass, the panel-btn.pin
CSS class, data-action="toggle-pin") stay as-is — they're invisible
to users and changing them invites bigger churn.
Javier Sagredo [Wed, 6 May 2026 22:06:25 +0000 (00:06 +0200)]
Render type-level lists as [a, b, c] not (: a (: b []))
renderArg now special-cases GHC's promoted cons (`:`) / nil (`[]`)
TyCons and the unapplied list TyCon, unfolding nested cons chains
into Haskell list syntax. Demo gets a Bagful + BagList exhibit so
the path is exercised.
Javier Sagredo [Wed, 6 May 2026 22:05:20 +0000 (00:05 +0200)]
Infer per-package source roots from classgraph-view --input
Add a --source-root PKG=PATH override and infer a default per-package
root from each --input dir's parent. Schema gains iiDefinedIn /
fiDefinedIn (filled in at merge time from the dump's mdPackage), so
orphan instances resolve under the *defining* package, not the
class's. Render embeds the resulting map; viewer's editor links look
up the per-package root before falling back to the localStorage
override.