Repository navigation
Conversation
…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.
Collaborator
|
Thanks for this, @hdp01. This and #1781 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>
Collaborator
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
Ports the regression coverage requested on #1781 (and #1779) to the current icon-registry pipeline: asserts
useGraphStylesemits anode[type="«No Type»"]entry with the default icon for vertices without a schema type — the same fallback the details panel uses.While scoping I verified the described root cause no longer matches the code:
useAllVertexStylesalways appends aLABELS.MISSING_TYPEentry anduseBackgroundImageMapresolves the default icon through the registry (probed green). So this PR is test-only; no behavior change. If maintainers would rather close #1779 as fixed-by-refactor, this test still locks the behavior in.Type of change
Validation
useGraphStyles.test.tsxfile green (16/16).oxlint+oxfmt --checkclean on the touched file.<svg>root during sanitize, so svg icon resolution can never complete there; jsdom matches browser behavior (same env asuseBackgroundImageMap.test.ts).