By Pomax

September 24, 2024

A new update makes the Glitch editor more convenient than ever #

One of your top requests has hit the Glitch editor: drag in any file, or even an entire folder, and now it’s instantly part of your Glitch project! Try dragging in an entire app and let us know how it works.

New in the Glitch editor:

Teaching a class? Students can make a static HTML file locally, then remix the ultra-simple static website Glitch starter and drag in their file to see it live on the Internet. And now, for some behind the scenes color commentary, here is one of the engineers behind this update!

Hey all, Pomax from the engineering team here. 👋 #

The observant amongst you may have noticed that we landed some recent changes to the way the file tree in the editor works, and while some of those changes were some small bug fixes, others were much bigger, so let’s talk about what got changed. (And if you already noticed some changes, play along at home to see if you found them all!)

You can now move files to the root of your project by simply dragging them from a directory to any part of the file tree that looks like it’d be the root of your project. Before, you could only do this by dropping a file “onto another file that was already in the root” because the file tree’s active region ended right after the last file in the file tree, and that was kind of weird? Not to mention pretty inconvenient… but no longer! Drag-and-drop should be a lot more useful now.

In fact—while we only had drag support for files before, you can now drag entire folders! You can move any folder into and out of any other folder, and all of its content will move along with it. Just remember that the same rule still applies: if you move the last entry out of a folder, that folder gets cleaned up. (That might change in the future, but for now that’s a little gotcha to be aware of!)

Did I mention that you can also drag-and-drop files and folders from your desktop into the Glitch editor? Because you can, and it’s super useful! You may be wondering how that’s different from before, because “didn’t Glitch already have drag and drop uploads?” and that’s true, but only for single files. That’s certainly better than nothing, but it’d be a heck of a lot more convenient if you could just drag and drop an entire folder in, right? And so now you can!

Of course, the same rules for dragging files still apply: if there are any media files in the folder that you’re drag-and-drop uploading, those will still get added as assets instead of as files in the file system.

Lastly, we fixed a bug around file renaming. Some users discovered that they could soft-lock their project by accidentally having a slash too many in their file names, which is obviously not great; typos shouldn’t kill your project. That is no longer the case.

All these changes taken together should hopefully mean things are a lot more pleasant to work with now, but of course, we may have missed something (or even accidentally introduced new bugs!) so if you run into problems, please let us know by filing a support ticket by emailing [email protected].

And we may just be working on some more improvements relating to file management… so stay tuned for future posts!