Skip to content

fix: Blank nodes show no icon on graph canvas but display default icon in ...#1799

Open
arnavnagzirkar wants to merge 1 commit into
aws:mainfrom
arnavnagzirkar:fix-1779
Open

fix: Blank nodes show no icon on graph canvas but display default icon in ...#1799
arnavnagzirkar wants to merge 1 commit into
aws:mainfrom
arnavnagzirkar:fix-1779

Conversation

@arnavnagzirkar
Copy link
Copy Markdown

Summary

Root Cause

useAllVertexPreferences() in packages/graph-explorer/src/core/StateProvider/userPreferences.ts only 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 inside createVertex() 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 to defaultVertexPreferences.iconUrl regardless of schema presence — hence the icon appeared there but not on the canvas.

Change Made

File: packages/graph-explorer/src/core/StateProvider/userPreferences.ts

  • Added LABELS to the import from @/utils.
  • Modified useAllVertexPreferences() to always append a LABELS.MISSING_TYPE entry (with default preferences) to the returned array, unless the schema already contains that type. This causes useGraphStylesuseBackgroundImageMap to generate a Cytoscape style selector for node[type="«No Type»"] with the default icon, making blank node rendering consistent with the details panel.

Issue

Fixes #1779

Issue URL: #1779

Changes

AGENTS.md                                          | 106 +--
 package.json                                       |   2 +-
 .../src/core/StateProvider/userPreferences.ts      |  16 +-
 pnpm-lock.yaml                                     | 881 ++++++---------------
 4 files changed, 279 insertions(+), 726 deletions(-)

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Blank nodes show no icon on graph canvas but display default icon in details panel

1 participant