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

Default sort option #4252

Open
7 tasks done
tkna91 opened this issue Apr 11, 2023 · 3 comments
Open
7 tasks done

Default sort option #4252

tkna91 opened this issue Apr 11, 2023 · 3 comments
Labels
feature This is a completely new feature for Zettlr.

Comments

@tkna91
Copy link

tkna91 commented Apr 11, 2023

Checklist

  • Zettlr does not possess this feature (if it does, but the feature doesn't work out for you, propose an enhancement instead.)
  • Zettlr's current features cannot be used to approximate this behaviour (otherwise, propose an enhancement instead.)
  • I have searched the documentation to make sure I did not overlook it.
  • I have searched both open and closed issues to see if someone has already proposed this.

Feature Proposal

Currently, the default sort is fixed at Sort by name - ascending.
The following sort formats can be specified in the directory properties

  • Sort by name - ascending
  • Sort by name - descending
  • Sort by time - ascending
  • Sort by time - descending

Wouldn't it be more convenient if these could be set as the default sort in Preferences?

I understand that the current alternative is to put the following files in each directory, but it is a bit depressing to think that we have to do this for every new directory we create.

.ztr-directory

{"sorting":"time-up","project":null,"icon":null}

Example Workflow

  1. (nothing is currently set in Preferences)
  2. open directory A with multiple files, with properties unset
  3. ->Observe that the sort order of the files is Sort by name - ascending
  4. right-click on directory A and select Properties
  5. the dialog that appears shows Sort by name - ascending
  6. close the dialog
  7. check if there is a .ztr-directory file under directory A
  8. ->No .ztr-directory file will be created under directory A because you have not changed any properties
  9. open directory B which has multiple files
  10. right click on directory B and select properties
  11. specify Sort by name - descending from the drop down menu in the dialog that appears and close the dialog
  12. ->Observe that the sort order of the files is Sort by name - descending
  13. check for .ztr-directory files under directory B
  14. ->Since you have changed the properties, a .ztr-directory file has been created under directory B
  15. Select File->Preferences->Preferences from the menu
  16. Under the heading "Default sort" you have the following radio button options
    • Sort by name - ascending
    • Sort by name - descending
    • Sort by time - ascending
    • Sort by time - descending
  17. This option is displayed above "Sorting order for files (used for sorting by name)
  18. Select Sort by time - ascending
  19. Close the Preferences window with the x button or Ctrl+W
  20. Open directory A
  21. ->Observe that the sort order of the files is Sort by time - ascending
  22. Right-click on directory A and select Properties
  23. the dialog that appears shows Sort by time - ascsending
  24. close the dialog
  25. check if there is a .ztr-directory file under directory A
  26. ->No .ztr-directory file will be created under directory A because you have not changed any properties
  27. open directory B which has multiple files
  28. ->Observe that the sort order of the files is Sort by name - descending
  29. right click on directory B and select properties
  30. the dialog that appears shows Sort by name - descending
  31. select Sort by time - ascending from the drop down menu of the dialog that appears and close the dialog
  32. ->Observe that the sort order of the files is Sort by time - ascending
  33. check for .ztr-directory files under directory B
  34. ->Since you have changed the properties, a .ztr-directory file has been updated under directory B.

Caveats

Changing the "Default sort" option changes the following

  • Sort order for directories with no properties set
  • Display sort order when opening properties of directories with no properties set.

Default sort with "sorting": "null"

  • Current behavior
    1. set only project or icon in directory properties.
    2. -> .ztr-directory file is set to "sorting": "name-up".
  • When implementing this feature
    1. set only project or icon in directory properties.
    2. -> .ztr-directory file is set to "sorting": "null". This indicates that it will follow the Default sorting.

Do you wish to attempt implementing this yourself?

No

Platforms

  • Windows
  • macOS
  • Linux

Additional Information

I wrote the above with a naive imagination of what I consider to be a reasonable form.
Please let me know if there are any problems or areas for improvement.

@tkna91 tkna91 added the feature This is a completely new feature for Zettlr. label Apr 11, 2023
@boring-cyborg
Copy link

boring-cyborg bot commented Apr 11, 2023

Thanks so much for opening up your first issue here on the repository! 🎉 We would like to warmly welcome you to the community behind the app! ☺️ We'll check in soon and have a look at your issue. In the meantime, you can check your issue and make sure it aligns with our contribution guidelines! Here's the comprehensive list:

Enhancements

An enhancement takes a feature and improves or alters its behaviour. Please make sure to argue how your proposition will aid non-technical text workers, and why it can't be emulated easily with other features or apps!

Feature requests

Feature requests introduce whole new features into the app. This requires a lot of work, so these might be turned down if the implementation costs supersede the benefits we expect to see from implementing it. Please do not be disappointed if that happens. It likely has nothing to do with your great request but simply with us and our missing resources!
You can of course always ask someone to implement this feature, because a PR with a working new feature has much higher chances of being merged! :)

Bug reports

Please note that one of the main reasons for why bug reports cannot be addressed is that there's not enough information for us to find and fix the bug you describe, so make sure you try to pinpoint the bug as close as possible.
The ideal bug report for us has two qualities:

  1. The bug is always reproducible, at least within a certain context. 2. We know exactly what specifically goes wrong, and there is consensus on
    what should happen instead.

Please note that if you encounter behaviour that does not align with your expectations of what would happen, this might as well be simply intended behaviour and we need to simply clarify why the behaviour is the way it is. This is not to be considered a bug and such issues may be closed! Suggest an enhancement instead!
But now, have a great day and thank you again!

@tkna91
Copy link
Author

tkna91 commented Apr 11, 2023

I noticed that the above suggestion makes it ambiguous in the user experience whether or not the directory properties are specified to be sorted.

It might be nice to have a single drop-down list area for the sort format that can be specified in the directory properties, and add Sort by default at the top level there.
In the following manner.

Before:

  • Left drop-down list
    • Sort by name
    • Sort by time
  • Right drop-down list
    • ascending
    • descending

20230411-105230_screenshot

After:

  • Merged drop-down list
    • Sort by default
    • Sort by name - ascending
    • Sort by name - descending
    • Sort by time - ascending
    • Sort by time - descending

@nathanlesage
Copy link
Member

@tkna91 That's a very good suggestion, I like it. Would also incidentally make the required code simpler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This is a completely new feature for Zettlr.
Projects
None yet
Development

No branches or pull requests

2 participants