Repository navigation
Add Schema-view vertex type hiding - #1931
danielvanza wants to merge 4 commits into
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.
|
Hi @danielvanza, thanks for this one as well. Hiding a database's generic base label from the Schema view solves a real annoyance, and I like that you kept the hidden set scoped to the Schema view instead of letting it leak into the Graph view. Same caveat as on #1930: getting back around to community PRs is slow going right now, so this may sit a while. |
|
Updated in 87677b3: merged current main and resolved the merge conflict, keeping schema-only visibility toggles while adapting hidden-type storage and tests to the renamed connection APIs. |
Summary
vertexlabel when choosing the primary vertex type, so the generic label does not override display names and styling.b864b5d2), resolve the style-row conflict, and adapt hidden-type storage and tests to the renamed connection APIs. Existing persisted map keys retain their shape.Test plan
pnpm checks(types, lint, format) passes on the updated branch.LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 pnpm testpasses: 253 files, 3,354 tests. The explicit locale makes the host match the test suite's expected en-US number formatting.Earlier manual verification before this update covered toggling a type off and back on, removing/restoring its schema connections, and persisting hidden state per connection across reloads. Manual UI verification was not rerun during this merge update.