joplin
joplin copied to clipboard
Mobile: Resolves #4989: Implement sorting of notes
The mobile apps do not currently have the ability to edit the custom sort of notes (even though these are displayed and function correctly if performed first on Desktop and then synchronized). This is pretty necessary for my personal usage of the app so I've implemented it myself and sharing my solution. I'm open to changing how it all works to conform more to the rest of the app if necessary.
Related issue: https://github.com/laurent22/joplin/issues/4989
Note sorting is implemented by a long-press and drag gesture.
If the current sorting is not "Custom Sort", the user is prompted with a message similar to Desktop.
joplin-sorting-message-demo.webm
The original long-press to select is replaced with a swipe gesture. I'm open to making this a setting or something, or maybe we can add a right-swipe menu that includes many actions (delete, duplicate, move, select many).
The drag and drop of notes is nice, but unfortunately we then lose the existing long press. Isn't it possible to keep both? If you long press and move the note, you drag and drop it, but if you don't move you open the menu. I think that's how it's generally handled in mobile apps.
If the current sorting is not "Custom Sort", the user is prompted with a message similar to Desktop.
It displays a menu, but the "OK" button seems to be grayed out?
Okay I've kind of combined the two gestures. Now the drag will just start if you've started dragging the item, and the long press is back but won't trigger if you're dragging an item. Not quite sure of the best way to do long-press-then-drag, so if anyone's got suggestions we can try them. Also not sure why your "OK" is greyed out, seems fine on my end:
Tested on my actual phone too.
I've been trying to get this working on my laptop but there are so many issues I couldn't. Was it building for you, and did you commit all the changes? For example, I had to add packages to package.json, remove some variables that weren't in use, etc. But even after that, I'm still getting this error:
And I don't know how to fix this. If you're interested in getting this PR working I put my changes in this branch, including resolved conflicts:
https://github.com/laurent22/joplin/commits/jcgurango-feature/mobile-sorting
@laurent22 Rebased and it's building for me now. Turns out my initial implementation for combining the gestures fell apart when scrolling (i.e. when the list doesn't all fit on the screen). Tried several different ways involving a GestureDetector, composing gestures, etc. This was the best I could come up with, I don't think we're gonna be able to get it to be more responsive than this without some extensive reengineering.
This was the best I could come up with, I don't think we're gonna be able to get it to be more responsive than this without some extensive reengineering.
So what is the issue with the current implementation?
@laurent22 it's usable, just that you have to long press and release instead of just long pressing.
@laurent22 Would it be possible to merge this for release 2.12?
Manual sorting is a prerequisite for several note taking workflows not yet possible on mobile and certainly a long-awaited and appreciated feature.
Even if usability is not optimal yet, it would be great if this would be enabled at all. Thank you for the great work!
@jcgurango, sorry for taking time to review this. I would like to test the change on simulator - would you mind fixing the conflict so that the branch can be built?
@jcgurango, I'm going to close this pull request for now, but feel free to let me know if you'd like to get it working again