fix(voyager): refetch Related Entities sub-graph when main graph re-renders#100
Merged
Merged
Conversation
…enders The Related Entities sub-graph (spec 005) was not following display-option changes — toggling Hide Reverse Relationships / brief mode / Better Cluster Display / Show Methods / etc. re-rendered the main ER diagram but left the sub-graph showing the previous config's edges. The Pure FK toggle (PR #99) made the issue most visible because missing edges are obvious, but the bug affected every display toggle since spec 005 introduced the sub-graph. Root cause: `onGenerate` only dispatches to `renderErDiagram` (main graph); it never touches the sub-graph. `fetchRelatedEntities` has a dedup guard (spec 005 FR-011) that returns early when `selectedSchema === schemaName` and the previous dot still exists, so any re-render of the main graph with a new config leaves the sub-graph stuck on stale data. Fix: in `renderErDiagram`, after the main graph renders, if a sub-graph is currently open (`selectedSchema` non-empty and `dot` present), clear `selectedSchema` to defeat the dedup guard and call `fetchRelatedEntities` again with the same schema. This picks up the latest toggle state through `buildErDiagramSubgraphPayload`, which already threads every display option (cluster display / brief / show methods / hide reverse / etc.). Spec 005 FR-011's anti-rapid-click dedup is preserved — the guard still fires when the same entity is clicked twice in quick succession while no config has changed. Manual verification: open ER diagram → double-click an entity with a `back_populates` relationship (e.g. Post↔User) → open Related Entities tab → toggle "Hide Reverse Relationships" → sub-graph now re-renders with ONETOMANY reverse edges hidden, matching the main graph. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
allmonday
added a commit
that referenced
this pull request
Jul 3, 2026
Version bump for PR #100 (Related Entities sub-graph now refetches when the main ER diagram re-renders due to a display-option toggle change). Updates CHANGELOG, pyproject.toml, uv.lock. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.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.
Problem
The Related Entities sub-graph (spec 005) was not following display-option changes. Toggling any of:
…re-rendered the main ER diagram but left the sub-graph showing the previous config's edges. The Pure FK toggle made this most visible (missing edges are obvious), but the bug affected every display toggle since spec 005 introduced the sub-graph.
Root cause
vue-main.js::onGenerateonly dispatches torenderErDiagram(main graph) — it never touches the sub-graph.store.js::fetchRelatedEntitieshas a dedup guard (spec 005 FR-011, anti-rapid-click) that returns early whenselectedSchema === schemaNameand the previousdotstill exists.Fix
In
renderErDiagram, after the main graph renders, if a sub-graph is currently open (selectedSchemanon-empty anddotpresent):selectedSchemato defeat the dedup guard.fetchRelatedEntities(openSubSchema)—buildErDiagramSubgraphPayloadalready threads every display option (cluster display / brief / show methods / hide reverse / etc.) into the request body.The sub-graph re-renders with the new config, matching the main graph.
Spec 005 FR-011's anti-rapid-click dedup is preserved — the guard still fires when the same entity is clicked twice in quick succession while no config has changed.
Test plan
uv run uvicorn demo.enterprise_voyager.voyager_demo:app --port 8010back_populatesrelationship (e.g.Post↔User).Regression risk
Low — single 12-line addition in
renderErDiagram. No data-structure or contract changes. Spec 005 FR-011 dedup still active in the same scenarios as before.🤖 Generated with Claude Code