fix: Blank nodes show no icon on graph canvas but display default icon in ...#1799
Open
arnavnagzirkar wants to merge 1 commit into
Open
fix: Blank nodes show no icon on graph canvas but display default icon in ...#1799arnavnagzirkar wants to merge 1 commit into
arnavnagzirkar wants to merge 1 commit into
Conversation
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.
Summary
Root Cause
useAllVertexPreferences()inpackages/graph-explorer/src/core/StateProvider/userPreferences.tsonly generated style entries for vertex types present in the active schema. Blank nodes get the synthetic type«No Type»(LABELS.MISSING_TYPE) assigned at runtime insidecreateVertex()when no types are provided. This type is never stored in the schema, so no Cytoscape style selector was generated for it, leaving blank nodes on the canvas without an icon or styling.The details panel took a different path (
useVertexPreferences(type)) which always falls back todefaultVertexPreferences.iconUrlregardless of schema presence — hence the icon appeared there but not on the canvas.Change Made
File:
packages/graph-explorer/src/core/StateProvider/userPreferences.tsLABELSto the import from@/utils.useAllVertexPreferences()to always append aLABELS.MISSING_TYPEentry (with default preferences) to the returned array, unless the schema already contains that type. This causesuseGraphStyles→useBackgroundImageMapto generate a Cytoscape style selector fornode[type="«No Type»"]with the default icon, making blank node rendering consistent with the details panel.Issue
Fixes #1779
Issue URL: #1779
Changes
Testing
Agent ran relevant tests during development
Linting checks passed
Changes are minimal and focused on the issue
AI Assistance Disclosure
This pull request was prepared with the assistance of AI coding tools (GitHub Copilot). The change has been read, understood, and is owned by the human contributor submitting it, who will respond to review feedback.