Repository navigation
Make DockableContent abstract and drop its positional constructor - #1833
Alexandre Zollinger Chohfi (azchohfi) wants to merge 3 commits into
Conversation
Every pane is now a Document or a ToolWindow. The plain-pane positional constructor (kept for Phase 1 source compat, spec 045 5.3.1) is removed, and the base initializer is private protected. Plain panes were role-less in spec 046 routing. As Documents they follow the document rules, which the CHANGELOG lists. Saved layouts with the old "dockableContent" role load as not-closable Documents. Moving the only document out of the only document area into a new split now prunes the emptied area, as the spec 046 6.5 rule says. Relates to #1819 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
An internal abstract Category on DockableContent stops other assemblies from deriving a third pane kind (the record copy constructor is always protected, so the private protected initializer alone didn't). Routing reads the category from it. Programmatic Dock (root and group-targeted) and a cross-window drop after a tear-off now prune a redundant empty document area the same way drag moves do. Side-strip fixture uses a ToolWindow. CHANGELOG and spec trackers updated per review. Relates to #1819 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
📦 Build metricsArtifact sizes for Packages (compressed .nupkg)
Assemblies in Microsoft.UI.Reactor
Assemblies in Microsoft.UI.Reactor.Advanced
Assemblies in Microsoft.UI.Reactor.Devtools
✅ smaller / |
There was a problem hiding this comment.
🟡 Changes recommended
After the sole document in a DocumentArea is closed, docking a document with SplitRight should remove the redundant empty area, but it remains visible beside the newly populated area because pruning is skipped when the pane was not already in the tree.
1 open issue
What changed in this PR
Removes the legacy plain-pane API from Reactor’s docking system, advancing the pre-stable cleanup tracked by #1819.
Changes:
- Makes
DockableContentabstract and requiresDocumentorToolWindowpanes. - Preserves legacy layout loading and adds redundant empty-area pruning after docking moves.
- Migrates samples and tests, adds regression coverage, and refreshes documentation and generated indexes.
| File | Description |
|---|---|
| tests/Reactor.Tests/Docking/RoleAwareRoutingTests.cs | Updates category tests and covers empty-area pruning. |
| tests/Reactor.Tests/Docking/Native/DockTabGroupRendererTests.cs | Migrates renderer tests to typed panes. |
| tests/Reactor.Tests/Docking/Native/DockSplitRendererTests.cs | Uses document leaves. |
| tests/Reactor.Tests/Docking/Native/DockSnapshotBuilderTests.cs | Updates snapshot tests for typed panes. |
| tests/Reactor.Tests/Docking/Native/DockNavigatorTests.cs | Migrates navigation fixtures. |
| tests/Reactor.Tests/Docking/Native/DockLayoutMutatorTests.cs | Tests role-preserving shape leaves. |
| tests/Reactor.Tests/Docking/Native/DockHostKeyboardTests.cs | Migrates keyboard fixtures. |
| tests/Reactor.Tests/Docking/Native/DockFloatingWindowTests.cs | Uses documents in floating-window tests. |
| tests/Reactor.Tests/Docking/Native/DockFloatingCloseReasonTests.cs | Migrates close-reason fixtures. |
| tests/Reactor.Tests/Docking/Native/DockDragSessionTests.cs | Migrates drag-session fixtures. |
| tests/Reactor.Tests/Docking/LifecycleEventTests.cs | Uses documents in event tests. |
| tests/Reactor.Tests/Docking/LayoutStrategyTests.cs | Removes obsolete untyped-pane coverage. |
| tests/Reactor.Tests/Docking/LayoutSerializerTests.cs | Covers legacy-pane migration and round-tripping. |
| tests/Reactor.Tests/Docking/DocumentToolWindowTests.cs | Tests base permissions through documents. |
| tests/Reactor.Tests/Docking/DockMigrationAndSnapshotTests.cs | Limits snapshot roles to documents and tools. |
| tests/Reactor.Tests/Docking/DockLayoutMutatorTests.cs | Migrates shape-resolution tests. |
| tests/Reactor.Tests/Docking/DockHostModelTests.cs | Migrates model fixtures. |
| tests/Reactor.Tests/Docking/DockHostKeyboardTests.cs | Migrates pane automation-ID tests. |
| tests/Reactor.Tests/Docking/DockFloatingWindowRoleTests.cs | Removes obsolete untyped-role coverage. |
| tests/Reactor.Tests/Docking/DockDragDropFilterTests.cs | Removes untyped drop-filter coverage. |
| tests/Reactor.Tests/Docking/DockApiShapeTests.cs | Verifies external derivation restrictions. |
| tests/Reactor.Tests/Devtools/DevtoolsDockingToolsTests.cs | Migrates devtools docking fixtures. |
| tests/Reactor.AppTests.Host/SelfTest/SelfTestFixtureRegistry.cs | Registers pruning regression fixtures. |
| tests/Reactor.AppTests.Host/SelfTest/Fixtures/NativeDockingTearOffFixture.cs | Migrates tear-off panes. |
| tests/Reactor.AppTests.Host/SelfTest/Fixtures/NativeDockingSmokeFixture.cs | Migrates smoke-test panes and side tools. |
| tests/Reactor.AppTests.Host/SelfTest/Fixtures/NativeDockingRtlFixture.cs | Migrates right-to-left layout panes. |
| tests/Reactor.AppTests.Host/SelfTest/Fixtures/NativeDockingDragDropMatrixFixture.cs | Adds programmatic and cross-window pruning checks. |
| tests/Reactor.AppTests.Host/SelfTest/Fixtures/NativeDockingCompositionFixture.cs | Migrates composition and rehydration fixtures. |
| tests/Reactor.AppTests.Host/SelfTest/Fixtures/DockingComplexLayoutSplitterFixtures.cs | Migrates splitter-test documents. |
| tests/Reactor.AppTests.Host/Fixtures/DockingTearOffE2EFixtures.cs | Migrates tear-off input fixtures. |
| tests/Reactor.AppTests.Host/Fixtures/DockingInputE2EFixtures.cs | Migrates docking input panes. |
| src/Reactor.Advanced/Docking/Persistence/DockLayoutSerializer.cs | Loads legacy panes as non-closable documents. |
| src/Reactor.Advanced/Docking/Persistence/DockLayoutJson.cs | Clarifies legacy role handling. |
| src/Reactor.Advanced/Docking/Native/DockSnapshotShape.cs | Emits only document and tool roles. |
| src/Reactor.Advanced/Docking/Native/DockLayoutMutator.cs | Removes untyped routing and prunes after moves. |
| src/Reactor.Advanced/Docking/Native/DockHostNativeComponent.cs | Adds pruning to docking insertion paths. |
| src/Reactor.Advanced/Docking/Native/DockFloatingWindow.cs | Updates the floating-role comment. |
| src/Reactor.Advanced/Docking/Enums.cs | Clarifies role-neutral group documentation. |
| src/Reactor.Advanced/Docking/Document.cs | Implements fixed pane categories. |
| src/Reactor.Advanced/Docking/DockNode.cs | Makes the pane base abstract; removes its positional constructor. |
| src/Reactor.Advanced/Docking/DockHostModel.cs | Updates strategy-dispatch commentary. |
| skills/reactor.api.txt | Removes the retired constructor signature. |
| samples/ReactorGallery/reactor-search-index.json | Refreshes the indexed docking snippet. |
| samples/ReactorGallery/ControlPages/Layout/DockingPage.cs | Migrates gallery panes and sample code. |
| samples/Reactor.TestApp/Demos/DockingDemo.cs | Migrates demo panes to documents. |
| plugins/reactor/skills/reactor-dsl/references/reactor.api.txt | Synchronizes the API index. |
| plugins/reactor/skills/reactor-docking/SKILL.md | Documents the abstract pane base. |
| docs/specs/tasks/046-docking-content-types-implementation.md | Records removal of untyped categories. |
| docs/specs/tasks/045-docking-windows-implementation.md | Records constructor retirement and typed dispatch. |
| docs/specs/046-docking-content-types-and-reserved-area.md | Adds the pane-migration update. |
| docs/specs/045-docking-windows-design.md | Records the pre-stable constructor removal. |
| docs/guide/reference/docking/layout-model.md | Refreshes generated API documentation. |
| docs/guide/docking.md | Updates generated guidance for typed panes. |
| docs/_pipeline/templates/docking.md.dt | Updates the docking guide source. |
| CHANGELOG.md | Documents breaking changes, migration, and pruning fixes. |
Review effort: Balanced
🧪 Merged coverageCoverage for
No coverage change beyond the noise floor. ✅ ✅ higher / |
Prune a redundant empty document area after every programmatic Dock insert, not only when the pane was already docked, so docking a new document as a split beside the reserved well doesn't keep the empty one. Relates to #1819 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🔵 Needs a closer look
This change closes the public pane hierarchy and changes legacy-pane routing, but representative persisted app layouts and native cross-window pruning could not be exercised. These breaking migration behaviors still need maintainer validation.
No open issues 🎉
1 resolved since last review
Review effort: Balanced

Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
a95ef98028186c63ae10b3cb2ea30190e827382e↑ 653 docking unit tests and 585 NativeDocking selftest checks pass locally.
↑ New oracles (outside-assembly compile, legacy layout load, emptied-well prune on drag, programmatic, group-targeted, cross-window and new-pane docks) were each mutation-checked.
↓ The routing change for former plain panes is intended, but no real app layout or saved layout file was exercised beyond the samples and synthetic JSON.
↓ Copilot review flags the breaking migration for maintainer validation.
Summary
DockableContentis now abstract, and the Phase 1 positional constructor is gone, as spec 045 §5.3.1 planned. Every pane is aDocumentor aToolWindow. An internal abstract member keeps other assemblies from deriving a third kind. A record's copy constructor is always protected, so making the initializerprivate protectedwasn't enough on its own.A plain pane had no role in spec 046 routing, so as agreed it maps to
Document. The CHANGELOG lists what that changes: strips refuse it, splits create document areas, document-only floating windows, the Dock(Center) preference, and the strategy hooks. Saved layouts with the old"dockableContent"role still load, as documents that keep the not-closable default.While moving the tests over, one selftest showed that moving the only document out of the only document area into a split left an empty area behind. That already happened for documents and now happens for former plain panes too. Drag moves, programmatic
Dock(root and group) and a drop back after a tear-off now prune it, following the spec 046 §6.5 rule. So does docking a new document as a split beside the empty area.PersistenceStatestays. It's the only state slot aToolWindowhas, soDocument<TState>doesn't fully replace it.Linked issue / spec
Relates to #1819. Spec 045 §5.3.1, spec 046 §6.3 / §6.5.
Test plan
dotnet test tests/Reactor.Tests -p:Platform=x64: 16918 passed, 18 skipped, 1 failed (CompilationLoaderTests.Cold_load_under_500ms…, a timing test that passed when rerun alone).dotnet test tests/Reactor.Tests -p:Platform=x64 --filter-class "*Dock*": 653 passed.dotnet run --project tests/Reactor.AppTests.Host --no-build -c Debug -p:Platform=x64 -- --self-test --filter NativeDocking: 585 ok, 0 failures.DockSplitter,HostCovandSelfTrigReusefilters: 0 failures.dotnet restore Reactor.slnxthendotnet build Reactor.slnx --no-restore -c Release(withNuGetAudit=falsebecause of the local proxy): built except the threesrc/vs-reactorprojects, which couldn't restore from nuget.org on this machine. CI builds them green.reactor.api.txtcopies, the docking reference page, the docking guide and the gallery search index.Risk / breaking changes
Breaking for
Microsoft.UI.Reactor.Advanced. Code usingnew DockableContent(...)or deriving from it won't compile. The migration isnew Document { Title, Content, Key }(addCanClose = falseto keep the old default), withToolWindowfor side-strip panes. Former plain panes now follow the document routing rules. A layout that needs panes to move freely between groups has to keep those groupsGeneral.