atlas-engineer / nyxt

Nyxt - the hacker's browser.
https://nyxt-browser.com/
9.86k stars 413 forks source link

Multiple file select - builtin file chooser #3069

Closed jonnieey closed 1 year ago

jonnieey commented 1 year ago

Problem I cannot attach multiple files at once using the built in file chooser

Solution use regex to attach. Ex, /home/user/docs/*.pdf to attach all pdfs in the directory. or allow selection of multiple files in prompt buffer

Alternatives considered Selecting file one by one,

jmercouris commented 1 year ago

Hello, thank you for your report, what happens if you press M-a within the built in selection dialog, does that work for you? Can you specify which command you are using the file chooser with?

aadcg commented 1 year ago

@jonnieey thanks for the input. This is a general issue regarding the prompt buffer. We have thought about this in the past and we don't support regex syntax for some reasons. It would be relatively easy to do it though - a matter of writing a function (relying on cl-ppcre) and set it to prompter:filter-preprocessor.

I second @jmercouris' advice to give M-a, M-u and M-m a try. Notice that when you write pdf in the prompt buffer's input area, it will match against all files that have that extension.

jonnieey commented 1 year ago

Hello, thank you for your report, what happens if you press M-a within the built in selection dialog, does that work for you? Can you specify which command you are using the file chooser with?

so i want to upload a file to a website, i press the upload button and the file to input prompt appears. The command used is default, i guess.

I'm using vi-mode too.

M-a, M-m or M-u don't do anything

jmercouris commented 1 year ago

I see, I think you can only upload a single file at a time in those forms. I don't think they select multiple files, I could be wrong though.

aadcg commented 1 year ago

@jmercouris it should be possible. See process-file-chooser-request.

@jonnieey could you provide a recipe to reproduce this issue? Thanks.

jonnieey commented 1 year ago

I see, I think you can only upload a single file at a time in those forms. I don't think they select multiple files, I could be wrong though.

Yeah, just tested on another website and M-a works. To filter you just have to type extension and press M-a. /home/user/docs/pdf then press M-a

jonnieey commented 1 year ago

@jmercouris it should be possible. See process-file-chooser-request.

@jonnieey could you provide a recipe to reproduce this issue? Thanks.

conversing on google chat. Needed to send some photos but could only do one at a time. When sending an email you can select multiple files.

aadcg commented 1 year ago

It seems that everything's now clear.

@jmercouris should we keep this open in case someone wants to implement regex matching for the prompt buffer? I'd rather close it perhaps.

jonnieey commented 1 year ago

It seems that everything's now clear.

@jmercouris should we keep this open in case someone wants to implement regex matching for the prompt buffer? I'd rather close it perhaps.

Just to mention, in other browsers (qutebrowser) it's possible to select multiple files. On android too.

aadcg commented 1 year ago

To figure out the issue I need to be able to reproduce it. Unfortunately I don't user google chat.

Another way you could help to trace the issue would be to see if you can reproduce it on Gnome Web (also known as epiphany) or the surf browser. This would let us understand whether the issue is due to us or the renderer.

jonnieey commented 1 year ago

To figure out the issue I need to be able to reproduce it. Unfortunately I don't user google chat.

Another way you could help to trace the issue would be to see if you can reproduce it on Gnome Web (also known as epiphany) or the surf browser. This would let us understand whether the issue is due to us or the renderer.

Tested on surf, i get same behaviour. Cannot select multiple on that upload field. Guess it's the renderer then.

aadcg commented 1 year ago

It seems so. Stay tuned, since the next release will support a new renderer - #2989.

Closing this since it's a renderer issue. Thanks @jonnieey!

aartaka commented 1 year ago

Tested on surf, i get same behaviour. Cannot select multiple on that upload field. Guess it's the renderer then.

It's might not even be the renderer—some file inputs only allow one file to upload.

aartaka commented 1 year ago

We are basically following the data that renderer gives us, and the renderer is basically choosing singe/multiple inputs based on what the file input allows.