A highlighted edge draws last on both canvases - #625
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On the Ontology page, selecting a class lights its edges — and a dimmed edge from
another program still drew over them, cutting the bright lines into segments. The
Graph page does not have this, because it solved the same problem in 2026-08 and
kept the solution to itself.
zIndexcannot fix it. Sigma draws one program per batch, andzIndexonly orderswithin a batch; across programs the order is the key order of
edgeProgramClasses.So a dimmed straight edge is still painted after a highlighted curved one.
The fix is to register each edge program a second time under a later key and move
highlighted edges into that batch. That trick now lives in
graphCanvas.ts, themodule both canvases already share, instead of in either page:
withTopLayer(programs)returns the programs plus a…Topduplicate of each.drawLast(type)is what a reducer assigns when it highlights an edge.Both pages use it. The Graph page's hand-written version (
curved/lineTop/curvedTop, with a ternary in the reducer) is replaced by the shared one — sameprograms, same key order, no behaviour change there.
Checked by hand on a seven-class schema with nine relations: the selected class's
edges stay unbroken where they cross dimmed ones, and the Graph page renders as
before.
🤖 Generated with Claude Code