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

Added collapsible sections to the sidebar #3661

Merged
merged 47 commits into from Feb 25, 2021

Conversation

oleitao
Copy link
Contributor

@oleitao oleitao commented Feb 21, 2021

Added Drivers and Cloud Drivers collapse groups on left side menu.

@yaira2
Copy link
Member

yaira2 commented Feb 21, 2021

@oleitao Is it possible to make the favorites section collapsible as well?

@oleitao
Copy link
Contributor Author

oleitao commented Feb 21, 2021

@oleitao Is it possible to make the favorites section collapsible as well?

hi, @yaichenbaum yes it's possible, I already have tried that.However, because sidebar controls are loaded as asynchronously the order which each section will be loaded on GUI wil differ.
If create a new section called Home which includes Desktop, Download, Documents, Pictures, Music, Videos, Recycle Bin that section will take some time to be loaded. So, that will be loaded at last at the end of Sidebar control (structure So, below).

Clouc Drivers

  • ...
  • ...

Drivers

  • ...
  • ...

Home

  • Desktop
  • Downloads
  • ...
  • ...

@gave92
Copy link
Member

gave92 commented Feb 21, 2021

@oleitao mmm curious, since we do have an order by which sidebar items are loaded. From App.xaml.cs:

await SidebarPinnedController.CreateInstance();    --> load pinned folders
await DrivesManager.EnumerateDrivesAsync();    --> load fixed drives (after pinned folders)
await CloudDrivesManager.EnumerateDrivesAsync();    --> load cloud drives (after drives)
await NetworkDrivesManager.EnumerateDrivesAsync();    --> load network drives (after cloud)

@oleitao
Copy link
Contributor Author

oleitao commented Feb 21, 2021

@gave92 i know that. If @yaichenbaum and @gave92 think it would be better to make the favorites section collapsible as well i can do it? However, i can't assore if i can load drivers sections in correct order.

@gave92
Copy link
Member

gave92 commented Feb 21, 2021

@oleitao yeah it would be better to make the favorites section collapsible as well but the order of the sidebar sections should be mantained too :) [I don't think I've understood what makes keeping the order difficult]

-Replace System.Collections.Generic.List<INavigationControlItem> by ObservableCollection
@yaira2
Copy link
Member

yaira2 commented Feb 21, 2021

@oleitao Can you keep track of the collapsed/expanded state so it's the same whenever the user opens the app? By default, other than the favorites section, all other sections should be collapsed.

@oleitao
Copy link
Contributor Author

oleitao commented Feb 21, 2021

@oleitao Can you keep track of the collapsed/expanded state so it's the same whenever the user opens the app? By default, other than the favorites section, all other sections should be collapsed.

@yaichenbaum i added the feature you've requested

@gave92
Copy link
Member

gave92 commented Feb 21, 2021

Couple of notes:

  • Minimizing and restoring the app duplicates the "drives" section
  • The network drives section is not collapsible
  • The blue "selection indicator" is not working for items inside sections
  • Expanded state should be saved to AppSettings so it's persisted across app restarts
  • Sections should probably have their own icons
  • New user pinned folders should be added under the quickaccess section

Files/Strings/en-US/Resources.resw Outdated Show resolved Hide resolved
Files/UserControls/SidebarControl.xaml.cs Outdated Show resolved Hide resolved
Files/DataModels/SidebarPinnedModel.cs Outdated Show resolved Hide resolved
@yaira2 yaira2 added the changes requested Changes are needed for this pull request label Feb 21, 2021
yaira2 and others added 6 commits February 21, 2021 17:17
…Files into collapsible-side-layout

# Conflicts:
#	Files/DataModels/SidebarPinnedModel.cs
#	Files/Filesystem/CloudDrivesManager.cs
#	Files/Filesystem/Drives.cs
#	Files/Filesystem/NetworkDrivesManager.cs
#	Files/UserControls/SidebarControl.xaml.cs
@yaira2
Copy link
Member

yaira2 commented Feb 24, 2021

@oleitao Is there a way to pin recycle bin regularly instead of putting it at the top of the favorites section?

@gave92
Copy link
Member

gave92 commented Feb 24, 2021

With the latest commit the bin it's always the last item of the favorites section (like the current behavior on main)

@oleitao
Copy link
Contributor Author

oleitao commented Feb 24, 2021

@oleitao Is there a way to pin recycle bin regularly instead of putting it at the top of the favorites section?

As @gave92 told 'With the latest commit the bin it's always the last item of the favorites section (like the current behavior on main)'

@yaira2
Copy link
Member

yaira2 commented Feb 24, 2021

With the latest commit the bin it's always the last item of the favorites section (like the current behavior on main)

That's should be enough for this pr. In the future, it should be in order of where it was pinned.

@gave92
Copy link
Member

gave92 commented Feb 24, 2021

Is this the icon we want for favorites?

image

@oleitao
Copy link
Contributor Author

oleitao commented Feb 24, 2021

Is this the icon we want for favorites?

image

I added that:

star

@yaira2
Copy link
Member

yaira2 commented Feb 24, 2021

Is this the icon we want for favorites?

image

Yes.

Files/Filesystem/Drives.cs Outdated Show resolved Hide resolved
@yaira2
Copy link
Member

yaira2 commented Feb 24, 2021

@oleitao One last thing, can you move the home item into the favorites section? Eventually we will let users unpin it from the sidebar, so I think it makes sense to keep it with the other items that can be unpinned.

@oleitao
Copy link
Contributor Author

oleitao commented Feb 24, 2021

@oleitao One last thing, can you move the home item into the favorites section? Eventually we will let users unpin it from the sidebar, so I think it makes sense to keep it with the other items that can be unpinned.

yes, i already moved home item into favorites section

Files/DataModels/SidebarPinnedModel.cs Show resolved Hide resolved
Files/DataModels/SidebarPinnedModel.cs Outdated Show resolved Hide resolved
@gave92 gave92 self-requested a review February 24, 2021 23:22
Copy link
Member

@gave92 gave92 left a comment

Choose a reason for hiding this comment

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

I think it's looking good, just missing the new section icons.

Files/Views/Settings.xaml Outdated Show resolved Hide resolved
Files/Views/Settings.xaml Outdated Show resolved Hide resolved
@oleitao
Copy link
Contributor Author

oleitao commented Feb 25, 2021

I think it's looking good, just missing the new section icons.

@gave92 Added favorite section icon commit

Copy link
Member

@yaira2 yaira2 left a comment

Choose a reason for hiding this comment

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

Great work!

@yaira2 yaira2 changed the title Added collapsible Drivers/Cloud Drivers on Sidebar control Added collapsible sections to the sidebar Feb 25, 2021
@gave92 gave92 added approved and removed changes requested Changes are needed for this pull request labels Feb 25, 2021
@yaira2 yaira2 merged commit c1765d5 into files-community:main Feb 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants