Skip to content

Docking window state transitions#1033

Merged
wieslawsoltes merged 5 commits intomasterfrom
feature/docking-window-state-transitions
Feb 9, 2026
Merged

Docking window state transitions#1033
wieslawsoltes merged 5 commits intomasterfrom
feature/docking-window-state-transitions

Conversation

@wieslawsoltes
Copy link
Owner

PR Summary: DockingWindowState end-to-end implementation

Branch

feature/docking-window-state-transitions

Objective

Implement full logical docking state tracking with explicit flags across model layers, transitions, serialization, samples, and documentation.

This introduces a single, consistent state contract for dockables and ensures state transitions are deterministic for:

  • regular docked tools/documents
  • pinned tools
  • document-hosted dockables
  • floating windows
  • hidden dockables
  • hidden container propagation to descendants

High-level changes

1) New core state contract

  • Added DockingWindowState flags enum:
    • None
    • Docked
    • Pinned
    • Document
    • Floating
    • Hidden
  • Added IDockable.DockingState to the public core interface.

2) Implemented state backing across all model flavors

DockingState was added to all IDockable base implementations so behavior is consistent regardless of MVVM flavor:

  • Dock.Model.Mvvm
  • Dock.Model.ReactiveUI
  • Dock.Model.Inpc
  • Dock.Model.Prism
  • Dock.Model.ReactiveProperty
  • Dock.Model.CaliburMicro
  • Avalonia model base (Dock.Model.Avalonia) and managed control base (Dock.Avalonia)

All implementations default to DockingWindowState.Docked.

3) Centralized state resolution in factory

Added new partial file:

  • src/Dock.Model/FactoryBase.DockingState.cs

This encapsulates state calculation and propagation:

  • UpdateDockingWindowState(...)
  • UpdateDockingWindowStateRecursive(...)
  • ResolveDockingWindowState(...)

Resolution behavior:

  • Primary location state is one of Pinned, Document, Docked
  • Floating is OR-ed when dockable belongs to floating layout (owner chain / original owner context)
  • Hidden is OR-ed when dockable itself is hidden or any ancestor in owner chain is hidden

4) Transition correctness fixes

Factory operations now update state at transition points:

  • Init path (InitDockable)
  • Pin/Unpin transitions
  • Hide/Restore transitions (recursive updates)

Important behavioral fix:

  • If a container dock is hidden (for example, a document dock), descendants now also include Hidden in DockingState.

5) Serialization support

Extended Avalonia serializer whitelist to include DockingState across dockable types, so persisted layouts retain logical docking state metadata.

6) Samples

Added state test UI in both samples:

  • DockMvvmSample
  • DockReactiveUISample

Each DockableOptionsView now includes a ComboBox for DockingState combinations to allow interactive validation.

7) Documentation (DocFX)

Updated docs to describe new enum and model behavior:

  • dockable property reference now includes DockingState
  • enums reference includes DockingWindowState
  • serialization/state docs explicitly describe persisted docking state
  • restore behavior docs now include state recomputation semantics

Transition semantics (expected)

Scenario Resulting DockingState
Tool in normal tool dock Docked
Tool pinned Pinned
Dockable hosted in document dock Document
Any of above in floating root `...
Hidden dockable `...
Hidden container with descendants descendants get `...
Hidden + floating document area `Document

Commits (granular)

  1. d0c5f5533 feat(model): add docking window state flags and runtime tracking

    • core enum/interface
    • factory state resolver + transition hooks
    • model implementation wiring
    • Avalonia serializer support
  2. f6677c7de test: add docking state transition and serialization coverage

    • transition tests across framework-specific suites
    • hidden-container propagation tests
    • serializer roundtrip coverage
    • interface test fixture updates
  3. b9cb8a4f1 test(leaks): cover docking state transition paths

    • leak tests for new hide/restore and transition flows (MVVM + ReactiveUI)
  4. 5d72d447d feat(samples): expose docking state combinations in options views

    • sample combo-boxes for manual state verification
  5. e88d18d30 docs(docfx): document docking window state semantics

    • docfx updates for enum/property/restore/serialization behavior

Test coverage summary

New and updated tests cover:

  • Core transitions (Docked, Pinned, Document)
  • Floating combinations
  • Hidden combinations
  • Hidden container propagation to descendants
  • Serializer include/deserialize of DockingState
  • Leak checks for transition sequences

Validated suites (Release):

  • Dock.Model.Mvvm.UnitTests
  • Dock.Model.ReactiveUI.UnitTests
  • Dock.Model.Prism.UnitTests
  • Dock.Model.ReactiveProperty.UnitTests
  • Dock.Model.CaliburMicro.UnitTests
  • Dock.Model.Avalonia.UnitTests
  • Dock.Model.UnitTests
  • Dock.Avalonia.HeadlessTests
  • Dock.Model.Mvvm.LeakTests
  • Dock.Model.ReactiveUI.LeakTests

Also validated multi-target build for Dock.Model (netstandard2.0, net6.0, net8.0, net10.0).

Compatibility notes

  • Public interface change: IDockable now requires DockingState.
  • Existing implementations in this repo were updated accordingly.
  • Consumers implementing IDockable externally must add the new property.

Risks / follow-up

  • DocFX pipeline still reports pre-existing ReactiveUI SourceGenerator issues in documentation build context; this is unrelated to this feature implementation.

@wieslawsoltes wieslawsoltes merged commit e195696 into master Feb 9, 2026
5 checks passed
@wieslawsoltes wieslawsoltes deleted the feature/docking-window-state-transitions branch February 9, 2026 22:45
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.

1 participant