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

Resolve #1029: Support files and folders to be dragged in externally … #1040

Merged

Conversation

RayZhao1998
Copy link
Collaborator

Description

Resolve #1029

  • Support files and folders to be dragged in externally into project navigator.
  • Support holding option while dropping to copy.

Related Issue

Checklist

  • I read and understood the contributing guide as well as the code of conduct
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • I documented my code
  • Review requested

Screenshots

2023-02-05.22.45.08.mov

…externally into project navigator

* Support holding option while dropping to copy
@RayZhao1998 RayZhao1998 force-pushed the feature/move-from-external branch from 0283300 to d98b4fd Compare February 5, 2023 15:01
@matthijseikelenboom
Copy link
Contributor

Does the option + drop also works from Finder to CodeEdit? In the video I only saw it happening within CodeEdit.

Copy link
Collaborator

@thecoolwinter thecoolwinter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm getting the following error for some folders:

*** Canceling drag because exception 'NSInternalInconsistencyException' (reason 'readFromFileWrapper:ofType:error: must be overridden by class CodeFileDocument for your application to handle file packages.') was raised during a dragging session

@RayZhao1998
Copy link
Collaborator Author

I'm getting the following error for some folders:

*** Canceling drag because exception 'NSInternalInconsistencyException' (reason 'readFromFileWrapper:ofType:error: must be overridden by class CodeFileDocument for your application to handle file packages.') was raised during a dragging session

Do you have any more information such as crash stack?

@RayZhao1998
Copy link
Collaborator Author

Does the option + drop also works from Finder to CodeEdit? In the video I only saw it happening within CodeEdit.

Yes, it works. But as mentioned here, I need to try to show + when dragging with option clicked.

@austincondiff
Copy link
Collaborator

austincondiff commented Feb 9, 2023

@RayZhao1998 From your video, I am not sure when you are holding ⌥. When holding ⌥, the cursor should change to the copy cursor as shown below to indicate the file will be copied.

image

(Also see this for reference).

Edit: I see from your comment above that you are aware of this.

@austincondiff
Copy link
Collaborator

austincondiff commented Feb 9, 2023

When dragging from external sources, I notice that the file animates back to it's source on drop (even though the source disappears). This is not expected behavior, even when copying. Try dragging between two Finder windows to see for yourself.

@thecoolwinter
Copy link
Collaborator

I'm getting the following error for some folders:

*** Canceling drag because exception 'NSInternalInconsistencyException' (reason 'readFromFileWrapper:ofType:error: must be overridden by class CodeFileDocument for your application to handle file packages.') was raised during a dragging session

Do you have any more information such as crash stack?

It wasn't crashing entirely just throwing this error (wasn't even cancelling the drag), I can't reproduce it anymore either which is weird. Actually though, the documentation says this should have a default implementation and it doesn't even look like we're using the NSFileWrapper API. Since it's not crashing and still functional I'm okay ignoring this for now.

thecoolwinter
thecoolwinter previously approved these changes Feb 10, 2023
@thecoolwinter thecoolwinter enabled auto-merge (squash) February 10, 2023 18:39
Copy link
Collaborator

@austincondiff austincondiff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, see previous comments. After that we can merge.

@RayZhao1998
Copy link
Collaborator Author

Updated.

default.mov

Copy link
Collaborator

@austincondiff austincondiff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making those changes, nice work!

@austincondiff austincondiff merged commit 17591e7 into CodeEditApp:main Feb 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

✨ Support files and folders to be dragged in externally into project navigator
4 participants