Skip to content

Draw types missing from the schema with their stored style and default icon - #2695

Merged
kmcginnes merged 3 commits into
mainfrom
default-icon-unknown-vertex-types
Dec 2, 2026
Merged

kmcginnes merged 3 commits into
mainfrom
default-icon-unknown-vertex-types

Conversation

@kmcginnes

@kmcginnes kmcginnes commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

Based on #1781 by @P-r-e-m-i-u-m and #2202 by @hdp01.

Summary

The Graph View canvas drew any node or edge whose type wasn't in the synced schema with the app defaults and no icon, while the details panel showed that type's saved style and the default icon.

User-facing: Nodes and edges whose type isn't in the schema now look the same on the canvas as in the details panel: your saved style, and the default icon for nodes. Blank nodes keep the default icon and style.

The canvas style cache now resolves every drawn type through the same style atoms the details panel reads, so the schema gate and its subscription go away:

 vertexValues(node)
-  if type is «No Type» or in the schema
-    style = vertexStyleByTypeAtom(type)
-  else
-    draw app defaults, background-image: none
+  style = vertexStyleByTypeAtom(type)
 subscribe
   userVertexStylesAtom, userEdgeStylesAtom
-  activeSchemaAtom
   iconRegistry

Evidence

Before: draws a type missing from the schema without an icon pinned background-image: none.

After: these tests fail on main and pass here:

  • draws a type missing from the schema with the default icon
  • styles a vertex type missing from the schema with its stored style
  • styles an edge type missing from the schema with its stored style

Both contributors' blank-node tests run under jsdom in useGraphStyles.icons.test.tsx.

Verified live: agent-tested in Chrome and Safari against a local Gremlin Server. A robot node styled as a red star and a builds edge styled green at 5px kept those styles and the node's default icon after the schema refresh dropped both types.

verify-chrome-unknown-type

Merge Danger

Door: two-way. No stored data changes, so reverting brings back the old look.

Impact: canvas styling. See Upgrade Notes.

Upgrade Notes

  • Saved node and edge styles now apply on the canvas to types that aren't in the synced schema. Those types used to draw with the default look. They now match the details panel. You don't need to do anything. If a style you saved earlier now shows up where you didn't expect it, reset or edit it in the type's Customize dialog.

Related


🤖 Written by an AI agent on my behalf.

P-r-e-m-i-u-m and others added 3 commits December 1, 2026 18:15
…1779)

Blank nodes carry the synthetic LABELS.MISSING_TYPE, which never appears
in the schema. Asserts useGraphStyles still emits a node[type=...] entry
for it with the default icon, matching the details-panel fallback.

Runs under jsdom: happy-dom's DOMParser/DOMPurify interop drops the svg
root during sanitize, so svg icon resolution can never complete there.

Relates to #1779; ports the coverage asked for on #1781 to the current
icon-registry pipeline.

@kmcginnes kmcginnes left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Approved

@kmcginnes
kmcginnes merged commit 3ae823e into main Dec 2, 2026
4 checks passed
@kmcginnes
kmcginnes deleted the default-icon-unknown-vertex-types branch December 2, 2026 01:10
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

3 participants