Skip to content

Add tooltips and refine clickable schema type affordances#1860

Open
kmcginnes wants to merge 1 commit into
mainfrom
clickable-types-ux-enhancements
Open

Add tooltips and refine clickable schema type affordances#1860
kmcginnes wants to merge 1 commit into
mainfrom
clickable-types-ux-enhancements

Conversation

@kmcginnes

@kmcginnes kmcginnes commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Description

Follow-up polish on the clickable node/edge types in the Schema Explorer details panel (shipped in #1731). Makes the click affordance discoverable and explains what it does:

  • Tooltip on hover or keyboard focus — each clickable type shows "Change selection to {label}" so users know activating it re-selects that type (and highlights it in the graph).
  • Clearer at-rest affordance — clickable types get a hover background tint and color shift; the focus ring now matches the rest of the codebase (ring-ring-3 / outline-hidden).
  • The currently-selected type is intentionally not clickable — it renders as a plain label with no tooltip, since re-selecting it would be a no-op.
  • Accessibility — the decorative arrow separators are now aria-hidden siblings, so each type button's accessible name is just its label (e.g. "knows", not "→ knows →").

Supporting refactor (no behavior change): extracted a shared ClickableTypeText primitive to remove the duplicated button-vs-span branches, and a toSelectedElements helper alongside the existing toSchemaGraphSelection so both selection-mapping directions live together.

How to read

  1. Details.tsx — start here; the ClickableTypeText primitive, tooltip, hover/focus styling, selected-type span, and aria-hidden separators
  2. SchemaGraph.tsx — the extracted toSelectedElements helper next to toSchemaGraphSelection
  3. Details.test.tsx — behavior coverage for the clickable/selected/tooltip/accessible-name cases
  4. toSchemaGraphSelection.test.ts — mapping tests for toSelectedElements

Validation

  • node_modules/.bin/vitest run packages/graph-explorer/src/modules/SchemaGraph — 22 tests pass, including new coverage for the selected-type-not-clickable behavior, the clean accessible name, the focus tooltip, and the toSelectedElements mapping.
  • tsc --noEmit, oxlint, and oxfmt --check clean on the changed files.

Related Issues

Check List

  • I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • I have verified pnpm checks passes with no errors.
  • I have verified pnpm test passes with no failures.
  • I have covered new added functionality with unit tests if necessary.
  • I have updated documentation if necessary.

Explain the click action with a tooltip on hover or keyboard focus, give
edge types a hover underline so they read as interactive, and fix the
edge button accessible name to drop the decorative arrows.

Extract a shared ClickableTypeText primitive and a toSelectedElements
helper alongside toSchemaGraphSelection, and align the focus ring with
the rest of the codebase.
@kmcginnes kmcginnes marked this pull request as ready for review June 22, 2026 23:14
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.

1 participant