v6: Open schema search with Cmd+K and remove the dead top-bar button#4402
Draft
trevor-scheer wants to merge 5 commits into
Draft
v6: Open schema search with Cmd+K and remove the dead top-bar button#4402trevor-scheer wants to merge 5 commits into
trevor-scheer wants to merge 5 commits into
Conversation
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 detectedLatest commit: c5fe909 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
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.
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
Schema search was unreachable. The top-bar "Jump to schema" button had no
onClick, and the real shortcut (⌘⌥K) clicked a.graphiql-sidebarbutton 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 throughsetVisiblePlugininstead of clicking a DOM node, and it takes priority over monaco-editor's ownCmd+Kbinding, so it works whether or not an editor pane has focus. The shortcuts help dialog and key map are updated to match.Test plan
⌘K(orCtrl+K) with no editor focused. The doc explorer opens and the search input is focused.⌘K. The doc explorer still opens and search is focused; Monaco should not swallow the shortcut.?or the help entry) and confirm "Search in documentation" lists⌘Kwith no Alt/Option.Refs: #4219