Media Manager: exclude files by filename pattern / prefix #519
Replies: 3 comments
|
Thanks for the thoughtful and impressively detailed proposal @pixelastronauts — this is a great use case. We’ll start with a project-level filter across Media Manager and ship it very soon. |
|
Update: this is shipped to production 🎉 The project-level filter is live in the Media Manager — just open the Media Manager and expand the Filter panel to set up your exclusion rules. No schema or theme-side config needed. @pixelastronauts could you give it a try and let us know if it covers your |
|
Thanks @hta218 — we tried the project-level Filter. It’s a good start, but it doesn’t fully cover our case. 1. Per-input defaults in schema (not a project-wide UI rule) Different Media Managers need different prefixes/filters. For example:
A single project Filter would hide those files everywhere, including places we still want them. We also don’t want content editors to mess with filtered media. If the only control is a Filter panel in Studio, someone can disable or change the rules and accidentally pick (or re-expose) generated thumbs. The defaults should live on the {
type: 'image',
name: 'heroImage',
label: 'Hero image',
configs: {
excludeFilenamePrefixes: ['thumb_v'],
},
}The Studio Filter panel could still exist as an optional merchant override — but schema defaults should win unless we explicitly allow override. 2. Filter out product images With a large catalog, Media Manager fills up with product images very quickly. When we’re looking for an image uploaded for another page (hero, editorial, logo, etc.), we have to scroll through hundreds of product shots. A source/type filter would help a lot, e.g.: configs: {
excludeFilenamePrefixes: ['thumb_v'],
excludeSources: ['product'], // hide files that came from product media
}Or an include-only mode: Happy to test a schema |
Uh oh!
There was an error while loading. Please reload this page.
Summary
Add a way for theme developers to exclude files from the Weaverse Media Manager gallery (e.g. auto-generated product thumbnails), so merchants only see editorial/media assets when picking images in Studio.
Problem
The Media Manager shows all images from Shopify Admin → Content → Files.
On stores that programmatically upload many generated assets (product thumbs, previews, renders, etc.), the gallery becomes noisy and hard to use. Example from our storefront: hundreds of files named like
thumb v6 …drown out the images merchants actually want to select for sections/theme settings.Today there is:
configsoption onimage/videoinputs to filter the galleryProposal
Expose optional filter config on media inputs (and optionally a theme-level default).
Per-input (preferred)
Extend
image/video(andtranslation-imageif relevant) with typedconfigs, similar toselect/range:Theme / project-level (nice to have)
A global exclude list in theme settings / project config that applies to every Media Manager open, so generated assets stay out of the picker store-wide without repeating config on every input.
Suggested SDK shape (
@weaverse/schema)Follow the existing configs pattern:
ImageInputConfigs/VideoInputConfigs(Zod + TS) in@weaverse/schemaBasicInputSchemaforimage/video(same switch asselect/range)input.configswhen listing Shopify Files and filters server-side or client-sideExample:
Why this belongs in Studio + schema
/static/studio/hydrogen/…)Alternatives considered
Ask
Would the team consider:
ImageInputConfigs/VideoInputConfigsto@weaverse/schema?Happy to refine the API shape (prefixes vs globs vs regex, include-only allowlists, etc.) based on what fits Shopify Files querying best.
Context
@weaverse/hydrogen(Pilot theme)All reactions