Fix Global Dock Selection Consistency and Add LocalFirst/GlobalFirst Preset#1051
Merged
wieslawsoltes merged 3 commits intowieslawsoltes:masterfrom Feb 17, 2026
Merged
Conversation
This was referenced Feb 23, 2026
Closed
This was referenced Mar 2, 2026
Closed
This was referenced Mar 9, 2026
This was referenced Mar 11, 2026
Closed
This was referenced Mar 23, 2026
This was referenced Apr 13, 2026
This was referenced Apr 20, 2026
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.
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.