Skip to content

Fix Global Dock Selection Consistency and Add LocalFirst/GlobalFirst Preset#1051

Merged
wieslawsoltes merged 3 commits intowieslawsoltes:masterfrom
danwalmsley:codex/test-global-dock-fix
Feb 17, 2026
Merged

Fix Global Dock Selection Consistency and Add LocalFirst/GlobalFirst Preset#1051
wieslawsoltes merged 3 commits intowieslawsoltes:masterfrom
danwalmsley:codex/test-global-dock-fix

Conversation

@danwalmsley
Copy link
Copy Markdown
Contributor

Summary
This PR fixes inconsistent global docking behavior where the UI could show global targets as active but the actual drop executed a local operation. It also fixes global target resolution in nested layouts so global drops apply to the intended layout scope (for example, bottom global drop spans all columns instead of docking under a single column).

Problems Fixed

Global-vs-local mismatch during drag/drop:
Moved (preview/adorners) and Released (drop execution) could take different decision paths.
Incorrect global target resolution in nested layouts:
Global drops could resolve to the immediate local owner dock instead of the outer/global layout container.
Behavior compatibility:
Some apps rely on old behavior, so a configurable preset was needed.
What Changed

Unified operation resolution path in DockControlState:
Added a single operation resolver used for both adorner/preview updates and final drop execution.
Cached the resolved decision during drag-over and reused it on release.
This guarantees “what the adorner shows” matches “what drop executes”.
Correct global target resolution in GlobalDockingService:
Added outermost global target resolution for global drops.
In nested proportional layouts, global targets now resolve to the outer/global container.
Added one combined behavior preset in DockSettings:
DockGlobalDockingPreset.LocalFirst
DockGlobalDockingPreset.GlobalFirst
This single preset controls both:
global-vs-local operation priority
global target resolution strategy
Behavior by Preset

LocalFirst (legacy-compatible):
Local operation can override global in mixed cases.
Global target resolves from immediate drop context.
Can produce pane-local outcomes in nested layouts.
GlobalFirst (new behavior):
Global operation wins whenever global is active.
Global target resolves to outermost global target.
Global adorner intent matches drop result.
User-Visible Impact

Removes “global highlighted but local drop executed” surprises.
Makes global drops predictable and consistent in nested multi-column layouts.
Still allows legacy behavior for apps that need it.
Tests

Updated global operation selection tests.
Updated global target resolver tests.
Added nested-layout resolver coverage (outermost target expectation).
Updated window-state global target resolution expectations.
On default setting:

Recommendation

Default to GlobalFirst.
Why

It matches user-visible intent (active global target => global drop outcome).
It fixes the primary UX inconsistency that triggered this work.
It behaves correctly in complex nested layouts.
Compatibility note

If you are concerned about existing consumers depending on legacy behavior, keep LocalFirst as an opt-in fallback (already supported), and clearly call out the default change in release notes.

@wieslawsoltes wieslawsoltes merged commit 9c2ef99 into wieslawsoltes:master Feb 17, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants