Code Quality: Removed ISidebarItemModel 2#18061
Open
0x5bfa wants to merge 3 commits intofiles-community:mainfrom
Open
Code Quality: Removed ISidebarItemModel 2#180610x5bfa wants to merge 3 commits intofiles-community:mainfrom
0x5bfa wants to merge 3 commits intofiles-community:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR completes the removal of the ISidebarItemModel interface as part of phase 1 refactoring. The interface is deleted, and its properties (Children, IsExpanded, PaddedItem) are now accessed directly on concrete implementations like LocationItem rather than through the interface.
Changes:
- Removed
ISidebarItemModelinterface entirely - Changed
INavigationControlItemto no longer inherit fromISidebarItemModel - Refactored
SidebarItemto bindChildren,IsPaddedItemproperties directly in XAML instead of accessing them throughItem.Children,Item.PaddedItem - Changed
SidebarView.SelectedItemfromISidebarItemModeltoobjecttype - Simplified XAML template by using
TemplateBinding Childrenand reusingDefaultSidebarItemTemplatefor flyout items - Replaced
HookupOwnersandHookupItemChangeListenermethods with property change handlers usingGeneratedDependencyProperty
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Files.App.Controls/Sidebar/ISidebarItemModel.cs | Deleted the ISidebarItemModel interface |
| src/Files.App/Data/Contracts/INavigationControlItem.cs | Removed ISidebarItemModel inheritance |
| src/Files.App/Views/MainPage.xaml.cs | Simplified SidebarControl_ItemInvoked pattern matching |
| src/Files.App.Controls/Sidebar/SidebarView.Properties.cs | Changed SelectedItem type from ISidebarItemModel to object |
| src/Files.App.Controls/Sidebar/SidebarStyles.xaml | Updated template bindings to use Children and IsPaddedItem directly, simplified flyout template |
| src/Files.App.Controls/Sidebar/SidebarItem.cs | Replaced Item.Children references with direct Children property access, added ChildrenFlyout_Opened handler |
| src/Files.App.Controls/Sidebar/SidebarItem.Properties.cs | Added property change handlers for Children, Owner, and IsInFlyout using GeneratedDependencyProperty |
| src/Files.App.Controls/Sidebar/SidebarItemAutomationPeer.cs | Updated to access parent.Children directly instead of parent.Item?.Children |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
marcelwgn
approved these changes
Jan 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolved / Related Issues
This is part of the phase 1 mentioned in #17970 (comment)
Steps used to test these changes