Skip to content

Add sorting function to files list #247

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

Merged
merged 1 commit into from
Oct 24, 2019

Conversation

jeffsieu
Copy link
Contributor

@jeffsieu jeffsieu commented Oct 24, 2019

Files and folders can now be sorted by clicking on
the column headers or by using the right-click context
menu. The sorting order mimics Windows Explorer,
by grouping the folders and files separately first, then
applying the relevant sort on the specified column,
then finally sorting by name.

Also:

  • Improves right-click context menu action grouping
  • Removes RowIndex from ListedItem.cs as it is not a reliable way to access items (indices change) after sorting is implemented
  • Refactors code to work around the absence of RowIndex
  • Other minor code refactoring

Screenshots

image
image
image

Related Issues

Closes #178

Possibly related: #20

Files and folders can now be sorted by clicking on
the column headers or by using the right-click context
menu. The sorting order mimics Windows Explorer,
by grouping the folders and files separately first, then
applying the relevant sort on the specified column,
then finally sorting by name.

Also:
- Improves right-click context menu action grouping
- Removes RowIndex from ListedItem.cs as it is not a
  reliable way to access items (indices change)
  after sorting is implemented
- Refactors code to work around the absence of RowIndex
- Other minor code refactoring
@yaira2 yaira2 changed the base branch from master to sort October 24, 2019 18:11
@yaira2 yaira2 merged commit 2ecba55 into files-community:sort Oct 24, 2019
@yaira2
Copy link
Member

yaira2 commented Oct 24, 2019

Do these changes apply to the photo view as well?

@jeffsieu
Copy link
Contributor Author

No, only on the default list view.

@yaira2
Copy link
Member

yaira2 commented Oct 25, 2019

Ok, I tested this and it works as expected, were you planning on doing it for photo view as well?
Side note, in the future we plan on merging the views and changing it to have different layout options so work like this wont need to be done more then once.

@jeffsieu
Copy link
Contributor Author

How does it work on photo view? Is it just via the right click menu, since there are no column headers? I haven't thought about doing it for the photo view as I don't usually use the photo view in Windows Explorer haha. But I guess I could get around to doing it some time soon.

@lukeblevins
Copy link
Contributor

@jeffsieu Great work!

@lukeblevins
Copy link
Contributor

lukeblevins commented Oct 25, 2019

My only concern would be if this breaks any functions that perform an action on a specific DataGrid index. This will require a bit of testing, still great to have regardless.

Edit: I now see you mentioned this already.

@jeffsieu jeffsieu deleted the sorting-function branch October 26, 2019 00:23
@lukeblevins
Copy link
Contributor

lukeblevins commented Oct 27, 2019

@yaira2 @jeffsieu Looks great. After testing, I found several issues which we will need to address before I merge this branch to master:
1.) DataGrid doesn't remember sort options after navigation, but still displays the indicator on the wrong column
2.) Sorting by "Date modified" still needs work to be more accurate
3.) PhotoAlbum needs sort as well.
4.) Add Sort dropdown to ribbon in Layout tab

@jeffsieu jeffsieu restored the sorting-function branch October 28, 2019 04:30
@jeffsieu
Copy link
Contributor Author

@duke7553 I've added sort by to PhotoAlbum and fixed 1). All that's left is making the sort dropdown in the ribbon.

As to 3), which part of sorting by "Date modified" is inaccurate?

@yaira2
Copy link
Member

yaira2 commented Oct 30, 2019

@duke7553 Can you explain what you meant by "Date modified" being inaccurate?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants