-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Desktop: Implement "show all notes" #2472
Conversation
I haven't tested the PR yet, but how are the notes sorted? According to the SQL statement they are not sorted at all. Or is this done in the UI anyway? |
The sorting respects the |
@mic704b thx for clarifying this for me |
@tessus you might check the discussion in the github issue, I'd be interested in your opinion too on how we should handle creating notes when viewing all notes. |
Ready for initial review. Tests to be added. Edit: Apologies, late update submitted. |
In the codebase, there's already a concept of "smart filter", which is the same as your "View" concept. It's designed in such a way that any number of smart filters with various rules can be created, including by the user, and the app will display the relevant notes. This concept is only used at the moment to display all the notes in the mobile app, so the code is simplified. Basically if a smart filter is specified, it's assumed it's the "all notes" one, so all notes are displayed without checking anything else. I think you should be able to use the same concept for the desktop app. I'd expect there's not even that much code to change since the filter you need is exactly the same as for the mobile app. Basically you can simply check |
Thanks for the explanation. I had seen the SmartFilter, but didn't realise the intention. Your explanation makes it clearer. Ive now updated the PR attempting to use the SmartFilter. For the "all notes" smart filter, we use the same smart filter id as was nominated in the mobile app. |
@laurent22 I think I need to make the Does that make sense? Is it compatible with your design? In the mobile app, the From
In the desktop app From
I don't want to leave the Please let me know, so I can fix this PR and complete the testing. It should be quick. |
Yes that makes sense and it was indeed the plan. So please go ahead and make it a model. |
The code and manual testing is complete and ready for review. The automated testing is implemented and passes. However there is a side effect where the new tests are interfering with the initialisation of the existing automated tests. I am not sure what is going on so I have commented out the new unit tests temporarily until I can resolve it. |
@laurent22 Ready for review. In completing this, I have introduced backbone "integration" tests.
I may have abused the test framework in getting this to work, so please check it carefully. The way it works is to create a Perhaps going forward, this pattern could be used to test a lot of the pre-existing functionality too. If you are happy with it, I will expand the test cases for this feature (smart filter for show all notes) in a following PR, and maybe update development documentation to encourage others to use the strategy too. Concerning the feature itself, I created a module |
Yes I'm fine with the integration tests, I think they could be useful in particular to test what happens in the middleware. I've noticed that you await baseApplication.dispatch, however dispatch normally is never async. You might have to wait after dispatch though (maybe with timeUtils.sleep?) because the middleware is async. |
That was a mistake. Fixed now. Interesting that it made it work.
Yes, that works. Another way might be with a callback, but this is simpler even if a little less efficient. |
c3c0b65
to
f501395
Compare
Perfect, it's good to merge then, thanks for the PR! |
Thank you! |
Resolves #262 for desktop
Description
All notes
is a new selectable section at the top of the sidebar.All notes
updates the note list to show all notes.All notes
, the currently selected note remains selected.While in
All notes
:Sort notes by
user preference.Example showing behaviour when
All notes
is selected:Design
Implemented as a smart filter. The PR also proposes the introduction of automated integration testing for the backbone.
Tests
Manual tests:
All notes
Comments
This implementation does not deal with requests for showing sub-notebook notes when a notebook is selected.
Doesn't show note count. Future enhancement if required.