Skip to content

feat(examples): support category: and example: tags in sidebar filter#8829

Merged
kpal81xd merged 1 commit into
mainfrom
feat/examples-filter-tags
Jun 3, 2026
Merged

feat(examples): support category: and example: tags in sidebar filter#8829
kpal81xd merged 1 commit into
mainfrom
feat/examples-filter-tags

Conversation

@kpal81xd
Copy link
Copy Markdown
Contributor

@kpal81xd kpal81xd commented Jun 3, 2026

Summary

The examples-browser sidebar filter previously did fuzzy regex matching only. It now also understands category:<name> and example:<name> tags, layered on top of the existing free-text search.

  • category:<name> — exact, case-insensitive match on a category's kebab name (e.g. category:animation, category:gaussian-splatting)
  • example:<name> — exact, case-insensitive match on an example's kebab name (e.g. example:blend-trees-1d)
  • bare words — unchanged fuzzy behavior (whitespace → .*), matching either the category or example name
  • combining — multiple tags of the same kind union (OR); tags of different kinds and free text combine (AND)

The placeholder now advertises the syntax: Filter, category:, example:.

Behavior

Filter Result
gaussian splatting fuzzy search (unchanged)
category:animation exactly the animation category
example:gltf exactly the gltf example, any category
category:animation example:blend-trees-1d that one example
category:loaders category:animation both categories (OR)
category:anim no match — exact, not partial

Implementation

Single file: examples/src/app/components/Sidebar.mjs. Added a parseFilter tokenizer that separates category:/example: tags from free-text terms; filterCategories evaluates each (category, example) pair against the parsed constraints.

Testing

  • npm run -s lint — clean
  • npm run -s type:check:app — clean
  • Standalone logic test across all cases in the table above produced the expected output.

The sidebar filter previously did fuzzy regex matching only. It now also
parses category:<name> and example:<name> tags for exact, case-insensitive
selection of a category or example by its kebab-case name.

- multiple tags of the same kind union (OR); different kinds and free text
  combine (AND)
- bare words keep the existing fuzzy behavior
- placeholder updated to advertise the new syntax
@kpal81xd kpal81xd self-assigned this Jun 3, 2026
@kpal81xd kpal81xd merged commit a0fd2b4 into main Jun 3, 2026
8 checks passed
@kpal81xd kpal81xd deleted the feat/examples-filter-tags branch June 3, 2026 10:01
kpal81xd added a commit that referenced this pull request Jun 3, 2026
…#8829)

The sidebar filter previously did fuzzy regex matching only. It now also
parses category:<name> and example:<name> tags for exact, case-insensitive
selection of a category or example by its kebab-case name.

- multiple tags of the same kind union (OR); different kinds and free text
  combine (AND)
- bare words keep the existing fuzzy behavior
- placeholder updated to advertise the new syntax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant