Skip to content

Code Quality: Removed ISidebarItemModel 2#18061

Open
0x5bfa wants to merge 3 commits intofiles-community:mainfrom
0x5bfa:5bfa/CQ-SidebarView3
Open

Code Quality: Removed ISidebarItemModel 2#18061
0x5bfa wants to merge 3 commits intofiles-community:mainfrom
0x5bfa:5bfa/CQ-SidebarView3

Conversation

@0x5bfa
Copy link
Member

@0x5bfa 0x5bfa commented Jan 14, 2026

Resolved / Related Issues

This is part of the phase 1 mentioned in #17970 (comment)

Steps used to test these changes

  • Check if a section has children
  • Check if a section has collapse/expand transition
  • Check if items are shown in flyout
  • Check if an item can be added at runtime (e.g., pinning an item)
  • Check if an item can be right clicked
  • Check if an item can be left clicked

Copilot AI review requested due to automatic review settings January 14, 2026 06:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 ISidebarItemModel interface entirely
  • Changed INavigationControlItem to no longer inherit from ISidebarItemModel
  • Refactored SidebarItem to bind Children, IsPaddedItem properties directly in XAML instead of accessing them through Item.Children, Item.PaddedItem
  • Changed SidebarView.SelectedItem from ISidebarItemModel to object type
  • Simplified XAML template by using TemplateBinding Children and reusing DefaultSidebarItemTemplate for flyout items
  • Replaced HookupOwners and HookupItemChangeListener methods with property change handlers using GeneratedDependencyProperty

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.

@yair100 yair100 added the ready for review Pull requests that are ready for review label Feb 17, 2026
@yair100 yair100 changed the title Code Quality: Removed ISidebarItemModel 2 (complete) Code Quality: Removed ISidebarItemModel 2 Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review Pull requests that are ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments