Repository navigation
fix(devtools): delegate the full Solid DelegatedEvents set on the PiP window - #38
Open
detail-app[bot] wants to merge 1 commit into
Conversation
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.
Detail bug report: View on Detail
🎯 Changes
In picture-in-picture (detached) mode the entire Solid devtools tree is portaled into the popup window's own document. Solid's delegated events (e.g.
onDblClick,onClick) don't attach per-node listeners — the runtime stores handlers on the element (el.$$<event>) and fires them through a single document-level listener installed bydelegateEvents()on the document the event targets.requestPipWindow()inpackages/devtools/src/context/pip-context.tsxregistered a hand-picked list of only 9 delegated events on the popup document, so any delegated handler rendered into the detached window for an event outside that list was dead.dblclickwas missing, so the splitter's double-click-to-reset (PR TanStack#515) silently did nothing in the PiP window while working fine in the inline panel — and the stale list was a latent trap for any future delegated handler.Fix: register the full Solid
DelegatedEventsset on the popup document, mirroring what Solid's runtime does on the main document by default:This is future-proof: any delegated event rendered in the popup now works without having to extend a separate, mode-specific list.
✅ Checklist
pnpm test:pr, or these tests do not apply to this pull request.🚀 Release Impact
Testing
Added two unit tests in
packages/devtools/src/context/pip-context.test.tsx(mock the popupwindow.opensince jsdom blocks it, then driverequestPipWindow()):DelegatedEventsset (guards against regressing to a hand-picked list)dblclickhandler attached to a node in the popup document actually fires when dispatchedAdded two Playwright E2E tests in
e2e/apps/react-vite/tests/pip-delegated-events.spec.tsthat open a realwindow.openpopup (the unit tests can't, since jsdom blocks popups):dblclick,beforeinput,contextmenu,keyup,mousemove,mouseup,touchstart)Regression sanity-checked: reverting the source fix and rebuilding the devtools dist makes the delegation tests fail with the exact bug symptom (the popup document receives only the old 9-event list, and the PiP double-click leaves the panes unequal); re-applying the fix turns them green again.
Routine checks all pass: typecheck (
tsc --noEmit), lint, the full@tanstack/devtoolsunit suite (376 tests), the package build (tsup) andpublint, the bundle-size budget (dist/index.js= 65.68 kB ≤ 66 kB), the full repo gatepnpm test:pr(nx-affected eslint/sherif/knip/lib/types/build/build), and the full react-vite Playwright suite (34 tests, 2 pre-existingtest.fixmeskipped).Automatic Fixes PRs can be configured here.