Skip to content

Implement a filtered view for interactive-search.#3746

Closed
mtwebster wants to merge 2 commits into
linuxmint:masterfrom
mtwebster:filter-bar-interactive
Closed

Implement a filtered view for interactive-search.#3746
mtwebster wants to merge 2 commits into
linuxmint:masterfrom
mtwebster:filter-bar-interactive

Conversation

@mtwebster

Copy link
Copy Markdown
Member

This would replace the current interactive search feature (typing to restrict selection to filenames beginning with the typed text), except for the desktop view.

Instead, typing would show an entry as before, but now:

  • The view will actively filter out non-matching files.
  • Matches will by made and scored using the 'fzy' matching algorithm based on https://github.com/jhawthorn/fzy.
  • Matching characters will be highlighted (bold) within the filename in the resulting list.
  • Focus/navigation remains in the view so keyboard navigation can still be performed while the filter is active.
  • Deleting (backspace) all text from the filter hides the filter and restores the normal view.

ref: #3714, #507

@mtwebster mtwebster force-pushed the filter-bar-interactive branch 3 times, most recently from 1baf22a to f3de52d Compare March 26, 2026 14:46
@Jeremy7701

Jeremy7701 commented Mar 26, 2026

Copy link
Copy Markdown
Contributor
  1. If I want to search using a partial file name, will it be possible to do this without an algorithm intruding into the search and sorting the output?
  2. Will a recursive search be possible?
  3. Will a case sensitive search be possible?
    The current search locates the search string anywhere within the filename - not just matching from the first character.
    Why is a change necessary?

@mtwebster

Copy link
Copy Markdown
Member Author

This is to replace the current interactive search for the current view, it has nothing to do with the real search/content search (control-F), and only applies to the current view (non-recursive). It's to aid selection not finding - you know the file probably exists.

The current interactive search ('just start typing') only matches starting characters in a filename. #3714 aimed to make that match anywhere in a filename, which I felt is more of a hindrance than an improvement, since it can result in meaningless matches you need to navigate past to get to the file you wanted.

@mtwebster mtwebster force-pushed the filter-bar-interactive branch 3 times, most recently from 0ee6b43 to d193866 Compare March 26, 2026 17:35
@Jeremy7701

Copy link
Copy Markdown
Contributor

I wasn't aware of this file positioning function!

Obviously I have never used it, and for me, the old version is sufficient.
Please ignore all my previous comments as they aren't relevant.

mtwebster added 2 commits May 19, 2026 12:18
This would replace the current interactive search feature (typing
to restrict selection to filenames beginning with the typed text),
except for the desktop view.

Instead, typing would show an entry as before, but now:

- The view will actively filter out non-matching files.
- Matches will by made and scored using the 'fzy' matching algorithm
  based on https://github.com/jhawthorn/fzy.
- Matching characters will be highlighted (bold) within the filename
  in the resulting list.
- Focus/navigation remains in the view so keyboard navigation can still
  be performed while the filter is active.
- Deleting (backspace) all text from the filter hides the filter and
  restores the normal view.

ref: linuxmint#3714, linuxmint#507
@mtwebster mtwebster force-pushed the filter-bar-interactive branch from d193866 to 7c6c25b Compare May 19, 2026 16:18
@mtwebster

Copy link
Copy Markdown
Member Author

merged: 11df68c

@mtwebster mtwebster closed this May 29, 2026
@nioncode

Copy link
Copy Markdown

Sorry, I only got around to testing this now. The functionality in generally works fine, thank you :)

However, it does not really solve my original use case (neither does my proposed #3714): navigating a directory tree fast. I'm not sure whether I should open a separate issue for this or where to discuss this best, please let me know the best place to put this (since this closed MR is certainly not the correct place).

Let's assume the following directory tree:

.
├── bar
└── foo
    ├── aa
    └── baz
        ├── bb
        └── target

What I currently have to do with this feature:

  • type 'fo' to filter
  • hit 'arrow down' to select the foo folder
  • hit 'enter' to enter the directory
  • type 'ba' to filter
  • hit 'arrow down' to select the baz folder
  • hit 'enter' to enter the directory
  • type 'ta' to filter
  • hit 'arrow down' to select the target folder
  • hit 'enter' to enter the directory

I'd like to get rid of having to hit 'arrow down' to select the directory, since this requires moving my hand to the arrow block on the keyboard and then back to the 'main area' (don't know how to describe it best). On my old file browser (spacefm), the first entry in the view is always selected by default (although it is a kind of 'soft selection', i.e. it is not completely highlighted, but only drawn with a border; I don't know what the difference is between those states though), so you can just hit enter directly whenever you enter a directory and you want to go into the first folder (or the first match after typing).

Do you think it makes sense to add a similar behavior to nemo, so that you can:

    1. navigate a deep directory tree just by hitting 'enter' multiple times (as long as you just want to go into the first directory, which is common for many java repositories that e.g. start with src/main/com/github/package
    1. directly enter a directory after having filtered the view to a match without having to hit 'arrow down'

@mtwebster

Copy link
Copy Markdown
Member Author

@nioncode I just made a change to the filter view - it will automatically select the first item when the text changes.

bc0c8cc

@Jeremy7701

Copy link
Copy Markdown
Contributor

Will some detailed documentation be available when the new filter option is released?

@mtwebster

Copy link
Copy Markdown
Member Author

I don't think that's necessary, there's not much to it.

@nioncode

nioncode commented Jun 2, 2026

Copy link
Copy Markdown

@mtwebster your commit looks great!

Would it also make sense to always select the first file/directory by default (independent from this interactive search feature) so that hitting enter repeatedly allows to traverse a tree of src/main/java/com/github/nioncode/my-project/ simply by hitting enter a few times without needing to hit arrow down in each directory?

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.

3 participants