WordPress / wordpress-playground

Run WordPress in the browser via WebAssembly PHP
https://w.org/playground/
GNU General Public License v2.0
1.58k stars 223 forks source link

Filesystem explorer #1533

Open bgrgicak opened 2 weeks ago

bgrgicak commented 2 weeks ago

In a server environment, it's easy to browse files on the server with FTP/SSH, but there is no equivalent in Playground.

We can do it today in the browser console using function calls like await playground.listFiles('/wordpress'), but it's not documented and it's a bad user experience.

What if Playground had a file explorer similar to the OPFS browser extension?

It could be a modal that lists all files and folders in the root folder. By clicking on a folder it would expand the folder and show its content. A file click could open the file in a new tab.

adamziel commented 6 days ago

Building a file explorer is much more complex than it seems. There's async data loading, reordering files, moving between directories, collapse/uncollapse interactions with drag and drop, mobile support, keyboard navigation for accessibility, handling uploads, downloads, renaming, deleting etc. I'd rather look for ways to avoid that work.

adamziel commented 6 days ago

Oh, these plugins could be useful to mention in the docs, cc @juanmaguitar @ndiego

juanmaguitar commented 6 days ago

Oh, these plugins could be useful to mention in the docs

Yes! I agree this is a great resource to help understand/debug a playground instance, for example, those that write files via blueprint.

Although, I'm not sure where to place this type of info in the docs. Some options could be:

adamziel commented 4 days ago

@juanmaguitar I could be one of the basic use-cases for the "build" audience, as in "how do I manage the Playground files directly?" If not, then debug and troubleshoot sounds right.