feat: manage persistent iframes/panels with iframe-pane#394
Merged
Conversation
Replace the hand-rolled PersistedDomViewsManager with antfu/iframe-pane (v1.1.0), which was extracted from these very patterns. iframe docks use iframe panes and custom-render docks use tagName:'div' panes, both parked in the dock shell's overlay container via a shared useIframePanes composable. This brings ResizeObserver + rAF-batched scroll/resize box syncing, warm opacity-hiding (instead of display:none) so hidden panes keep their state, and manager-level lockPointerEvents() during dock drag/resize.
commit: |
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.
Description
Replaces the hand-rolled
PersistedDomViewsManagerclient-side engine withiframe-pane(v1.1.0) — the library Anthony Fu extracted from the iframe-management patterns of Vite DevTools, Nuxt DevTools and devframe. This is dogfooding the extracted package back into its origin.What changed
iframe-paneas a bundled client dependency (catalogfrontend,inlinedDependencies, and tsdowndeps.onlyBundle).useIframePanes(container, panel)composable owns onecreateIframePanes({ container })manager per dock shell (DockPanel/DockEdge/DockStandalone), created lazily once the overlay container exists and disposed with the shell.ViewIframenow uses iframe panes;ViewCustomRendererusestagName: 'div'panes — socustom-renderdocks keep out-of-tree DOM persistence.panes.lockPointerEvents()(driven bypanel.isDragging/isResizing), replacing the per-elementpointer-eventswatchEffect.PersistedDomViewsManagerand its@vitejs/devtools/client/webcomponentsexport.Behavioral upgrades inherited from iframe-pane
ResizeObserver+ rAF-batched windowscroll/resize, instead of a lonewindow.resizelistener plus manual deep-watchupdate()calls.iframe-panealso positions panes precisely over their mount target, so the address-barmargin-topoffset hack is gone.opacity: 0.001+pointer-events: none) instead ofdisplay: none, so hidden panes keep rendering and preserve their state.The
domElements.iframe/domElements.panelregistration, thedom:iframe:mounted/dom:panel:mountedevents, the context-menu iframe refresh, and the address-barsrc-persistence all behave as before.Linked Issues
Depends on antfu/iframe-pane#2 (released as
iframe-pane@1.1.0, which added generictagName/elementsupport so non-iframecustom-renderpanels can be managed too).Additional context
pnpm build,pnpm typecheck,pnpm lint, andpnpm test(190 tests) all pass. Reviewers may want to focus on theDockStandalonecontainer (now set toposition: relativeby iframe-pane) and the removal of the address-bar margin offset inViewIframe.This PR was created with the help of an agent.