fix: deduplicate bidirectional relation arrows#52
Conversation
When two components have relations in both directions (A→B and B→A), both were rendered as separate arrows, creating visually duplicate connections. Added pair-level deduplication using a canonical key so only one arrow is drawn per component pair. Bumps version to 3.10.1. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 52919801c6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| String pair = pairKey(currCmpRel.originalComponent().uniqueName(), | ||
| currCmpRel.targetComponent().uniqueName()); | ||
| if (!renderedPairs.add(pair)) { | ||
| continue; |
There was a problem hiding this comment.
Preserve deterministic direction before deduplicating pairs
This pair-level early continue makes the rendered edge depend on whichever direction is visited first, but both loops iterate Set/HashSet (diagramCmps and significantRels) with no stable order. In genCode, the selected direction affects diff styling because middle-arrow color is chosen from one of the two directional relations (currCmpRel vs reverseRel), so for equal-strength bidirectional links (common for ASSOCIATION/WEAK_ASSOCIATION) the surviving arrow can be colored from the unchanged side and hide an added/deleted change, and output can vary across runs.
Useful? React with 👍 / 👎.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…#53) Address code review feedback on #52: the pair dedup could render arrows in non-deterministic direction (HashSet iteration order varies) and pick the wrong diff color when the reverse direction had the change. Now prefers the direction with diff coloring (added/deleted) for accurate change visualization, and falls back to canonical (alphabetical) ordering for deterministic output across runs. Bumps version to 3.10.2. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Summary
Test plan
🤖 Generated with Claude Code