Skip to content

Add section filter chips to search results - #5928

Open
Anarchydr wants to merge 1 commit into
fmhy:mainfrom
Anarchydr:main
Open

Add section filter chips to search results#5928
Anarchydr wants to merge 1 commit into
fmhy:mainfrom
Anarchydr:main

Conversation

@Anarchydr

Copy link
Copy Markdown
Contributor

Added category filter chips to the local search modal so users can narrow down results to a specific wiki section (like Gaming, Audio, or Reading).

Once you type a query, filter chips showing live match counts pop up under the search bar. Picking a section filters the results, "All" resets it, and your selection is remembered in localStorage.

A few notes:

  • Categories are generated directly from the sidebar, so any sidebar renames update automatically. If Wiki and Tools share a page (like /audio#audio-tools), they get grouped under Wiki.
  • Filtering happens on the in-memory results before pagination. Switching categories doesn't re-trigger the search index query, which keeps highlights, counts, keyboard navigation, and "Show more" working smoothly.
  • If a section turns up zero matches, it shows No results in <section> — Show all sections so it's clear the search itself didn't fail.
  • Ran pnpm docs:build, pnpm lint, and prettier check
  • Tested filtering manually across exact, fuzzy, and URL search modes

@Anarchydr
Anarchydr requested a review from taskylizard as a code owner July 31, 2026 11:47
@github-actions github-actions Bot added the core Core changes to our VitePress setup label Jul 31, 2026

@flowerey flowerey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM if it works. It is good that you didn't hardcode the chips :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core changes to our VitePress setup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants