Skip to content

v6: Open schema search with Cmd+K and remove the dead top-bar button#4402

Draft
trevor-scheer wants to merge 5 commits into
graphiql-6from
trevor/schema-search-cmdk
Draft

v6: Open schema search with Cmd+K and remove the dead top-bar button#4402
trevor-scheer wants to merge 5 commits into
graphiql-6from
trevor/schema-search-cmdk

Conversation

@trevor-scheer

Copy link
Copy Markdown
Contributor

Summary

Schema search was unreachable. The top-bar "Jump to schema" button had no onClick, and the real shortcut (⌘⌥K) clicked a .graphiql-sidebar button selector that stopped existing once v6 renamed that container to .graphiql-activity-rail.

The dead button is gone, and schema search is rebound to plain ⌘K / Ctrl+K. The handler opens the doc explorer through setVisiblePlugin instead of clicking a DOM node, and it takes priority over monaco-editor's own Cmd+K binding, so it works whether or not an editor pane has focus. The shortcuts help dialog and key map are updated to match.

Test plan

  • Press ⌘K (or Ctrl+K) with no editor focused. The doc explorer opens and the search input is focused.
  • Click into the query editor, then press ⌘K. The doc explorer still opens and search is focused; Monaco should not swallow the shortcut.
  • Confirm the old "Jump to schema" button in the top bar is gone.
  • Open the shortcuts help dialog (? or the help entry) and confirm "Search in documentation" lists ⌘K with no Alt/Option.

Refs: #4219

Adds a failing test for the plain ⌘K/Ctrl+K doc-explorer shortcut.
The current handler requires Alt and pokes a stale .graphiql-sidebar
selector, so it never fires.
The old `⌘⌥K` handler poked `.graphiql-sidebar button[aria-label=...]`,
a selector that stopped matching once v6 renamed that container to
`.graphiql-activity-rail`. Rebind to plain `⌘K`/`Ctrl+K`, drive the
doc-explorer through `setVisiblePlugin` instead of a DOM click, and
take priority over monaco-editor's own `Cmd+K` binding via a
capture-phase listener + `preventDefault`.

Also removes the top-bar 'Jump to schema' button, which never had an
`onClick` and did nothing.
@changeset-bot

changeset-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c5fe909

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
@graphiql/react Patch
@graphiql/plugin-doc-explorer Patch
graphiql Patch
@graphiql/plugin-code-exporter Patch
@graphiql/plugin-collections Patch
@graphiql/plugin-explorer Patch
@graphiql/plugin-history Patch
@graphiql/plugin-query-builder Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

`⌘K` (and any direct `setVisiblePlugin` call) marked the doc-explorer
plugin active but left the pane collapsed: `visiblePlugin` and the
`useDragResize` hidden state were only synced at the rail button and
reference-click call sites. Add an effect in GraphiQL so the pane is
revealed whenever a plugin becomes visible while collapsed.
The reference-click provider already calls `setVisiblePlugin(referencePlugin)`,
so the effect added in the previous commit reveals the pane on that path too.
The dedicated `onClickReference` un-hide handler and its `QueryEditor` prop are
now redundant.
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