Skip to content

Port fix from vitejs/devtools#521: observe dock sidebar size in the popup's own realm #207

Description

@antfubot

Context

vitejs/devtools#521 ("fix(core): observe dock sidebar size in the popup's own realm") by @SaKaNa-Y fixed a bug in popup dock mode: resizing the popup window didn't update the dock sidebar group rail (collapsing into the overflow "more" icon, or restoring hidden icons) until the mouse moved into the host page. It touched packages/core/src/client/webcomponents/components/dock/DockGroupSidebar.vue in vitejs/devtools, which moved here as part of the v0.9 migration — the equivalent file today is packages/hub-ui/src/client/components/dock/DockGroupSidebar.vue.

Original PR description

In popup dock mode, resizing the popup window does not update the dock sidebar group rail immediately.

When shrinking the popup window, the group rail does not collapse into the overflow ("more") icon as expected. when enlarging the popup window, the hidden icons do not restore immediately. the state is only updated after moving the mouse into the host page.

Diff: https://github.com/vitejs/devtools/pull/521/files

For agents picking this up

  • Read the diff at fix(core): observe dock sidebar size in the popup's own realm vitejs/devtools#521 to see exactly how it fixed the resize observation (almost certainly a ResizeObserver/window-size listener bound to the wrong document/window when the sidebar renders inside a popup's own realm rather than the host page's).
  • Locate packages/hub-ui/src/client/components/dock/DockGroupSidebar.vue here and re-implement the same fix, adapting to whatever has shifted since the fork (e.g. popup mode plumbing, shadow-root/realm boundaries).
  • Credit @SaKaNa-Y as the original author: include a Co-authored-by: SaKaNa-Y <...> trailer (look up their GitHub noreply email, or omit if unavailable) and mention them in the PR description.
  • Link back to fix(core): observe dock sidebar size in the popup's own realm vitejs/devtools#521 in the PR description.
  • Close this issue when the port merges.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions