You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .weaverse/specs/2026-03-03--variant-media-grouping/plan.md
+4-5Lines changed: 4 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -288,29 +288,28 @@ Same two settings as main-product:
288
288
289
289
## 7. Filename Matching Strategy
290
290
291
-
Media is grouped by extracting option values from image filenames using delimiter-based pattern matching (`_`, `-`). The matching checks for the option value at the start, middle, or end of the filename, bounded by delimiters.
291
+
Media is grouped by extracting option values from image filenames using delimiter-based pattern matching (`_`, `-`). The matching checks for the option value at the start or end of the filename, bounded by delimiters.
292
+
293
+
**Priority Matching**: Option values are sorted by length (descending) so longer, more specific values match first. This prevents "Gray" from matching before "Gray Eucalyptus".
292
294
293
295
**Single-word option values** (e.g., "black"):
294
296
```
295
297
black_xxx.jpg (start + _)
296
298
black-xxx.jpg (start + -)
297
299
xxx_black.jpg (end + _)
298
300
xxx-black.jpg (end + -)
299
-
xxx_black_yyy.jpg (middle + _)
300
-
xxx-black-yyy.jpg (middle + -)
301
301
xxxblack.jpg (end, no delimiter)
302
302
```
303
303
304
304
**Multi-word option values** (e.g., "Slate Brown") are matched against transformed versions:
305
305
```
306
306
slate-brown_xxx.jpg (space → dash)
307
307
slate_brown_xxx.jpg (space → underscore)
308
-
slatebrown_xxx.jpg (space removed)
309
308
xxx_slate-brown.jpg (end + dash)
310
309
xxx_slate_brown.jpg (end + underscore)
311
310
```
312
311
313
-
This handles common filename conventions while avoiding false positives.
312
+
Note: Middle-of-filename matching and space-removed transformations (e.g., "slatebrown") were removed to reduce false positives.
0 commit comments