Skip to content

Code Quality: Removed ISidebarItemModel 2#18061

Merged
yair100 merged 3 commits intofiles-community:mainfrom
0x5bfa:5bfa/CQ-SidebarView3
Feb 20, 2026
Merged

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

Conversation

@0x5bfa
Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread src/Files.App.Controls/Sidebar/SidebarItem.Properties.cs
Comment thread src/Files.App.Controls/Sidebar/SidebarItem.Properties.cs
@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
@yair100 yair100 added ready to merge Pull requests that are approved and ready to merge and removed ready for review Pull requests that are ready for review labels Feb 20, 2026
@yair100 yair100 merged commit 3e1fb20 into files-community:main Feb 20, 2026
11 of 12 checks passed
@yair100
Copy link
Copy Markdown
Member

yair100 commented Feb 20, 2026

Thank you.

@0x5bfa 0x5bfa deleted the 5bfa/CQ-SidebarView3 branch February 22, 2026 05:54
yair100 added a commit that referenced this pull request Feb 26, 2026
yair100 added a commit that referenced this pull request Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready to merge Pull requests that are approved and ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants