Allow selecting MIME type for attribute queries independently of searched file type in Find

Currently, the Find application determines which attributes are available for queries based on the MIME type of the files being searched. While this works well for typical use cases, it creates a limitation for advanced workflows, particularly when working with symbolic links that have specialized attributes.

Use Case:

When adding audio attributes (e.g., Audio:Artist, Audio:Album, Audio:Track) to symbolic links pointing to audio files on non-BFS filesystems, these attributes are stored successfully on the symlinks themselves. However, the Find tool only offers generic symlink attributes for querying, not audio attributes, because symlinks have the MIME type application/x-vnd.Be-symlink.

This prevents users from querying symlinks by their audio metadata using the convenient “by attribute” interface

Proposed Solution:

Add a MIME type selector to the Find interface that allows users to choose which set of attributes to query, independently of the file type being searched.

UI Mockup Suggestion:

In the “by attribute” view (see attached screenshot), add a dropdown menu or BMenuField above the attribute list:

Options could include:

  • “Auto (match searched type)” - current default behavior

  • List of all MIME types (each having a specific list of attributes)

Benefits:

  1. Improved usability: Makes the intuitive “by attribute” interface available for cross-MIME-type queries

  2. Flexible: Supports custom attribute workflows and edge cases

  3. Backward compatible: Default behavior remains unchanged

What do you think about this proposal ?

I would like to know - before moving forward - if this kind of enhancement makes sense with the current Find module :

3 Likes

I like the idea.

Not sure we need another dropdown menu in the “by attribute” view. Or I don’t quite understand how you imagine it.

See last paragraph of [GSoC 2024] Improving the Tracker Query Window - #17 by humdinger . The added “Other” menu item at the bottom of the attributes list would contain all attributes in the system. All indexed attributes that is, because only these can be searched by query. While limiting, it should simplify listing all possible attributes.

It all depends on how complex you want to make the simple case.

I don’t have Haiku here and now, but I think you can get that search by building the query for audio files and, before executing, changing to formula mode and removing the BEOS:TYPE predicate.

In fact, you can query any attribute, as long as the query contains at least one indexed attribute.

I know the formula mode.

I was talking on how to use and improve only the attributes mode, because this mode makes the hypothesis that the attribute you search is linked to the mime type of the file - which is not true in this case :slight_smile:

I would like to focus only on this mode because if we can find a « simple » way to answer the question in the gui, it could be used more often and more easily by users.

Ok I understand the idea but having all attributes displayed wouldn’t it be too much in the gui ?

How to organize them ?

That’s why I had the idea to organize them by mime type but that’s a proposal, maybe I need to present a screen for this mock to clarify the idea :slight_smile:

Yes, I get it. I can’t even say I’m against it. Eh, I’m not an UI guy, so even if I had a hard opinion, it wouldn’t really matter. What I mean is that you can always find a use case for which the UI is almost there and be tempted to improve it. And then one day after a few of such small changes you notice new users are not using the Find window because it’s too complicated. So you have to be careful when you want to expand the possible uses.

You can also say you can’t search on attributes that are not assigned to any mime type. I may, for example, give a deletion date to my files via an attribute and want to know which files are to be deleted next week. Even with your solution I wouldn’t still be able to do it in that window.

Your use of links as a kind of dopplegĂ€nger looks to me as a contraption, something much more obscure than my example. But then we don’t have a transparent fallback for filesystems that don’t support our attributes, so it’s at least a good workaround for your case, most of the times.

Below is the quick mock up to test the idea :

Before : You select the file type and then you don’t have any further choice : you must select the attributes corresponding to this file type:

After :

You select the filetype and by default the “attribute mime type “ is the one corresponding to the file type (symlink as above)

1 . However, you can optionally change the “attribute mime type” as below (to audio for instance) :

  1. Then the attributes are changed accordingly to the user request :

That could make the “attributes mode” GUI more versatile, but that’s my opinion

Organizing attributes by mime type would mimic the previous behavior, but I’m not sure if it would not make the GUI more complex to understand by a user.

Having an “Any” option, along with Name/Size/Modified in your Before example, wouldn®t work the same way and reduce things in the window ?

Symbolic Links, with Any attribute containing “bla” > Search ?

What I would do is list other filetypes in the same menu as attributes. At the top of the menu you have a list of attributes that are associated with the filetypes you are querying (inyour example, only symlink attributes).

Below that, you get a separator and then a list of mime type submenus, where you can dive in for more attributes if needed. Maybe even in a “More
” submenu. I think your use case with symlinks is specific enough that it is better implemented this way, not disrupting the basic use case too much. Having to select the mime type twice in the normal flow seems too confusing.

Another possibility :

1/ Select the Audio type and the list of attributes to query :

2/ With a new “lock attributes” tick option when I switch to another type like “symlink” then I can use the same attributes and do the query :

EDIT : the lock attribute option can be very granular, instead it can be by attribute :

The user can tick/untick an attribute if he wants to keep it when changing the type of file

3/ At the end this window can be saved up to the nice “save as template” feature

Maybe this option is more suited ?

Right. Forgot about that
 :slight_smile:

OTOH, this would be very hard to convey in a GUI. Add a “You need to query on at least one indexed attribute”? The user wonders, “What’s an ‘indexed attribute’?”


Also, how would you build the list of “other” attributes, i.e. those that are not linked to a MIME type in the FileTypes prefs? As it could be any custom attribute added to any file, you’d have to works through every file in the system.

Limiting to indexed attributes - while not perfect for every use case - gives the user at least the power to use those attributes on arbitrary files. For example, you could add a MEDIA:Rating to your PDF files or search for META:url on ZIP archives you downloaded with Web+ (which adds this attribute to all downloaded files).

If I understand it right, this feels a bit convoluted


Why not query for “symbolic link” “by attribute” and choose the attributes you want from the new “Other” menu that will be present for every MIME-Type and lists all indexed attributes (among those Audio:Artist and Media:Title)?

Ok if I understand correctly, if a user select the “symbolic link” type as below:

At the end of the pop-up menu (after “modified”) a new “other” entry will propose the mime-type hierarchy like this before having the attributes ?

However If I have an attribute relative to “audio” and another one relative to “audio/AC3 audio file”, it’s a bit complex to browse the possible attribute list.

Or maybe make a distinction between “mime-type group” (like audio) to propose first with attributes, versus “mime-type leaf” (like “audio/AC3 audio file”) to propose after the groups ?

Another approach is to display all mime-type without hierarchy but I fear there will be too much lines


Or do you mean to list all the indexed attributes directly without hierarchy?

Not easy to find the correct GUI approach :slight_smile:

While attributes can be created in the FileTypes preferences under specific MIME types (like Audio:Artist for the “audio/*” supertype), you can add any attribute to any file and query for it

To make the new “Other
” menu better navigable, I’d suggest to sort those attributes into submenus according to their “supername”. Doing a “lsindex” shows Audio:, BEOS:, MAIL:, META:, Media:, plus a few special cases like _trk/qrylastchange and _trk/recentQuery.

Ok I see, thanks for this proposal, it’s clear now :slight_smile: