-
Notifications
You must be signed in to change notification settings - Fork 371
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
Add initial drag n drop implementation (Wiki mode, local space) #889
Add initial drag n drop implementation (Wiki mode, local space) #889
Conversation
Add folder drag and drop Add note drag and drop Add note and folder to workspace drag and drop Add a note on a note drag and drop Add rename folder error handling (same folder pathname exists) Add drag leave for folder/workspace/note leave event (dragged over effect)
newFolderPathname | ||
) | ||
.then(() => { | ||
// refresh works for file system (FSNote) database |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dunno why, looked over code from Pouch and FSNote, seems similar, update is done on storage level,
But notes are not seen after dragging the folder into another place (it refreshes the folder location but sub-folders and notes disappear from view in Pouch DB. After Ctrl+R
- reload, they are correctly placed in the new destination place.
}) | ||
} | ||
|
||
const handleDropNavigatorItem = (event: React.DragEvent) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code repeats in 3 places, but not sure how to refactor - should I send updateNote
and renameFolder
functions to a utility function, and then it can handle all details for all three usages (on note/folder/workspace drop)?
Another thing that comes to mind is to wrap the NavigatorItem
component and use that everywhere. And in the wrapper provide all drag-drop functionality if parent enables it, in that way logic would be in Wrapper and those items folder/note/workspace can use the wrapper to add NavigatorItem
with drag and drop?
Closing in favor of new sidebar with it's implementation already merged. |
@Komediruzecki For reference, do you have by any chance the PR number for that new sidebar impl ? |
Hi ithinuel, Yes, but the PR is for whole local space refactor, it uses cloud/shared sidebar and implement local space needed setup for the shared component. This one: #948 |
Add initial drag n drop implementation (#860, #575, #690, #571)
Add folder drag and drop
Add note drag and drop
Add note and folder to workspace drag and drop
Add a note to a note drag and drop
Add rename folder error handling (same folder pathname exists)
Add drag leave for folder/workspace/note leave event (dragged over effect)
Demo:
https://user-images.githubusercontent.com/18196945/113562045-c344c900-9605-11eb-9049-c06940a33de3.mp4
Open Points:
Tested in