Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Redesigned the left hand sidebar #13052

Merged
merged 106 commits into from
Aug 13, 2023
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
badfe3e
WIP: Initial switching to new sidebar
marcelwgn Jul 22, 2023
1bfef44
Get icons to work
marcelwgn Jul 23, 2023
540c3fa
Hookup selection/navigation
marcelwgn Jul 23, 2023
ae0e8bf
UI updates
marcelwgn Jul 23, 2023
4d91d3f
Implement minimal mode
marcelwgn Jul 24, 2023
2347ba5
Fix formatting
marcelwgn Jul 24, 2023
1898ac9
Merge branch 'main' into dev/new-sidebar
yaira2 Jul 24, 2023
ce97aa9
Added round corner
yaira2 Jul 24, 2023
18cb170
Added border brush to content
yaira2 Jul 24, 2023
4f362a2
Update SideBarPane.xaml
yaira2 Jul 24, 2023
9f2a491
Merge branch 'main' into dev/new-sidebar
marcelwgn Jul 25, 2023
4ebc3ad
Section spacing
yaira2 Jul 25, 2023
dca01b7
Update SideBarResources.xaml
yaira2 Jul 25, 2023
60bbe2c
Update visual states and styling
yaira2 Jul 25, 2023
d866b85
Update SideBarPane.xaml
yaira2 Jul 25, 2023
d955485
Update SideBarPane.xaml
yaira2 Jul 25, 2023
205e645
Added spacing between items
yaira2 Jul 25, 2023
c2ecd1b
Move logic from MainPage/SideBarHost into SidebarViewModel, rename Si…
marcelwgn Jul 25, 2023
a3732b7
Remove SideBarPane control by merging it into SideBarView
marcelwgn Jul 25, 2023
9630abf
Acrylic overlay
yaira2 Jul 26, 2023
f83b9e1
Update SideBarResources.xaml
yaira2 Jul 26, 2023
555b03c
Merge branch 'main' into dev/new-sidebar
yaira2 Jul 26, 2023
8a024af
Move out logic of handling tab area to mainpage, fix initial loading …
marcelwgn Jul 26, 2023
bccb155
Update SideBarItem states, add background transition
marcelwgn Jul 26, 2023
7c17270
Finally rename SideBar* to Sidebar*
marcelwgn Jul 26, 2023
e26178a
Small UI changes
marcelwgn Jul 26, 2023
59b6a24
Add back double click pane expand/collapse behavior
marcelwgn Jul 26, 2023
1cfa722
Implement accessibility peers and keyboard navigation, format xaml
marcelwgn Jul 26, 2023
8f680ba
Add expander icon animation
marcelwgn Jul 26, 2023
b5a8955
Update cursor when resizing sidebar
yaira2 Jul 26, 2023
5b4c493
Increased splitter width
yaira2 Jul 26, 2023
77fb858
Fix double click behavior, fix minimal pane looking weird
marcelwgn Jul 27, 2023
ca20f17
Merge branch 'main' into dev/new-sidebar
marcelwgn Jul 27, 2023
a8ad119
Format xaml
marcelwgn Jul 27, 2023
234ecce
Merge branch 'dev/new-sidebar' of https://github.com/chingucoding/Fil…
marcelwgn Jul 27, 2023
fb009b7
Bring back pane context menu
marcelwgn Jul 27, 2023
7983ea0
Minor fixes surrounding reordering pinned items
marcelwgn Jul 27, 2023
2dd996f
Move away from datacontext as item holder
marcelwgn Jul 27, 2023
e3834fe
Add tooltips
marcelwgn Jul 30, 2023
7c369ef
Restore drag/drop behavior
marcelwgn Jul 30, 2023
eaa5ee4
Merge branch 'main' into dev/new-sidebar
marcelwgn Jul 30, 2023
e090a36
Fix compact pane behavior, switch to resources, prepare for pane anim…
marcelwgn Jul 30, 2023
5f83c05
Open open/close animation for minimal mode, fix null issue
marcelwgn Jul 30, 2023
c09116e
Formatting
marcelwgn Jul 30, 2023
5065e78
Merge branch 'main' into dev/new-sidebar
yaira2 Jul 30, 2023
99d3dd9
Fix issue with grid splitter double tap
marcelwgn Jul 31, 2023
54e96da
Merge branch 'dev/new-sidebar' of https://github.com/chingucoding/Fil…
marcelwgn Jul 31, 2023
ebe1a3a
Fix missing tooltip for cloud drives
marcelwgn Jul 31, 2023
c0ae04a
Fix resize keyboard behavior
marcelwgn Jul 31, 2023
df3563c
Add restoration of open pane width between sessions
marcelwgn Jul 31, 2023
988ef58
Restore compact/non compact mode correctly
marcelwgn Aug 1, 2023
879157e
Merge branch 'main' into dev/new-sidebar
marcelwgn Aug 1, 2023
729c2be
Remove SidebarControl
marcelwgn Aug 3, 2023
c914e7c
Merge branch 'dev/new-sidebar' of https://github.com/chingucoding/Fil…
marcelwgn Aug 3, 2023
e0289f0
Add more pane animations
marcelwgn Aug 3, 2023
6ebcd4f
Fix minimal to expanded transition
marcelwgn Aug 5, 2023
66eb90c
Fix minimal to compact
marcelwgn Aug 5, 2023
1283e96
Add expand/collapse animations
marcelwgn Aug 6, 2023
09e04b6
Small UI fixes
marcelwgn Aug 6, 2023
8cd31ea
Format xaml
marcelwgn Aug 6, 2023
9c7d7d9
Merge branch 'main' into dev/new-sidebar
marcelwgn Aug 6, 2023
7219e1c
Add bottom padding
marcelwgn Aug 6, 2023
adf2f34
Merge branch 'dev/new-sidebar' of https://github.com/chingucoding/Fil…
marcelwgn Aug 6, 2023
0d8b903
Fix animations
marcelwgn Aug 6, 2023
051bed1
Merge branch 'main' into dev/new-sidebar
marcelwgn Aug 6, 2023
632cf43
Merge branch 'main' into dev/new-sidebar
yaira2 Aug 6, 2023
6329c8d
Add restoration of expansion state, API refactor
marcelwgn Aug 6, 2023
628f04d
Fix issue with collapsed pane failing to restore expansion state
marcelwgn Aug 6, 2023
435d840
UI fixes by @mdta
marcelwgn Aug 7, 2023
df3d67a
Add theme shadow to minimal pane, readd bottom margin
marcelwgn Aug 7, 2023
c560ca4
Try fix race condition with icon not loading properly
marcelwgn Aug 7, 2023
125b393
Centered resizer with content border
yaira2 Aug 7, 2023
130f1df
Add debug logging for icons not loading
marcelwgn Aug 7, 2023
b9bbb09
Fixed resources
yaira2 Aug 8, 2023
14fd9a6
Merge branch 'main' into dev/new-sidebar
yaira2 Aug 8, 2023
300e00e
Merge branch 'main' into dev/new-sidebar
yaira2 Aug 8, 2023
42b5e4a
Remove NavigationViewItemOnLeftMinHeight from compact styles
yaira2 Aug 8, 2023
91d534c
Update icon displaying
marcelwgn Aug 8, 2023
a043471
Merge branch 'dev/new-sidebar' of https://github.com/chingucoding/Fil…
marcelwgn Aug 8, 2023
db53bf0
Revert "Update icon displaying"
marcelwgn Aug 8, 2023
0596498
Refactor icon api, hookup icon change listener after loading component
marcelwgn Aug 8, 2023
66a7b2d
Update sidebaritem subscription handling
marcelwgn Aug 8, 2023
70f0fc6
Handle issue with showing and hiding section
marcelwgn Aug 8, 2023
6312963
Fix issues with icons not loading correctly
marcelwgn Aug 9, 2023
52a5882
Merge branch 'main' into dev/new-sidebar
marcelwgn Aug 9, 2023
c289eff
Cleanup and API refactoring
marcelwgn Aug 9, 2023
e9aec0f
Fix expand animation for child items
marcelwgn Aug 9, 2023
965c39e
Fixed padding
yaira2 Aug 9, 2023
ed93fc6
Update SideBarView.xaml
yaira2 Aug 9, 2023
7b1e8b7
Update SideBarView.xaml
yaira2 Aug 9, 2023
f2d4b81
Update SideBarResources.xaml
yaira2 Aug 9, 2023
c43e89a
Add footer property to SidebarView
marcelwgn Aug 9, 2023
6e21aa7
Merge branch 'dev/new-sidebar' of https://github.com/chingucoding/Fil…
marcelwgn Aug 9, 2023
fa9c451
Merge branch 'main' into dev/new-sidebar
yaira2 Aug 10, 2023
bea8ed5
Fix: Fixed border brush in high contrast
yaira2 Aug 10, 2023
4693dc6
Update PreviewPane.xaml
yaira2 Aug 10, 2023
73ed499
Drag and drop fixes
marcelwgn Aug 10, 2023
e69e082
Merge branch 'dev/new-sidebar' of https://github.com/chingucoding/Fil…
marcelwgn Aug 10, 2023
471407c
Fix scrollbar not auto hiding
marcelwgn Aug 11, 2023
2dad39b
Add documentation for Sidebar related enums and Sidebar related inter…
marcelwgn Aug 11, 2023
a5407d5
Update chevron foreground
yaira2 Aug 11, 2023
6a6375e
Merge branch 'dev/new-sidebar' of https://github.com/chingucoding/Fil…
yaira2 Aug 11, 2023
f8d8a1b
Fix recycle bin tooltip
marcelwgn Aug 11, 2023
339309f
Merge branch 'dev/new-sidebar' of https://github.com/chingucoding/Fil…
marcelwgn Aug 11, 2023
0961ee8
Fix headers switching to item mode when collection is empty
marcelwgn Aug 12, 2023
f37c7d0
Fix behavior surrounding flyouts when there are no child items
marcelwgn Aug 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 0 additions & 50 deletions src/Files.App/Actions/Show/ToggleSidebarAction.cs
yaira2 marked this conversation as resolved.
Show resolved Hide resolved

This file was deleted.

1 change: 1 addition & 0 deletions src/Files.App/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<ResourceDictionary.MergedDictionaries>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
<ResourceDictionary Source="/ResourceDictionaries/PathIcons.xaml" />
<ResourceDictionary Source="/ResourceDictionaries/SidebarResources.xaml" />
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Light">
Expand Down
1 change: 0 additions & 1 deletion src/Files.App/Data/Commands/CommandCodes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public enum CommandCodes
ToggleShowHiddenItems,
ToggleShowFileExtensions,
TogglePreviewPane,
ToggleSidebar,

// File System
CopyItem,
Expand Down
2 changes: 0 additions & 2 deletions src/Files.App/Data/Commands/Manager/CommandManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public IRichCommand this[HotKey hotKey]
public IRichCommand ToggleShowHiddenItems => commands[CommandCodes.ToggleShowHiddenItems];
public IRichCommand ToggleShowFileExtensions => commands[CommandCodes.ToggleShowFileExtensions];
public IRichCommand TogglePreviewPane => commands[CommandCodes.TogglePreviewPane];
public IRichCommand ToggleSidebar => commands[CommandCodes.ToggleSidebar];
public IRichCommand SelectAll => commands[CommandCodes.SelectAll];
public IRichCommand InvertSelection => commands[CommandCodes.InvertSelection];
public IRichCommand ClearSelection => commands[CommandCodes.ClearSelection];
Expand Down Expand Up @@ -198,7 +197,6 @@ public CommandManager()
[CommandCodes.ToggleShowHiddenItems] = new ToggleShowHiddenItemsAction(),
[CommandCodes.ToggleShowFileExtensions] = new ToggleShowFileExtensionsAction(),
[CommandCodes.TogglePreviewPane] = new TogglePreviewPaneAction(),
[CommandCodes.ToggleSidebar] = new ToggleSidebarAction(),
[CommandCodes.SelectAll] = new SelectAllAction(),
[CommandCodes.InvertSelection] = new InvertSelectionAction(),
[CommandCodes.ClearSelection] = new ClearSelectionAction(),
Expand Down
1 change: 0 additions & 1 deletion src/Files.App/Data/Commands/Manager/ICommandManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public interface ICommandManager : IEnumerable<IRichCommand>
IRichCommand ToggleShowHiddenItems { get; }
IRichCommand ToggleShowFileExtensions { get; }
IRichCommand TogglePreviewPane { get; }
IRichCommand ToggleSidebar { get; }

IRichCommand CopyItem { get; }
IRichCommand CopyPath { get; }
Expand Down
15 changes: 13 additions & 2 deletions src/Files.App/Data/Items/DriveItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
using Files.Core.Storage.Enums;
using Files.Core.Storage.LocatableStorage;
using Files.Core.Storage.NestedStorage;
using Microsoft.UI.Dispatching;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media.Imaging;
using Windows.Storage;
using Windows.Storage.Streams;
Expand All @@ -20,7 +22,10 @@ public class DriveItem : ObservableObject, INavigationControlItem, ILocatableFol
public BitmapImage Icon
{
get => icon;
set => SetProperty(ref icon, value);
set
{
SetProperty(ref icon, value, nameof(Icon));
}
}

public byte[] IconData { get; set; }
Expand Down Expand Up @@ -152,6 +157,13 @@ public bool ShowStorageSense

public string Name => Root.DisplayName;

public BulkConcurrentObservableCollection<INavigationControlItem>? ChildItems => null;

public IconSource? GenerateIconSource() => new ImageIconSource()
{
ImageSource = Icon
};

public DriveItem()
{
ItemType = NavigationControlItemType.CloudDrive;
Expand Down Expand Up @@ -260,7 +272,6 @@ public async Task LoadThumbnailAsync(bool isSidebar = false)
}
IconData ??= UIHelpers.GetSidebarIconResourceInfo(Constants.ImageRes.Folder).IconData;
}

Icon ??= await IconData.ToBitmapAsync();
}

Expand Down
17 changes: 16 additions & 1 deletion src/Files.App/Data/Items/FileTagItem.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
// Copyright (c) 2023 Files Community
// Licensed under the MIT License. See the LICENSE.

using CommunityToolkit.WinUI.Helpers;
using Files.App.Converters;
using Files.Core.ViewModels.FileTags;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Markup;
using Microsoft.UI.Xaml.Media;

namespace Files.App.Data.Items
{
public class FileTagItem : INavigationControlItem
public class FileTagItem : ObservableObject, INavigationControlItem
{
public string Text { get; set; }

Expand All @@ -17,6 +23,7 @@ public string Path
{
path = value;
ToolTipText = Text;
OnPropertyChanged("Icon");
}
}

Expand All @@ -33,5 +40,13 @@ public int CompareTo(INavigationControlItem other)
=> Text.CompareTo(other.Text);

public TagViewModel FileTag { get; set; }

public BulkConcurrentObservableCollection<INavigationControlItem>? ChildItems => null;

public IconSource? GenerateIconSource() => new PathIconSource()
{
Data = (Geometry)XamlBindingHelper.ConvertValue(typeof(Geometry), (string)Application.Current.Resources["ColorIconFilledTag"]),
Foreground = new SolidColorBrush(FileTag.Color.ToColor())
};
}
}
8 changes: 7 additions & 1 deletion src/Files.App/Data/Items/INavigationControlItem.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
// Copyright (c) 2023 Files Community
// Licensed under the MIT License. See the LICENSE.

using Microsoft.UI.Xaml.Controls;

namespace Files.App.Data.Items
{
public interface INavigationControlItem : IComparable<INavigationControlItem>
public interface INavigationControlItem : IComparable<INavigationControlItem>, INotifyPropertyChanged
{
public string Text { get; }

Expand All @@ -16,6 +18,10 @@ public interface INavigationControlItem : IComparable<INavigationControlItem>
public NavigationControlItemType ItemType { get; }

public ContextMenuOptions MenuOptions { get; }

public BulkConcurrentObservableCollection<INavigationControlItem>? ChildItems { get; }

public IconSource? GenerateIconSource();
}

public enum NavigationControlItemType
Expand Down
12 changes: 9 additions & 3 deletions src/Files.App/Data/Items/LocationItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using CommunityToolkit.WinUI;
using Files.App.Utils.Shell;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media.Imaging;
using System.IO;

Expand All @@ -14,11 +15,12 @@ public class LocationItem : ObservableObject, INavigationControlItem
public BitmapImage Icon
{
get => icon;
set => SetProperty(ref icon, value);
set
{
SetProperty(ref icon, value, nameof(Icon));
}
}

//public Uri IconSource { get; set; }

public byte[] IconData { get; set; }

public string Text { get; set; } = "";
Expand Down Expand Up @@ -48,6 +50,10 @@ public NavigationControlItemType ItemType
public bool IsDefaultLocation { get; set; }

public BulkConcurrentObservableCollection<INavigationControlItem> ChildItems { get; set; }
public IconSource? GenerateIconSource() => new ImageIconSource()
{
ImageSource = icon
};

public bool SelectsOnInvoked { get; set; } = true;

Expand Down
21 changes: 19 additions & 2 deletions src/Files.App/Data/Items/WslDistroItem.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
// Copyright (c) 2023 Files Community
// Licensed under the MIT License. See the LICENSE.

using Microsoft.UI.Xaml.Controls;

namespace Files.App.Data.Items
{
public class WslDistroItem : INavigationControlItem
public class WslDistroItem : ObservableObject, INavigationControlItem
{
public string Text { get; set; }

Expand All @@ -23,12 +25,27 @@ public string Path
public NavigationControlItemType ItemType
=> NavigationControlItemType.LinuxDistro;

public Uri Logo { get; set; }
private Uri icon;
public Uri Icon
{
get => icon;
set
{
SetProperty(ref icon, value, nameof(Icon));
}
}

public SectionType Section { get; set; }

public ContextMenuOptions MenuOptions { get; set; }

public BulkConcurrentObservableCollection<INavigationControlItem>? ChildItems => null;
public IconSource? GenerateIconSource() => new BitmapIconSource()
{
UriSource = icon,
ShowAsMonochrome = false,
};

public int CompareTo(INavigationControlItem other) => Text.CompareTo(other.Text);
}
}
14 changes: 14 additions & 0 deletions src/Files.App/Files.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@
<Content Remove="Assets\FilesHome.png" />
</ItemGroup>

<ItemGroup>
<None Remove="UserControls\Sidebar\SideBarItem.xaml" />
<None Remove="UserControls\Sidebar\SideBarView.xaml" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="ByteSize" Version="2.1.1" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.1" />
Expand Down Expand Up @@ -130,4 +135,13 @@
<TrimmerRootAssembly Include="CommunityToolkit.WinUI.UI.Controls.Primitives" />
</ItemGroup>

<ItemGroup>
<Page Update="UserControls\SideBarControl\SideBarHost.xaml">
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
</Page>
<Page Update="UserControls\SideBarControl\SideBarItem.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>

</Project>
Loading