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

Always open dropped files if possible #850

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

humphd
Copy link

@humphd humphd commented Jul 21, 2017

Fixes https://github.com/mozilla/thimble.mozilla.org/issues/2316. Try this out and see what you think. One thing I don't love is that it flashes through opening all the files when you import a .zip, which I think is a bit jarring. Maybe we should add some code here to pick the best file to open when you have many and only open that one? For example, prefer an .html but then have a sliding scale for different types.

Please test this multiple ways:

  • drag and drop 1 file into file tree
  • drag multiple files and/or a folder into the file tree (folders only work in some browsers)
  • use bramble.showUploadDialog() and use the drop area and "from computer"
  • repeat all of about with a .zip and .tar file

@humphd humphd requested a review from flukeout July 21, 2017 15:39
@humphd
Copy link
Author

humphd commented Jul 21, 2017

I made a mistake on this, but have fixed it now. Travis should be passing.

@humphd humphd self-assigned this Jul 21, 2017
@flukeout
Copy link

Testing this from the Vancouver airport as I wait for a flight and it works great. Files open as expected after dragging them in.

Another option for the ZIP case would be just to not do this at all. Can we skip doing this for ZIPs? Reason is we can avoid some complexity in trying to figure out the "right file" and also in an archive there are usually a bunch of files, so there isn't this expectation that I want to see that one file open like I would with a single added image etc. In the single-image cases this works great. It's also a good way to discover some of our new viewers for users.

Lastly, after dragging in a file, the viewer opens, but the file it's showing doesn't get "selected" in the File Tree. See below, for a file I just dragged in "_blam.gif"

image

Copy link

@flukeout flukeout left a comment

Choose a reason for hiding this comment

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

Well since I have to add comment if I'm requesting changes:

  • Highlight the opened file in the Filetree view
  • Don't open any files after importing a ZIP

@humphd
Copy link
Author

humphd commented Aug 1, 2017

@flukeout made some changes, still can't get the "select when open" to always work, it's a bug deep in Brackets I can't quite find. However, the zip/tar case should work now.

@humphd humphd requested a review from flukeout August 1, 2017 17:12
@flukeout
Copy link

flukeout commented Aug 1, 2017

Awesome, retesting.

@flukeout
Copy link

flukeout commented Aug 1, 2017

Hey @humphd - give this a try with a css file. For me, it doesn't open a css file after dragging it in, getting this error in the console...

This is on src/hosted just running brackets in mac after clearing the application storage.

It also throws that error when I try to switch to that file (or, also HTML files) after uploading it. It's cleared up after reloading the editor. I confirmed that this happens only within this branch, and not when running on master.

Copy link

@flukeout flukeout left a comment

Choose a reason for hiding this comment

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

Please see comments I left regarding JS error on CSS/HTML files.

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.

2 participants