Add Schema-view vertex type hiding#1931
Open
danielvanza wants to merge 3 commits into
Open
Conversation
createVertex() used to take types[0] as the primary type driving styling and naming. Gremlin/TinkerPop's default base label, "vertex", commonly appears first alongside a more specific label (e.g. ["vertex", "sqsqueue"]), which meant multi-labeled nodes were styled and named after the meaningless generic label instead of their specific one. Skip the generic label (case-insensitively) when a more specific label is present, falling back to it only when it's the sole label.
The Schema view rendered every discovered vertex type with no way to exclude noisy ones, e.g. a database's own generic base label showing up as a node type on every schema graph. Add a per-connection hidden-types store (mirroring the existing schema atom) and an eye toggle on each row of the Styles panel's Nodes tab when opened from the Schema view; hiding a type also drops its schema-graph edges since they lose an endpoint. Hidden types stay listed, dimmed, so they can be restored, and the hidden set is scoped to the Schema view only — the main Graph view, canvas filtering, and discovery are untouched. The Styles panel is now shared between the Graph and Schema views, so the toggle is gated behind a showVertexVisibilityToggle prop passed only from the Schema view's sidebar.
VertexStyleRow is also rendered by the main Graph view's Styles panel, so a showVisibilityToggle prop and an unconditional useHiddenSchemaTypes() subscription inside it coupled the shared row to a Schema-view-only feature. Wrap it from the outside instead (SchemaVertexStyleRow in VertexStyles.tsx), leaving VertexStyleRow itself untouched. Also tighten two new tests to assert full expected values with toStrictEqual instead of toContain/toEqual, per docs/agents/testing.md.
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
Vertexlabel) showing up as a node type on every schema graph.hiddenSchemaTypesAtom+useHiddenSchemaTypes()), mirroring the existing schema-atom pattern, and an eye toggle on each row of the Styles panel's Nodes tab when opened from the Schema view.createVertex()used to take the first label in a multi-labeled vertex's type list as its primary (styling/display) type. Gremlin/TinkerPop's default base label,vertex, commonly appears first alongside a more specific label (e.g.["vertex", "sqsqueue"]), which meant such nodes were styled and named after the meaningless generic label instead of their specific one. This makes hiding the generic type from the Schema view more useful, since the same generic label no longer clobbers a node's display name/style on the main canvas.Test plan
pnpm checks(types, lint, format)pnpm test— all green except one pre-existing, unrelated flaky test onmain(safeSessionStorage.test.ts, confirmed failing on a clean checkout ofmainas well)