Skip to content

Merge master into v8-branch (reconcile popout sash/scrollbar fix + add PR #1478 regression test)#1480

Merged
mathuo merged 4 commits into
v8-branchfrom
claude/pr-1478-v8-branch-rtnb5j
Jul 16, 2026
Merged

Merge master into v8-branch (reconcile popout sash/scrollbar fix + add PR #1478 regression test)#1480
mathuo merged 4 commits into
v8-branchfrom
claude/pr-1478-v8-branch-rtnb5j

Conversation

@mathuo

@mathuo mathuo commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Description

Merges master (which now includes #1478) into v8-branch.

The popout sash/scrollbar drag bug that #1478 fixes was already fixed independently on v8-branch — the drag listeners are bound to the element's owning document (sash.ownerDocument ?? document / this._scrollbar.ownerDocument ?? document) rather than the global document. Because both branches edited the same listener-registration lines but inserted their const doc = … declaration at different line positions, git auto-merged with no conflict yet produced a duplicate const doc declaration in the same scope in both splitview.ts and scrollbar.ts (Cannot redeclare block-scoped variable 'doc') — a clean-looking merge that would not compile.

This PR resolves that: the redundant #1478-side declarations were removed, keeping v8-branch's existing ?? document variant. Net effect on the source files versus v8-branch is zero — they are byte-identical to before. The only new content carried over from master is #1478's regression test.

  • packages/dockview-core/src/splitview/splitview.ts — dropped the duplicate const doc = sash.ownerDocument;; kept const doc = sash.ownerDocument ?? document;.
  • packages/dockview-core/src/scrollbar.ts — dropped the duplicate const doc = this.element.ownerDocument;; kept const doc = this._scrollbar.ownerDocument ?? document;.
  • packages/dockview-core/src/__tests__/splitview/splitview.spec.ts — gains fix(core): sash and scrollbar cannot be dragged inside a popout window #1478's dnd: sash drag follows pointer events in the element's own document test, which builds a Splitview inside a second document (document.implementation.createHTMLDocument()) — the shape a popout window has — and drives a real sash drag. v8-branch previously lacked coverage for this regression.

Type of change

  • Bug fix

Affected packages

  • dockview-core

How to test

  • yarn testsplitview.spec passes (26/26), including the new second-document regression test. Confirmed the two source files are byte-identical to v8-branch (git diff empty), so no behavioural change beyond added test coverage.

Checklist

  • yarn test passes
  • I have added or updated tests where applicable

Generated by Claude Code

lobobeebe and others added 4 commits July 16, 2026 08:54
…s document

Splitview registers a sash's pointerdown on the sash element, but registers the
follow-up pointermove/pointerup/pointercancel/contextmenu listeners on the
global document. An element inside a popout window dispatches its pointer events
into that window's document, so those listeners never fire: the drag arms on
pointerdown and then nothing moves, and the sash cannot be dragged. Scrollbar
repeats the pattern, so the tab-bar overflow scrollbar is affected too.

Floating groups render into the main document, which is why the global document
happens to be correct for them and only popout groups break.

Resolve the owning document from the element instead. It is captured once per
drag into a const closed over by both the add and the matching remove, so a
listener can never be added on one document and removed from another.
Drives a sash drag on a Splitview built inside a second document
(document.implementation.createHTMLDocument), which is the shape a popout window
has: the element lives in that window's document, so its pointer events are
dispatched there.

Fails before the ownerDocument fix — the pointermove never reaches the listener
bound to the global document, so the views never resize.

The existing sash-drag test dispatches on the global document, where
sash.ownerDocument === document, so it passes either way and cannot catch this.
fix(core): sash and scrollbar cannot be dragged inside a popout window
@mathuo
mathuo merged commit ffa5709 into v8-branch Jul 16, 2026
4 checks passed
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants