Code Quality: Organize Windows Core APIs by responsibility - #18
Conversation
Follow-up inventory: files with multiple type declarationsRegenerated from the final PR head with syntax-tree analysis. Generated files and This is an inventory, not a recommendation to split every entry. This PR gives every public or internal top-level type under non-interop Show the complete inventory
|
There was a problem hiding this comment.
🔵 Needs a closer look
The change set is broad and involves large-scale public namespace/API surface relocation across core, app, tests, and docs, warranting final human verification despite passing builds/tests in the description.
Pull request overview
This PR reorganizes the UI-independent Windows Shell/Core integration surface into a new Files.Core.Windows.* vertical slice, updating namespaces/usings across Files.Core, the WinUI host, tests, and architecture docs to match the new layout while aiming to preserve runtime behavior.
Changes:
- Moved Windows-specific implementations from
Files.Core.Storage.Windows(and selectFiles.Core.Capabilities.*Windows types) intoFiles.Core.Windowsgrouped by responsibility (Commands, DataTransfer, Items, Metadata, Operations, Previews, PropertySheets, Scheduling, etc.). - Updated application and test projects to consume the new
Files.Core.Windows.*namespaces (including removing the unit test global using for the old namespace). - Updated
Files.CoreREADME and repository/architecture documentation to reflect the new subsystem boundaries and folder structure.
File summaries
| File | Description |
|---|---|
| tests/Files.UnitTests/WindowsThumbnailTests.cs | Update usings to Files.Core.Windows.*. |
| tests/Files.UnitTests/WindowsStorageTests.cs | Update usings to Files.Core.Windows.*. |
| tests/Files.UnitTests/WindowsStorageOperationTests.cs | Update usings to Files.Core.Windows.*. |
| tests/Files.UnitTests/WindowsStorageOperationInterruptionTests.cs | Update operation namespace import. |
| tests/Files.UnitTests/WindowsShellSortTests.cs | Replace old Windows storage namespace using. |
| tests/Files.UnitTests/WindowsShellSchedulerTests.cs | Add scheduler namespace import. |
| tests/Files.UnitTests/WindowsShellPropertyPageTests.cs | Update usings to Files.Core.Windows.*. |
| tests/Files.UnitTests/WindowsShellPreviewTests.cs | Update preview/item/scheduler usings. |
| tests/Files.UnitTests/WindowsShellNewMenuTests.cs | Update command/scheduler usings. |
| tests/Files.UnitTests/WindowsShellDragDropTests.cs | Update Windows DataTransfer/item usings. |
| tests/Files.UnitTests/WindowsShellDefaultCommandTests.cs | Update command/item/scheduler usings. |
| tests/Files.UnitTests/WindowsShellContextualCommandTests.cs | Update command/item/scheduler usings. |
| tests/Files.UnitTests/WindowsShellColumnTests.cs | Update item/metadata/scheduler usings. |
| tests/Files.UnitTests/WindowsPropertyTests.cs | Update item/metadata/scheduler usings. |
| tests/Files.UnitTests/WindowsPreviewHandlerRegistrationTests.cs | Update preview/item usings. |
| tests/Files.UnitTests/WindowsPreviewAccessPolicyTests.cs | Update preview/item usings. |
| tests/Files.UnitTests/WindowsIdentityTests.cs | Update Windows root/item usings. |
| tests/Files.UnitTests/WindowsFolderChangeTests.cs | Update changes/item/scheduler usings. |
| tests/Files.UnitTests/WindowsFilesCoreBuilderTests.cs | Update builder extensions namespace usage. |
| tests/Files.UnitTests/GlobalUsings.cs | Remove global using of old namespace. |
| tests/Files.UnitTests/BrowsePreviewModelTests.cs | Update preview namespace usage. |
| tests/Files.UnitTests/ArchiveBrowsingTests.cs | Update Windows root/item usings. |
| tests/Files.UITests/PresentationTests/PreviewPaneViewModelTests.cs | Update preview namespace usage. |
| tests/Files.UITests/PresentationTests/ItemPropertiesViewModelTests.cs | Update property sheet namespace usage. |
| tests/Files.UITests/PresentationTests/BrowsePerformanceTests.cs | Update Windows root namespace usage. |
| tests/Files.UITests/InfrastructureTests/WinUiDataObjectBridgeTests.cs | Update Windows DataTransfer/item/scheduler usings. |
| tests/Files.PresentationTests/ItemActivationServiceTests.cs | Update Windows root/commands usings. |
| src/Files/Views/ToolbarView.xaml.cs | Update commands namespace usage. |
| src/Files/Views/Selection/FolderViewInteraction.cs | Update commands namespace usage. |
| src/Files/Views/RootView.xaml.cs | Update preview namespace usage. |
| src/Files/Views/PreviewPane.xaml.cs | Update preview namespace usage. |
| src/Files/Views/NavigationToolbar.xaml.cs | Update DataTransfer namespace usage. |
| src/Files/Views/ItemContextMenu.cs | Update app extensions namespace usage. |
| src/Files/ViewModels/ToolbarViewModel.cs | Update commands namespace usage. |
| src/Files/ViewModels/PreviewPaneViewModel.cs | Update preview namespace usage. |
| src/Files/ViewModels/NavigationItemLoader.cs | Update Windows root namespace usage. |
| src/Files/ViewModels/FolderBrowserViewModel.cs | Update Windows namespace imports. |
| src/Files/ViewModels/DetailsColumnViewModel.cs | Update metadata namespace usage. |
| src/Files/MainWindow.xaml.cs | Update Windows root/app extensions/preview usings. |
| src/Files/ItemProperties/ToolsPropertyView.xaml.cs | Update property sheets namespace usage. |
| src/Files/ItemProperties/ShortcutPropertyView.xaml.cs | Update property sheets namespace usage. |
| src/Files/ItemProperties/SharingPropertyView.xaml.cs | Update imaging/property sheets usings. |
| src/Files/ItemProperties/SecurityPropertyView.xaml.cs | Update property sheets namespace usage. |
| src/Files/ItemProperties/QuotaPropertyView.xaml.cs | Update property sheets namespace usage. |
| src/Files/ItemProperties/PreviousVersionsPropertyView.xaml.cs | Update imaging/property sheets usings. |
| src/Files/ItemProperties/ItemPropertiesWindow.xaml.cs | Update property sheets namespace usage. |
| src/Files/ItemProperties/ItemPropertiesViewModel.cs | Update Windows root/property sheets usings. |
| src/Files/ItemProperties/ItemPropertiesService.cs | Update app extensions namespace usage. |
| src/Files/ItemProperties/ItemPropertiesFileSystem.cs | Update property sheets namespace usage. |
| src/Files/ItemProperties/HardwarePropertyView.xaml.cs | Update property sheets namespace usage. |
| src/Files/ItemProperties/GeneralPropertyView.xaml.cs | Update property sheets namespace usage. |
| src/Files/ItemProperties/ElevationShieldIcon.xaml.cs | Update imaging namespace usage. |
| src/Files/ItemProperties/DigitalSignaturesPropertyView.xaml.cs | Update property sheets namespace usage. |
| src/Files/ItemProperties/CustomizePropertyView.xaml.cs | Update imaging/property sheets usings. |
| src/Files/ItemProperties/CompatibilityPropertyView.xaml.cs | Update property sheets namespace usage. |
| src/Files/Infrastructure/WinUiShellDropTargetController.cs | Update DataTransfer namespace usage. |
| src/Files/Infrastructure/WinUiDataObjectBridge.cs | Update DataTransfer namespace usage. |
| src/Files/Commands/OpenItemCommandParameter.cs | Update commands namespace usage. |
| src/Files/Commands/Handlers/OpenItemCommandHandler.cs | Update Windows root namespace usage. |
| src/Files/Commands/CommandContext.cs | Update commands namespace usage. |
| src/Files/Commands/AppCommandRegistration.cs | Update commands namespace usage. |
| src/Files/App.xaml.cs | Update Windows root namespace usage. |
| src/Files/Adapters/BrowsePresentationAdapter.cs | Update metadata namespace usage. |
| src/Files/Activation/ItemActivationService.cs | Update Windows root/commands namespace usage. |
| src/Files.Core/Windows/WindowsStorageSource.cs | Move namespace to Files.Core.Windows. |
| src/Files.Core/Windows/WindowsFilesCoreBuilderExtensions.cs | Move builder extensions to Windows slice root. |
| src/Files.Core/Windows/Scheduling/WindowsShellScheduler.cs | Move scheduler namespace under Windows slice. |
| src/Files.Core/Windows/Scheduling/IWindowsShellScheduler.cs | Move scheduler interface namespace. |
| src/Files.Core/Windows/PropertySheets/WindowsVolumeLabelService.cs | Move property sheets namespace + imports. |
| src/Files.Core/Windows/PropertySheets/WindowsShellStorageSettingsService.cs | Move property sheets namespace. |
| src/Files.Core/Windows/PropertySheets/WindowsShellSharingService.cs | Move property sheets namespace + imports. |
| src/Files.Core/Windows/PropertySheets/WindowsShellSecurityService.cs | Move property sheets namespace. |
| src/Files.Core/Windows/PropertySheets/WindowsShellQuotaService.cs | Move property sheets namespace. |
| src/Files.Core/Windows/PropertySheets/WindowsShellPropertySheetReader.cs | Move property sheets namespace + imports. |
| src/Files.Core/Windows/PropertySheets/WindowsShellPropertySheetData.cs | Move property sheets namespace. |
| src/Files.Core/Windows/PropertySheets/WindowsShellPropertyPageEnumerator.cs | Move property sheets namespace + imports. |
| src/Files.Core/Windows/PropertySheets/WindowsShellPropertyPage.cs | Move property sheets namespace. |
| src/Files.Core/Windows/PropertySheets/WindowsShellFolderCustomizationService.cs | Move property sheets namespace. |
| src/Files.Core/Windows/PropertySheets/WindowsShellDriveToolsService.cs | Move property sheets namespace. |
| src/Files.Core/Windows/PropertySheets/WindowsSecurityPrincipalIconProvider.cs | Move property sheets namespace + imports. |
| src/Files.Core/Windows/PropertySheets/WindowsPreviousVersionProvider.cs | Move property sheets namespace. |
| src/Files.Core/Windows/PropertySheets/WindowsFileAttributeService.cs | Move property sheets namespace. |
| src/Files.Core/Windows/Previews/WindowsShellPreviewSessionFactory.cs | Move preview factory into Windows slice. |
| src/Files.Core/Windows/Previews/WindowsShellPreviewSession.cs | Move preview session types namespace. |
| src/Files.Core/Windows/Previews/WindowsShellPreviewResult.cs | Move preview result type namespace. |
| src/Files.Core/Windows/Previews/WindowsShellPreviewLoader.cs | Move preview loader namespace + imports. |
| src/Files.Core/Windows/Previews/WindowsShellPreviewHandlerController.cs | Move controller namespace. |
| src/Files.Core/Windows/Previews/WindowsShellPreviewHandlerAssociation.cs | Move association namespace. |
| src/Files.Core/Windows/Previews/WindowsShellPreviewBlockedException.cs | Move exception namespace + imports. |
| src/Files.Core/Windows/Previews/WindowsPreviewTargetResolver.cs | Move resolver namespace + imports. |
| src/Files.Core/Windows/Previews/WindowsPreviewTarget.cs | Move target namespace + imports. |
| src/Files.Core/Windows/Previews/WindowsPreviewHost.cs | Move preview host types namespace. |
| src/Files.Core/Windows/Previews/WindowsPreviewHandlerResolver.cs | Move resolver namespace + imports. |
| src/Files.Core/Windows/Previews/WindowsPreviewHandlerRegistrationValidator.cs | Move validator namespace. |
| src/Files.Core/Windows/Previews/WindowsPreviewHandlerRegistrationAllowlist.cs | Move allowlist namespace. |
| src/Files.Core/Windows/Previews/WindowsPreviewHandlerFrame.cs | Move frame namespace. |
| src/Files.Core/Windows/Previews/WindowsPreviewHandlerActivationPolicy.cs | Move activation policy namespace. |
| src/Files.Core/Windows/Previews/WindowsPreviewAccessPolicy.cs | Move access policy namespace + imports. |
| src/Files.Core/Windows/Previews/IWindowsShellPreviewSessionFactory.cs | Move public preview factory interface namespace. |
| src/Files.Core/Windows/Previews/IWindowsShellPreviewSession.cs | Move public preview session interface namespace. |
| src/Files.Core/Windows/Previews/IWindowsShellPreviewPolicy.cs | Move policy interface namespace + imports. |
| src/Files.Core/Windows/Previews/IWindowsPreviewTargetResolver.cs | Move target resolver interface namespace. |
| src/Files.Core/Windows/Previews/IWindowsPreviewHandlerResolver.cs | Move handler resolver interface namespace. |
| src/Files.Core/Windows/Previews/IWindowsPreviewHandlerRegistrationAllowlist.cs | Move allowlist interface namespace. |
| src/Files.Core/Windows/Previews/IWindowsPreviewHandlerController.cs | Move controller interface namespace. |
| src/Files.Core/Windows/Previews/IWindowsPreviewHandlerAssociation.cs | Move association interface namespace. |
| src/Files.Core/Windows/Previews/AllowWindowsShellPreviewPolicy.cs | Move default policy implementation namespace. |
| src/Files.Core/Windows/Operations/WindowsStorageOperationHandler.cs | Move operations namespace + imports. |
| src/Files.Core/Windows/Operations/WindowsStorageOperationErrorClassifier.cs | Move operations namespace + imports. |
| src/Files.Core/Windows/Operations/WindowsFileOperationProgressSink.cs | Move operations namespace + imports. |
| src/Files.Core/Windows/Metadata/WindowsShellItemSorter.cs | Move metadata namespace + imports. |
| src/Files.Core/Windows/Metadata/WindowsShellColumnReader.cs | Move metadata namespace. |
| src/Files.Core/Windows/Metadata/WindowsShellColumn.cs | Move metadata model namespace. |
| src/Files.Core/Windows/Metadata/WindowsPropertyReader.cs | Move metadata reader namespace + imports. |
| src/Files.Core/Windows/Items/WindowsStorableSnapshot.cs | Move items namespace. |
| src/Files.Core/Windows/Items/WindowsStorableFactory.cs | Move items namespace + imports. |
| src/Files.Core/Windows/Items/WindowsStorableDescriptor.cs | Move items namespace + imports. |
| src/Files.Core/Windows/Items/WindowsStorable.cs | Move items namespace + imports. |
| src/Files.Core/Windows/Items/WindowsShellItemStore.cs | Move items namespace. |
| src/Files.Core/Windows/Items/WindowsShellItemResolver.cs | Move items namespace + imports. |
| src/Files.Core/Windows/Items/WindowsShellItemArrayFactory.cs | Move items namespace. |
| src/Files.Core/Windows/Items/WindowsItemLocator.cs | Move items namespace. |
| src/Files.Core/Windows/Items/WindowsItemIdReader.cs | Move items namespace. |
| src/Files.Core/Windows/Items/WindowsFolder.cs | Move items namespace + imports. |
| src/Files.Core/Windows/Items/WindowsFile.cs | Move items namespace. |
| src/Files.Core/Windows/Items/ShellReadStream.cs | Move items namespace + imports. |
| src/Files.Core/Windows/Items/ShellItemHelpers.cs | Move items namespace + imports. |
| src/Files.Core/Windows/Items/IWindowsStorable.cs | Move items interface namespace + imports. |
| src/Files.Core/Windows/Items/IWindowsItemIdReader.cs | Move items interface namespace. |
| src/Files.Core/Windows/Imaging/WindowsThumbnailSourceFactory.cs | Move imaging namespace + imports. |
| src/Files.Core/Windows/Imaging/WindowsThumbnailRenderer.cs | Move imaging namespace. |
| src/Files.Core/Windows/Imaging/WindowsShellThumbnailSource.cs | Move imaging namespace + imports. |
| src/Files.Core/Windows/Imaging/WindowsShellThumbnailBackend.cs | Move imaging namespace + imports. |
| src/Files.Core/Windows/Imaging/WindowsShellIconProvider.cs | Move imaging namespace. |
| src/Files.Core/Windows/DataTransfer/WindowsShellSelectionResolver.cs | Move DataTransfer namespace + imports. |
| src/Files.Core/Windows/DataTransfer/WindowsShellDropTarget.cs | Move DataTransfer namespace + imports. |
| src/Files.Core/Windows/DataTransfer/WindowsShellDropSession.cs | Move DataTransfer namespace. |
| src/Files.Core/Windows/DataTransfer/WindowsShellDragSource.cs | Move DataTransfer namespace + imports. |
| src/Files.Core/Windows/DataTransfer/WindowsShellDragDropService.cs | Move DataTransfer namespace + imports. |
| src/Files.Core/Windows/DataTransfer/WindowsShellDragDropData.cs | Move DataTransfer model namespace. |
| src/Files.Core/Windows/DataTransfer/WindowsShellDataObjectFormat.cs | Move DataTransfer helper namespace. |
| src/Files.Core/Windows/DataTransfer/WindowsShellDataObjectFactory.cs | Move DataTransfer helper namespace + imports. |
| src/Files.Core/Windows/DataTransfer/WindowsShellClipboardService.cs | Move DataTransfer clipboard namespace + imports. |
| src/Files.Core/Windows/Commands/WindowsShellNewMenu.cs | Move Commands namespace + imports. |
| src/Files.Core/Windows/Commands/WindowsShellDefaultCommandInvoker.cs | Move Commands namespace + imports. |
| src/Files.Core/Windows/Commands/WindowsShellDefaultCommand.cs | Move Commands model namespace. |
| src/Files.Core/Windows/Commands/WindowsShellContextualCommandService.cs | Move Commands namespace + imports. |
| src/Files.Core/Windows/Commands/WindowsShellContextualCommand.cs | Move Commands model namespace + imports. |
| src/Files.Core/Windows/Commands/WindowsShellContextMenuTarget.cs | Move Commands model namespace. |
| src/Files.Core/Windows/Commands/WindowsShellContextMenuSession.cs | Move Commands namespace + imports. |
| src/Files.Core/Windows/Commands/WindowsShellContextMenuCommandHelper.cs | Move Commands helper namespace. |
| src/Files.Core/Windows/Commands/WindowsShellCommandStorePropertyBag.cs | Move Commands COM helper namespace. |
| src/Files.Core/Windows/Changes/WindowsShellChangeWatcher.cs | Move Changes namespace + imports. |
| src/Files.Core/Windows/Changes/WindowsFolderChangeSource.cs | Move Changes namespace + imports. |
| src/Files.Core/Windows/Changes/FolderChangeSourceFactory.cs | Move Changes factory namespace + imports. |
| src/Files.Core/Windows/Archives/WindowsShellArchiveMount.cs | Move archive mount under Windows slice. |
| src/Files.Core/Windows/Archives/WindowsShellArchiveBackend.cs | Move archive backend under Windows slice. |
| src/Files.Core/Windows/AppExtensions/WindowsShellAppExtensionService.cs | Move AppExtensions namespace + imports. |
| src/Files.Core/Windows/AppExtensions/WindowsShellAppExtensionCommand.cs | Move AppExtensions model namespace. |
| src/Files.Core/Windows/AppExtensions/WindowsFileExplorerAppExtensionCatalog.cs | Move AppExtensions helper namespace. |
| src/Files.Core/Storage/Archives/SevenZip/SevenZipArchiveBackend.cs | Update Windows storage source namespace import. |
| src/Files.Core/README.md | Document new Windows slice boundaries. |
| src/Files.Core/Models/StorableModel.cs | Update item type namespace import. |
| src/Files.Core/Models/FolderModel.cs | Update item type namespace import. |
| src/Files.Core/Composition/FilesCoreRuntime.cs | Update preview namespace imports. |
| src/Files.Core/Composition/FilesCoreBuilder.cs | Update preview namespace imports. |
| src/Files.Core/Composition/ArchiveFilesCoreBuilderExtensions.cs | Update archive backend namespace import. |
| src/Files.Core/Capabilities/Previews/PreviewRequest.cs | Update item context namespace import. |
| src/Files.Core/Capabilities/Archives/ArchiveSourceFactory.cs | Update Windows source/item imports. |
| src/Files.Core/Browsing/FolderBrowseLocationContext.cs | Update item/metadata namespace imports. |
| src/Files.Core/Browsing/BrowsePreviewModel.cs | Update preview namespace import. |
| docs/subsystems/windows-shell.md | Update responsibilities/boundaries documentation. |
| docs/development/repository-layout.md | Update repo layout docs for Windows slice. |
Review details
- Files reviewed: 173/173 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
efb6ca2 to
9ff77a8
Compare
|
Squashed the PR commits and applied the resulting change directly to |
Summary
Files.Core.Windowsas the top-level vertical slice for UI-independent Windows integration.AppExtensions,Archives,Changes,Commands,DataTransfer,Imaging,Items,Metadata,Operations,Previews,PropertySheets, andScheduling, while keeping composition entry points at the slice root.Files.Core.Windowsnamespace throughout the non-interop slice and suppressIDE0130where the responsibility folders intentionally do not extend the namespace.Files.Core/Interop/WindowstoFiles.Core/Windows/Interopwhile preserving their Windows SDK namespaces.Compatibility
This intentionally changes the fully qualified names of public Windows APIs from
Files.Core.Storage.Windowsand selected Windows-specific types underFiles.Core.Capabilities.*andFiles.Core.Storage.ArchivestoFiles.Core.Windows.Consumers of the prerelease
ReFiles.Corepackage must update theirusingdirectives and recompile. Native declarations retain their existingWindows.Win32namespaces, and no compatibility shims are included.Resolved / Related Issues
Steps used to test these changes
Files.Corefor Debug and Release x64.FilesandFiles.Operationsfor Debug x64.Files.UITestsfor Debug x64.Files.UnitTests: 281 total, 278 passed, 3 environment-gated clipboard tests skipped, 0 failed.IDE0005analyzer verification forFiles.Corewith no required changes.Files.Core.Windows, and the 21 source-generated COM interfaces each have their own file.git diff --checkand independently reviewed both commits for unintended semantic changes.CI status
All four matrix configurations compile successfully. Release x64 and both ARM64 jobs pass. Debug x64 reaches the test step and reports the same three native clipboard failures as the current
mainbase commit (0x800401D4while flushing the hosted runner's OLE clipboard); this refactor does not change those tests or their behavior.