Repository navigation
feat(devtools): Handle keyboard shortcuts with TanStack Hotkeys - #582
KevinVandy wants to merge 2 commits into
Conversation
Every keyboard handler in @tanstack/devtools now registers with
@tanstack/solid-hotkeys, bundled with the devtools' own Solid copy.
@tanstack/hotkeys becomes a dependency, so an app that also uses it
shares one hotkey manager. @solid-primitives/keyboard and the
devtools' own key matching are removed.
- openHotkey is a hotkey string ('Control+~'). inspectHotkey takes
modifier names, with Mod in place of CtrlOrMeta. Saved settings in
the old format fall back to the config or the default.
- The settings tab records the open shortcut and rejects one the app
already registered.
- Escape yields to an open dialog or popover of the app. In the modal
host it targets the host dialog, and a close request that reaches
the host closes the panel.
- The trigger's Escape is live only during a drag or throw, so it
doesn't shadow the app's own Escape hotkey.
- Widget keys (resize separators, pane splitters, keyboard tab moves,
the marketplace section header) target their elements.
- The devtools bundle size limit moves from 86 KB to 102 KB.
🦋 Changeset detectedLatest commit: cd7a133 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 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 |
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
View your CI Pipeline Execution ↗ for commit cd7a133
💡 With Ultracache enabled, Nx Cloud learns each task's file inputs in CI and uses them on later runs. Turn on Ultracache in workspace settings ↗ · Read docs ↗ ☁️ Nx Cloud last updated this comment at |
More templates
@tanstack/angular-devtools
@tanstack/devtools
@tanstack/devtools-a11y
@tanstack/devtools-bundler-core
@tanstack/devtools-client
@tanstack/devtools-rspack
@tanstack/devtools-ui
@tanstack/devtools-utils
@tanstack/devtools-vite
@tanstack/devtools-webmcp
@tanstack/devtools-event-bus
@tanstack/devtools-event-client
@tanstack/preact-devtools
@tanstack/react-devtools
@tanstack/solid-devtools
@tanstack/svelte-devtools
@tanstack/vue-devtools
commit: |
The react-vite specs dispatched synthetic keydown events on window, the target @solid-primitives/keyboard listened on. TanStack Hotkeys listens on the document, so press Control+Shift+Backquote, which types ~.
🎯 Changes
Moves every keyboard handler in
@tanstack/devtoolsto TanStack Hotkeys and removes@solid-primitives/keyboardand the devtools' own key matching (utils/hotkey.ts).@tanstack/hotkeysis a dependency, so an app that also uses it shares one hotkey manager with the devtools.@tanstack/solid-hotkeysis bundled with the devtools' own Solid copy (bundleSolidintsup.config.ts).openHotkeyis a hotkey string,'Control+~'by default.inspectHotkeytakes modifier names, withModin place ofCtrlOrMeta. Saved settings and config values in the old format fall back to the config or the default.openAsModal), Escape targets the host dialog. A close request that reaches the host with focus outside it closes the panel, which replaces the capture-phase Escape guard.µ, and it no longer fires in text fields. The tooltip labels come fromformatForDisplay.createHeldKeysplusresolveModifier, active while exactly the configured modifiers are held.createHotkeystargeted at their elements. Escape while moving a tab now cancels the move without also closing the panel.createHotkeyRecorderrecords the open shortcut and rejects one the app already registered (detectConflicts). The inspect keys are toggle buttons with platform labels.tanstack-devtoolsscope. The docs describe how it interacts with the app's global and exclusive scopes.Bundle size
Brotli, from
size-limit. Base ismainat912849c, which has the same code as1ff6734(the one later commit edits a README). The limit moves from 86 KB to 102 KB. Most of the increase is the@tanstack/hotkeyscore, whichsize-limitcounts even though it's an external dependency.packages/devtools/dist/index.jspackages/event-bus-client/dist/esm/plugin.jspackages/devtools-webmcp/dist/esm/register.jspackages/devtools-webmcp/dist/esm/noop.jsNotes
Draft because of two gaps in the Picture-in-Picture window that need fixes in
@tanstack/hotkeys. Element-targeted hotkeys keep listening on the document they were registered in, so the tab-move, splitter and section-header keys stop working after Solid moves those nodes into the PiP document.HotkeyRecorderlistens only on the main window, so recording a shortcut doesn't work inside PiP.✅ Checklist
pnpm test:pr, or these tests do not apply to this pull request.🚀 Release Impact