Skip to content

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

Merged
kmcginnes merged 1 commit into
aws:mainfrom
arnavnagzirkar:fix-1779
Jul 6, 2026
Merged

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

Conversation

@arnavnagzirkar

@arnavnagzirkar arnavnagzirkar commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Description

Blank nodes are assigned the synthetic type LABELS.MISSING_TYPE (the "No Type" label) at runtime in createVertex() when no types are provided. That type is never stored in the schema, so useAllVertexPreferences() in packages/graph-explorer/src/core/StateProvider/userPreferences.ts produced no entry for it and useGraphStyles generated no Cytoscape style selector. As a result blank nodes rendered without an icon on the canvas, while the details panel (which uses useVertexPreferences(type)) still fell back to the default icon.

This change makes useAllVertexPreferences() always include a LABELS.MISSING_TYPE entry (using default preferences) unless the active schema already contains that type. useGraphStyles then emits a node style selector carrying the default icon for blank nodes, so the canvas matches the details panel.

Validation

useGraphStyles builds one node style selector per entry returned by useAllVertexPreferences(). Adding the MISSING_TYPE entry produces the selector that carries the default icon for blank nodes, which was previously missing. A reviewer can confirm by loading a graph that contains a blank node and checking that its canvas icon now matches the icon shown in the details panel.

Related Issues

Fixes #1779

Check List

  • I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • I have verified pnpm checks passes with no errors.
  • I have verified pnpm test passes with no failures.
  • I have covered new added functionality with unit tests if necessary.
  • I have updated documentation if necessary.

Notes

The branch has been rebased onto the latest main to resolve the merge conflict. Since main refactored this file to type-keyed map atoms (#1867), the fix is reapplied on top of that structure with the same behavior. The earlier package.json and pnpm-lock.yaml changes were local toolchain tweaks and have been reverted, so this PR now touches a single file. The pnpm checks and pnpm coverage boxes are left for CI to verify, since the required Node version for a local run is newer than my local toolchain.

AI Assistance Disclosure

I used GitHub Copilot to help prepare this change. I have reviewed and understand it, and I will respond to review feedback.

@kmcginnes kmcginnes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix. Needs a couple small cleanups, but otherwise good.

Comment thread pnpm-lock.yaml

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be reverted

Comment thread package.json

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be reverted

Blank nodes are assigned the synthetic type LABELS.MISSING_TYPE at runtime,
but that type is never stored in the schema. As a result useAllVertexPreferences
emitted no entry for it and useGraphStyles produced no Cytoscape selector, so
blank nodes rendered without an icon on the canvas while the details panel
still showed the default icon.

Always include a LABELS.MISSING_TYPE entry in useAllVertexPreferences so a
node[type="No Type"] selector with the default icon is generated, making canvas
rendering consistent with the details panel.

Fixes aws#1779
@arnavnagzirkar

Copy link
Copy Markdown
Contributor Author

Thanks for the review. I have addressed both points.

  • Reverted package.json. The runtime onFail change was a local-only tweak for an older Node version and should not have been part of this PR.
  • Reverted pnpm-lock.yaml. The lockfile churn came from a local install and now matches main again.

I also rebased the branch onto the latest main to clear the merge conflict, so the PR is now a single focused change to userPreferences.ts. Since main has refactored this file to type-keyed map atoms (#1867), the fix is reapplied on top of that new structure with the same behavior: useAllVertexPreferences always includes a LABELS.MISSING_TYPE entry, which lets useGraphStyles emit a node selector with the default icon for blank nodes.

Ready for another look when you have a chance.

@kmcginnes

Copy link
Copy Markdown
Collaborator

Thanks for the submission! This looks good. I'm excited to have this fixed.

I'll merge it in as soon as the checks pass.

@kmcginnes kmcginnes merged commit 01e8b75 into aws:main Jul 6, 2026
3 checks passed
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

2 participants