Skip to content

Add Custom Field Tag Filter plugin#727

Merged
DogmaDragon merged 2 commits into
stashapp:mainfrom
DexXxter103:plugin/cf-tag-filter
Jun 18, 2026
Merged

Add Custom Field Tag Filter plugin#727
DogmaDragon merged 2 commits into
stashapp:mainfrom
DexXxter103:plugin/cf-tag-filter

Conversation

@DexXxter103

Copy link
Copy Markdown
Contributor

Custom Field Tag Filter

Adds a new UI plugin that hides "meta-tags" from manual tag entry (when editing
scenes) and, optionally, from scraper results. Which tags are hidden is controlled
by a custom field on the tag — so the marking lives in the stash database
itself.

Why

This is a self-contained alternative to the existing tag-filter plugin. That
plugin stores the hidden-tag list in the browser's localStorage, so the list
is lost when you clear your browser cache or use a different browser, forcing you
to re-mark every tag. Storing the marking on the tag (via a custom field) means
it's shared across browsers and survives cache clears.

What it does

  • Hides marked tags from the scene tag dropdown (FindTagsForSelect)
  • Hides marked tags from the scraper's automatic tag search
  • Optionally strips marked tags from scrape results (setting)

It does not hide tags from the /tags page, scenes that already have the tag,
or the backend.

How it works

  • Fully self-contained: no dependency on helper plugins (0gql-intercept,
    forbiddenConfig, wfke, fontawesome-js). It inlines a minimal fetch
    interceptor and reads its own settings via GraphQL.
  • The hidden-tag list is fetched lazily, once per page load — the first time a
    tag dropdown or scrape result is shown — then reused for the session. No
    background polling, so simply browsing generates no extra traffic. This mirrors
    Stash's own cache-first behavior (changes made elsewhere are picked up on reload).

Settings

Setting Description
Custom field name The custom field that marks a tag as hidden. Required.
Custom field value (optional) If set, only tags whose field equals this value are hidden; empty = any non-empty value.
Also hide marked tags from scraper results Strip marked tags from scrape results.

Testing

  • Tag-selection filtering on the scene edit page works (presence-only matching);
    marked tags remain visible on /tags.
  • With the scrape setting off, scraping a scene issues no GraphQL calls from
    the plugin (no extra traffic while browsing/scraping).
  • With the scrape setting on, a tag returned by the scraper that is marked as
    filtered is correctly stripped from the scrape results.
  • With an optional custom field value set (strict matching), tags whose field
    has a non-matching value are not filtered, while tags with the matching value
    are filtered.
  • Validated with the repo validator (node validate.js).

Disclosure

Written with LLM assistance per the repository's LLM-assisted contribution policy;
reviewed and tested by me, and I take full responsibility for the code.

Link: stashapp/stash#2633 (comment)

@DexXxter103 DexXxter103 force-pushed the plugin/cf-tag-filter branch from f403107 to 6ce9bad Compare June 18, 2026 01:31
Hides tags marked via a custom field from manual tag entry (scene editing)
and from scraper results. The marking lives on the tag in the stash
backend, so it is shared across browsers and survives clearing the
browser cache.

Disclosure: written with LLM assistance per the repo's LLM-assisted
            contribution policy; reviewed and tested by me.

Link: stashapp/stash#2633 (comment)
@DexXxter103 DexXxter103 force-pushed the plugin/cf-tag-filter branch from 6ce9bad to 42c133b Compare June 18, 2026 01:36
@DogmaDragon DogmaDragon added the type:plugin Plugins label Jun 18, 2026
@DogmaDragon DogmaDragon merged commit d574724 into stashapp:main Jun 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants