-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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: Assign note to Notebook or Sub_Notebook functionality added #2566
Conversation
Special thanks to @tessus for helping me out for every query. I seek to participate in Google Summer of Code and work with Joplin. |
The animated gif doesn't seem to work. How does your code handle sub notebooks? |
I'm not sure but the animated gif only shows how a note is created. This PR is for moving one or more notes to an existing folder. |
Hey @laurent22, Thanks for asking. I just updated the GIF, actually it was not the whole GIF earlier. Now you can see we can assign note to any notebook or sub notebook. |
Hey @tessus, actually it was not the whole GIF earlier. Now you can see we can assign note to any notebook or sub notebook. |
Thanks for the new gif. I have 2 questions:
|
There must be a code already available that does the folder list with indentions. The web clipper allows you to choose a folder from a list which has the proper structure. It's also available on the mobile client, when you move a note to a different folder. These 2 just don't allow you to search. But maybe the indention is just a stupid idea, but I like it when I have a structure. |
Search implementation is already done @tessus . If you want the subfolders indented too? I can work on that. |
Ok, I can see it now. It's just a bit confusing, because in the beginning, when there's just an
Let's wait for Laurent's input. |
Hi @coderrsid the text in the video is small. Is it possible to zoom into the relevant part of screen to show clearly what is happening? |
@tessus. It's the defaultValue.. which i have set to the folder[0] (first folder in the list), I can change it to empty value too |
Yep, I think it should be empty by default, in which case it should show all folders (with indention). As soon as you start typing only the results are shown. And they don't have to be indented. |
When I come to think of it, we have missed something: Folders can have the same name. Take the following structure:
When you search for
Even with indention, we can't solve this problem. |
Yes it should be indented. Please have a look at how it's done in the clipper for example. |
I believe that too.. @tessus . |
Yeah i'll have a look. Can you direct me to the clipper source indent files ? |
@laurent22 . I tried changing the code according to the clipper but it seems that the function But when i tried to |
Yes, but there are a few ideas that will solve the problem. |
Yeah @tessus. One way it can be solved is by indenting folders like in the clipper @laurent22 suggested by using depth property. We can change the title of the folder in the display by which it shows the name like the image below according to the hierarchy |
No, I think you do not understand. Look at my example above. When you search for
Even with indention it would look like this:
So, how exactly does this help? There are 2 issues here:
I'm talking about the 2nd item. Indention will do nothing. So you will have to find a solution.
Do you understand what I'm trying to say? |
Yeah yeah i do understand what you're saying instead of parent's name after child.
I'd prefer this though? What do you suggest? |
Hmm, not a bad idea, but I think you meant:
Yes, this is also a solution. Mine was just an example. And since we most likely won't have too many duplicates anyway, the list should not be too long. Theoretically you could even use this algorithm for non duplicates. In that case it would be awesome, if we could only jump between the active ones, so that one doesn't have to hit 6x the down key to actually reach the 3rd result. |
Yeah sure we can. That's why i suggested this method. Disabling items will lead to an easy search and will show the parent of sub-notebook too and as you said for moving down in the list too. Can we confirm this from @laurent22 too? |
Yep, Laurent should definitely chime in. |
Yes, but using the mouse it won't be so much fun. I think the concise option you first suggested is preferable. |
Well, |
@coderrsid, you need to dig deeper here. The library doesn't support what you need? Then perhaps create a pull request on their repo to support it, or create a patch, or try a different component, etc. We can make suggestions on how to fix it, but you need to make some too, and try alternatives by yourself. It needs to work with a notebook hierarchy, or if it's not possible we close the pull request. So please confirm if you're still interested looking into it. |
@laurent22 Thanks for replying. Yeah sure I can dig deeper. It's just that i want us to stay on the same page. It shouldn't be like i spend some hours onto something which is not permissible and PackElend explicitly mentioned to communicate. That's why i am asking you guys for every step. Sorry if i am making it too much of a trouble. 😄 PS: I am working on this PR |
I tried almost every method but unfortunately i guess the |
@PackElend soo what else can we do? |
is there an alternative library? |
yes, if we do try to find but instead of adding another library or package, can't. we render a JSX based select instead of using it from a library for just this case |
this not my call, I cannot help here. |
Ohh sure @PackElend, i am happy for your participation. |
I am going to be personally frank, I’ve been following this PR for a good while now and am exhausted of it. @coderrsid, if you can endure and follow through here, i will be impressed and amazed and would pretty much accept anything you want to do with Joplin for your project but also see that you failing would be a massive time sink for everyone involved here. I hope you get this completed and prove my fears and concerns wrong. On the library question, I’m more than willing to help you figure that out but would also need to research it a bit because I don’t fully understand what all this PR is attempting to do just yet. I also know that many react native libraries seem to be getting abandoned as Facebook, its developer and maintainer, break compatibility through updates and whatnot. |
Thanks @bedwardly-down . I will try my best for that.
We are just adding a functionality of assigning single or multiple notes to a notebook directly without the use of mouse-drag but using a dropdown like shown in the description of PR. instead ofbut the package
|
@coderrsid, should we close this pull request as it's been nearly a month, many comments and people involved and it's still not done. Maybe it's too complicated to implement so it's perhaps time to cut our losses and close? |
@laurent22 , please do not close this pull request, i am trying different libraries like |
Time is rare these days so you can continue working on it but Laurent won't react so please do not mention him anymore in this PR. Your efforts and successful PRs have been recognized no worries :) |
Yeah i know PackElend, sure i won't. I'll just try to implement it myself and i'll come with a solution very very soon. But please don't close this pull request. I've been working on this too along with everyone. |
Hello, It leverages the styling API (https://react-select.com/styles) of The commit with the changes can be found here: Jackymancs4@063a164 in https://github.com/Jackymancs4/joplin/tree/develop/assign-notebook The code is just a mockup. To be functional this line https://github.com/Jackymancs4/joplin/blob/063a1649a0d2459ff62b746cb698163d52b52320/ElectronClient/gui/MainScreen.jsx#L215 needs to implement a proper logic to return the depth level of any notebook. I hope this helps. |
Hey @Jackymancs4 , thank you so much for figuring that out. You're right, it's about the styles in package. I tried implying the code by passing folder's indentDepth values in
and the changes in
But still when i I tried your way laurent as it is implied in Clipper. Can you tell why this is happening? |
Well, this happen because In my last commit here 979e8ec you can see a viable solution using There I also added a mechanism to limit notebook depth, for good measure. |
Well, thanks for the viable solution and i just tried testing the changes, it renders them perfectly i'll just push the changes with some changes in styles. Thanks @Jackymancs4 for helping out big here! |
@coderrsid, there's some issue with the sorting order: #3052 Do you know what might be the problem? |
Sure laurent, i'll just look into it. |
Fixed Issue #2296
This pull request add the functionality of assigning note to another notebook.
WORKING