Skip to content

Restore floating fallback for incompatible dock groups#1072

Merged
wieslawsoltes merged 2 commits intowieslawsoltes:masterfrom
danwalmsley:codex/fixes/dock-group-float-fallback
Mar 12, 2026
Merged

Restore floating fallback for incompatible dock groups#1072
wieslawsoltes merged 2 commits intowieslawsoltes:masterfrom
danwalmsley:codex/fixes/dock-group-float-fallback

Conversation

@danwalmsley
Copy link
Copy Markdown
Contributor

Summary

  • restore float fallback when a dragged dockable is released over a dock target with a different DockGroup
  • return execution status from drag release paths so invalid local drops do not suppress floating
  • add a headless regression test covering mismatched DockGroup release behavior

Testing

  • dotnet test tests/Dock.Avalonia.HeadlessTests/Dock.Avalonia.HeadlessTests.csproj --filter Process_Released_Floats_WhenResolvedDropTargetHasDifferentDockGroup -nologo
  • dotnet test tests/Dock.Avalonia.HeadlessTests/Dock.Avalonia.HeadlessTests.csproj -nologo
  • dotnet build src/Dock.Avalonia/Dock.Avalonia.csproj -nologo

@wieslawsoltes
Copy link
Copy Markdown
Owner

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4d67eaf5d7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +110 to +119
if (!executed
&& _context.DragDockable is { } dockable
&& DockCapabilityResolver.IsEnabled(
dockable,
DockCapability.Float,
DockCapabilityResolver.ResolveOperationDock(dockable))
&& _hostWindow.Window?.Factory is { } factory)
{
dockable.SetPointerScreenPosition(screenPoint.X, screenPoint.Y);
factory.FloatDockable(dockable);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid floating managed docs on failed drag drops

When a managed host-window drag ends without a valid dock target (executed remains false), this new fallback calls factory.FloatDockable(dockable) on _context.DragDockable, which is resolved as a ManagedDockWindowDocument. In this codebase, FactoryBase.FloatDockable removes the dockable and depends on CreateWindowFrom to recreate it, but CreateWindowFrom has no ManagedDockWindowDocument case (see src/Dock.Model/FactoryBase.cs switch around lines 632-748), so the dockable can be removed from ManagedWindowDock and disappear after an invalid drop instead of simply staying where it was dragged.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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