Skip to content

Fix default icon for no-type vertices - #1781

Closed
P-r-e-m-i-u-m wants to merge 1 commit into
aws:mainfrom
P-r-e-m-i-u-m:codex/fix-bnode-default-icon
Closed

P-r-e-m-i-u-m wants to merge 1 commit into
aws:mainfrom
P-r-e-m-i-u-m:codex/fix-bnode-default-icon

Conversation

@P-r-e-m-i-u-m

Copy link
Copy Markdown
Contributor

Summary

Fixes #1779.

This updates the graph style preferences so the synthetic No Type vertex type gets the same default vertex styling as schema-backed types. That gives blank nodes without a schema type a generated Cytoscape background image, matching the default icon shown in the details panel.

I also added a regression test for the no-type node style selector.

Verification

  • Focused GraphViewer style test passed
  • Formatter check passed on touched files
  • Oxlint passed on touched files
  • Recursive workspace typecheck passed

I also ran the full Vitest suite locally. The touched GraphViewer test passed, but the full run has unrelated Windows/environment failures: path assertions expecting POSIX separators, missing openssl, shell redirects failing because the workspace path contains spaces, and locale-specific number grouping under en-IN.

@kmcginnes

Copy link
Copy Markdown
Collaborator

@P-r-e-m-i-u-m Hi, sorry I missed this before reviewing and merging PR #1799, which is essentially the same fix.

But I'd love the have the test you've added here. If you can get this rebased on latest I'd be happy to merge this in.

@kmcginnes
kmcginnes self-requested a review July 6, 2026 15:54
hdp01 added a commit to hdp01/graph-explorer that referenced this pull request Sep 21, 2026
…ws#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 aws#1779; ports the coverage asked for on aws#1781 to the current
icon-registry pipeline.
@kmcginnes

Copy link
Copy Markdown
Collaborator

Thanks for this, @P-r-e-m-i-u-m. This and #2202 cover the same fix, so I've combined them in #2695 with your commits included. You'll be credited as a co-author when it merges, and the release notes will link back here. I'll close this one once #2695 merges. There's more detail in our contributing guide.


🤖 Written by an AI agent on my behalf.

kmcginnes added a commit that referenced this pull request Dec 2, 2026
…t icon (#2695)

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:

```diff
 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.

<img width="1280" height="720" alt="verify-chrome-unknown-type"
src="https://github.com/user-attachments/assets/b85d6d62-507f-4a66-b0c8-7fe3318870c8"
/>

## 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

- Closes #1779
- Related to #1679

---

<sub>🤖 Written by an AI agent on my behalf.</sub>

---------

Co-authored-by: 🄂ʏᴇᴅ 🄰ʙᴅᴜʟ 🄰ᴍᴀ🄝 ✧ <amanbaba9404522@gmail.com>
Co-authored-by: hdp01 <154049023+hdp01@users.noreply.github.com>
@kmcginnes

Copy link
Copy Markdown
Collaborator

This fix landed in #2695 with your commits included, so you're credited as a co-author. Thanks again, @P-r-e-m-i-u-m. Closing this one.


🤖 Written by an AI agent on my behalf.

@kmcginnes kmcginnes closed this Dec 2, 2026
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