obsidian-meta-bind-plugin icon indicating copy to clipboard operation
obsidian-meta-bind-plugin copied to clipboard

"Option Tags" Input Field Arguments for use with suggester, list, and select Input Fields.

Open reidgould opened this issue 1 year ago • 3 comments

Please fill out these Check-boxes

  • [X] I checked for existing similar feature requests
  • [X] I have read the docs and checked that the feature I am requesting is not already implemented
  • [X] My feature request consists of only one feature

Is your Feature Request related to a Problem or Annoyance?

I'm frustrated when I want to type a tag in to a suggester, list, or select field, and I receive no auto completion hints for the tags that are available.

Describe the Feature you'd like

I would like an optionTags Input Field Argument that can be mixed in just like the existing option and optionQuery arguments.

When used, it should include existing tags in the available values.

A string argument to optionTags should limit the returned tags to those nested under the tag named in the argument. For example, optionTags(#include/me) should cause options to appear for tags #include/me/A and #include/me/B, but not #other/tag.

Alternatives

I tried using the optionQuery argument, but it is limited to Dataview sources. While a tag can be a source of querying for pages, a list of the tags themselves cannot be retrieved this way.

Additional Context

The suggester UI is already well suited for this feature.

For the list, and inlineList types, I wonder if it would be possible to reuse Obsidian's built in feature that hints values for the tags property that appears at the top of the file in preview view mode.

For select types, I think it should be available, unlike the optionQuery argument that is not available. Perhaps an additional number argument to optionTags to limit the number of results would be worthwhile.

reidgould avatar Sep 28 '24 22:09 reidgould

This would be highly appreciated. Without the auto suggester for tags, nobody remembers the exact spelling of their hierarchical tags and so one will make mistakes typing in tags that do not exist but are similar in name. That is not acceptable of course.

edakimling avatar Feb 09 '25 00:02 edakimling

The same thing for any property type would be even better

Nitero avatar Feb 09 '25 13:02 Nitero

So much this! And the OptionTags is much more elegant than my first thought of making it a part of option query somehow. I'd love for it to be compatible with tags including x term as well, rather than just being nested tags, maybe OptionTags(#Nested/Tag) and OptionTags("Including" and !"Excluding")? Similar to how query works.

I originally posted this in another thread before finding this one, and I'm not sure how relevant it is, but i'm including it here in case it's useful someone or anyone wants to use it in any js code blocks

I've found it is at least possible to get an array of all tags and filter like this with javascript:

const tags = Object.keys(app.metadataCache.getTags());
const tag1 = tags.filter(tag => tag.slice(1).startsWith("Tag1")); // slice 1 removes the "#" at the start of the tag from needing to be a part of the filter

Graywaren avatar Aug 08 '25 18:08 Graywaren