atlas-engineer / nyxt

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

Add a multiple selection system #405

Closed alexherbo2 closed 6 months ago

alexherbo2 commented 4 years ago

Here are some visual examples.

Download 3-gatsu no Lion episodes from HorribleSubs

Download 3-gatsu no Lion episodes from HorribleSubs

Extract from Wikipedia the list of cities and towns in Russia

Extract from Wikipedia the list of cities and towns in Russia

Quickly move around a document with no table of contents

Quickly move around a document with no table of contents

Opening links in a paragraph

Opening links in a paragraph

Play videos with mpv

Play videos with mpv

Ambrevar commented 4 years ago

Great samples! :)

Hmm... This makes me realize that this is no more than a cross-bread between link hints and minibuffer multi selection.

In other words: once we have minibuffer multi selection (#395) and overhauled the link hints (#354), we only need to add a "persist hint" action to the link hint commands, bound to, say, C-x C-s.

Example:

would persist hints on all links matching "720p".

would persist link 1 and 3 matching 720p.

Makes sense?

From there, any hint-based command can reused the currently persisted hints. Et voilà! :)

alexherbo2 commented 4 years ago

Not exactly. Selecting 720p magnet links is actually much more complex. There is no 720p links.

Here are each step done:

  1. Focus a link
  2. Create a selection out of the active element
  3. Extend selections until hitting the whole list
  4. Split selections on each item
  5. Click on them to open sub-menus
  6. Select sub-entries (480p, 720p, 1080p)
  7. Keep selections matching 720p in their description
  8. Select all links within selections
  9. Keep selections matching Magnet in their description
  10. Open magnets

https://horriblesubs.info/shows/3-gatsu-no-lion/

Ambrevar commented 4 years ago

Then having a "click-all-hints" that simulate a click on all hints would work, wouldn't it?

alexherbo2 commented 4 years ago

No xD

The problem in that specific example is there is no 720p to click for. It’s a plain text element. To download all 720p of the serie we have to select their container and within them, select all Magnet links.

So click-all-hints will work, but the issue I faced when I was on the page was to get the links. xD

Ambrevar commented 4 years ago

So how did you do it?

Ambrevar commented 4 years ago

I mean, how do you define a "selection" precisely?

alexherbo2 commented 4 years ago

Like this. The selection system is inspired by Kakoune.

jmercouris commented 2 years ago

We now have multiple selection thanks to the prompt buffer :-) please feel free to reopen if there is something we are missing!

Ambrevar commented 2 years ago

@jmercouris The title may be misleading, but here "multiple selection" refers to something else. In particular, most of the examples given in the original post are not possible today with Nyxt.

aadcg commented 2 years ago

Doesn't expedition mode and element frame cover this?

jmercouris commented 2 years ago

I'm not completely certain, but I do believe so.

Ambrevar commented 2 years ago

No, there is a small overlap but the original post multiple selection system has some features reminding of Emacs multiple cursor. It would be useful to have and we have nothing close to this concept.

aadcg commented 6 months ago

The topic for a Nyxt extension.