Skip to content

Make DockableContent abstract and drop its positional constructor - #1833

Open
Alexandre Zollinger Chohfi (azchohfi) wants to merge 3 commits into
mainfrom
azchohfi-make-dockablecontent-abstract
Open

Alexandre Zollinger Chohfi (azchohfi) wants to merge 3 commits into
mainfrom
azchohfi-make-dockablecontent-abstract

Conversation

@azchohfi

@azchohfi Alexandre Zollinger Chohfi (azchohfi) commented Dec 4, 2026 •

Copy link
Copy Markdown
Collaborator

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: a95ef98028186c63ae10b3cb2ea30190e827382e

Dimension Assessment Rationale
Change confidence 8.5/10 ↑ All 53 CI checks on this head pass (unit, selftest, packaged, build, analyze).
↑ 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

DockableContent is now abstract, and the Phase 1 positional constructor is gone, as spec 045 §5.3.1 planned. Every pane is a Document or a ToolWindow. An internal abstract member keeps other assemblies from deriving a third kind. A record's copy constructor is always protected, so making the initializer private protected wasn'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.

PersistenceState stays. It's the only state slot a ToolWindow has, so Document<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, HostCov and SelfTrigReuse filters: 0 failures.
  • dotnet restore Reactor.slnx then dotnet build Reactor.slnx --no-restore -c Release (with NuGetAudit=false because of the local proxy): built except the three src/vs-reactor projects, which couldn't restore from nuget.org on this machine. CI builds them green.
  • Mutation-checked the new tests: the outside-assembly compile check, the post-insert prune in the mutator, and the programmatic, group-targeted, cross-window and new-pane prune selftests (M21–M24) each fail without their fix.
  • Regenerated both reactor.api.txt copies, the docking reference page, the docking guide and the gallery search index.

Risk / breaking changes

Breaking for Microsoft.UI.Reactor.Advanced. Code using new DockableContent(...) or deriving from it won't compile. The migration is new Document { Title, Content, Key } (add CanClose = false to keep the old default), with ToolWindow for 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 groups General.

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>
@github-actions

github-actions Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

📦 Build metrics

Artifact sizes for a95ef98 vs the base branch (7020f0c).

Packages (compressed .nupkg)

Artifact base PR Δ
Microsoft.UI.Reactor.nupkg 2.19 MB 2.19 MB -54 B (0.00%) ≈
Microsoft.UI.Reactor.Advanced.nupkg 531.4 KB 531.0 KB -380 B (-0.07%) ✅
Microsoft.UI.Reactor.Devtools.nupkg 290.6 KB 290.6 KB +3 B (0.00%) ≈

Assemblies in Microsoft.UI.Reactor

Artifact base PR Δ
Microsoft.UI.Reactor.dll 2.93 MB 2.93 MB +0 B (0.00%) ≈
Reactor.Analyzers.dll 469.5 KB 469.5 KB +0 B (0.00%) ≈
Reactor.Localization.Generator.dll 16.0 KB 16.0 KB +0 B (0.00%) ≈
Reactor.Wrappers.Abstractions.dll 12.0 KB 12.0 KB +0 B (0.00%) ≈
Reactor.Wrappers.Generator.dll 229.5 KB 229.5 KB +0 B (0.00%) ≈

Assemblies in Microsoft.UI.Reactor.Advanced

Artifact base PR Δ
Microsoft.UI.Reactor.Advanced.dll 1.08 MB 1.08 MB -512 B (-0.05%) ≈

Assemblies in Microsoft.UI.Reactor.Devtools

Artifact base PR Δ
Microsoft.UI.Reactor.Devtools.dll 791.5 KB 791.5 KB +0 B (0.00%) ≈

✅ smaller / ⚠️ larger / ≈ within noise. Sizes come from a Release dotnet pack on the CI runner: packages are the compressed .nupkg download size, assemblies the uncompressed DLL inside it.
workflow run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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 DockableContent abstract and requires Document or ToolWindow panes.
  • 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

@github-actions

github-actions Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

🧪 Merged coverage

Coverage for a95ef98 vs the base branch (7020f0c) — unit + selftest merged.

Metric base PR Δ
Line 89.22% 89.25% +0.03 pp ≈
Branch 43.99% (18780/42687) 44.00% (18783/42693) +0.01 pp ≈

No coverage change beyond the noise floor. ✅

✅ higher / ⚠️ lower / ≈ within noise. Δ is in percentage points; coverage is unit + selftest merged (Debug x64) on the CI runner. Cobertura reports attached to the workflow run as artifacts.

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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 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

@azchohfi Alexandre Zollinger Chohfi (azchohfi) added ready-for-review Agent work and technical checks complete; awaiting review, not approval or merge and removed agent-preparing Agent is addressing feedback or completing required validation and CI labels Dec 4, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review Agent work and technical checks complete; awaiting review, not approval or merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants