[haiku-development] Typeahead Filtering in Tracker

  • From: "Michael Lotz" <mmlr@xxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sun, 2 Nov 2008 09:20:04 +0100

Hi There

Since I've implemented filtering in Tracker.NewFS back then I've become
severely dependent on this feature. I'm always a bit lost when I want to
navigate my music, mails and other such collections under Haiku, because I
usually keep them all in one folder and then use filtering to get to where I 
want.

The implementation in Tracker.NewFS was pretty simple and only took the
filename into account, but it was enough (depends on your file naming schema).
Since working on the typeahead feature recently I wanted to extend that into
typeahead filtering that would be full fledged filtering based on all visible
attributes.

Therefore I have prepared the attached patch that takes more or less the same
approach I took for Tracker.NewFS, reusing the VSPoseList that stores the
visible poses in icon mode, but is completely unused in list mode. The patch
changes list mode to also use the VSPoseList which then contains the filter
result.

I'm not checking this in directly, because it is a rather extensive patch and
also brings a few usability concerns I'm not really sure how to best move
forward with. I would be glad if some of you could apply and test this patch
and give some feedback.

Usage: Filtering can either be turned "always on" through the preference
"Always Filter in Typeahead Search" under "Window" (defaults to off), or
filtering mode can be entered through a key. When filtering is always on,
starting a typeahead search automatically filters instead of selecting the
best match. If automatic filtering is not activated one has to press (the
arbitrarily choosen) "*" (asterisk) key to enter filtering mode and then just
type ahead to start filtering. I've modified the count view to also show the
count when filtering, to give feedback as to how many entries still match.

Filtering mode is not left automatically in the way normal typeahead is but
stays on until you either press escape or remove all characters from the
typeahead buffer by backspace. This is to allow apps that communicate with
Tracker to make use of the filtering feature. You could for example filter for
a certain set of mails and then use the next/previous buttons in mail to
navigate only this filtered set.

I've found that a pretty intuitive way of working, but I'd really like to hear
from others as well. So please feel invited to test and comment. If we can
agree that we want this feature and the implementation is reasonable for now,
I would like to go ahead and commit this patch.

Regards
Michael

Other related posts: