Repository navigation
Make TaskbarItem the only taskbar surface - #1828
Alexandre Zollinger Chohfi (azchohfi) wants to merge 4 commits into
Conversation
Move the progress, overlay and thumbnail-toolbar implementation from ReactorWindow into TaskbarItem and remove the ReactorWindow.Progress, Overlay, SetThumbnailToolbar and ClearThumbnailToolbar shortcuts. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
… fixture Seed the click map when the shell rejects the toolbar so the WM_COMMAND routing and dispose-release checks always run, and report the shell-dependent legs as skips. Replace UnsafeAccessor field access with internal accessors, and cover the moved UI-thread guards. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
The TaskbarItem consolidation has no active review issues.
No open issues 🎉
What changed in this PR
Consolidates Reactor’s per-window taskbar API under TaskbarItem, removing compatibility shortcuts as part of #1819.
Changes:
- Moves taskbar implementation into
TaskbarItem, preserving lazy initialization, click routing, and disposal cleanup. - Migrates selftests and adds toolbar lifetime and thread-guard coverage.
- Updates documentation, API indexes, and breaking-change migration guidance.
| File | Description |
|---|---|
| tests/Reactor.Tests/TaskbarProgressTests.cs | Updates an accessor comment. |
| tests/Reactor.AppTests.Host/SelfTest/SelfTestFixtureRegistry.cs | Registers the toolbar lifetime fixture. |
| tests/Reactor.AppTests.Host/SelfTest/Fixtures/WindowModelFixtures.cs | Migrates tests to TaskbarItem. |
| tests/Reactor.AppTests.Host/SelfTest/Fixtures/Phase6WindowingFixtures.cs | Tests lazy allocation, routing, guards, and disposal. |
| src/Reactor/Hosting/Shell/ThumbnailToolbarButton.cs | Updates the XML documentation reference. |
| src/Reactor/Hosting/Shell/ThumbnailToolbar.cs | Extracts slot adoption and adds test helpers. |
| src/Reactor/Hosting/Shell/TaskbarProgress.cs | Updates the XML documentation reference. |
| src/Reactor/Hosting/Shell/TaskbarOverlay.cs | Updates the XML documentation reference. |
| src/Reactor/Hosting/Shell/TaskbarItem.cs | Owns lazy taskbar features and toolbar operations. |
| src/Reactor/Hosting/ReactorWindow.cs | Removes shortcuts and delegates routing and cleanup. |
| src/Reactor.Analyzers/WindowIconSurfaceAnalyzer.cs | Updates an example comment only. |
| skills/reactor.api.txt | Removes obsolete window members from the API index. |
| plugins/reactor/skills/reactor-dsl/references/reactor.api.txt | Synchronizes the mirrored API index. |
| docs/guide/reference/hosting/taskbar.md | Refreshes generated taskbar API documentation. |
| docs/guide/reference/hosting/ReactorWindow.md | Removes documentation for deleted shortcuts. |
| docs/guide/desktop-integration.md | Updates the generated taskbar guide. |
| docs/_pipeline/templates/desktop-integration.md.dt | Updates the taskbar guide source. |
| CHANGELOG.md | Documents the breaking change and replacements. |
Review effort: Balanced
📦 Build metricsArtifact sizes for Packages (compressed .nupkg)
Assemblies in Microsoft.UI.Reactor
Assemblies in Microsoft.UI.Reactor.Advanced
Assemblies in Microsoft.UI.Reactor.Devtools
No size change beyond the noise floor. ✅ ✅ smaller / |
🧪 Merged coverageCoverage for
No coverage change beyond the noise floor. ✅ ✅ higher / |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
5ef043d65b32a50ab8d991adc260a2f6aaf85b2f↑ New selftest checks laziness, click routing via real WM_COMMAND, post-dispose behavior and the UI-thread guards. A mutation of the routing and release turned them red.
↑ CI green on this head (50 pass, 2 path-skipped), including the solution build and the VSIX projects.
↑ 16,951 unit tests and 481 Window* selftests pass locally. Copilot review recommends approval with no open issues.
Summary
TaskbarItemis now the only taskbar API. TheReactorWindowshortcutsProgress,Overlay,SetThumbnailToolbarandClearThumbnailToolbarare removed, and their implementation lives inTaskbarIteminstead of forwarding back to the window.Migration is a straight rename.
window.Progressbecomeswindow.TaskbarItem.Progress, and the same for the others. From a component it'sUseWindow()!.TaskbarItem, which is what the skills and doc apps already use.Nothing else changes. Each feature is still allocated on first use, so a window that never touches the taskbar doesn't initialise the shell COM object. Thumbnail clicks still come in through the window's message pump and run
OnClickon the UI thread. The toolbar's icons and handlers are still released when the window is disposed,SetThumbnailToolbarstill throwsObjectDisposedExceptionafter that, andClearThumbnailToolbaris still a no-op.Linked issue / spec
Relates to #1819
Test plan
TaskbarItem_ProgressRegressionselftest. It used to compare against the removedwin.Progress/win.Overlay. It now checks that nothing is allocated until it's read, and that the instances stay stable.TaskbarItem_ThumbnailToolbarLifetime. It sendsWM_COMMANDto the window and checks the click reaches the right button, that unused slots, cleared toolbars and disposed windows don't dispatch, and that both toolbar methods throw off the UI thread. If the shell rejects the buttons it seeds the click map so routing is still checked, and reports the shell-only legs as skips. Breaking the routing or the dispose release inReactorWindowturns 4 of these red.dotnet run --project tests/Reactor.AppTests.Host -- --self-test --filter "TaskbarItem"(27 ok),--filter "Window"(481 ok)dotnet restore Reactor.slnxthendotnet build Reactor.slnx --no-restore -c Release: no compiler errors locally. The VSIX projects couldn't restore behind the local proxy, and CI builds them green.dotnet test tests/Reactor.Tests -c Release -p:Platform=x64: 16,951 passed, 18 skippedreactor.api.txtcopies, the reference docs (compile --reference-only) and thedesktop-integrationguide topicRisk / breaking changes
Breaking for any app that calls the four removed
ReactorWindowmembers. They become compile errors, and the CHANGELOGRemovedentry gives the replacement for each one. Behavior throughTaskbarItemis unchanged.