Skip to content

RDoc-3439 New documentation search results improvements#2543

Open
poissoncorp wants to merge 4 commits into
ravendb:mainfrom
poissoncorp:RDoc-3439-new-documentation-search-results-improvements
Open

RDoc-3439 New documentation search results improvements#2543
poissoncorp wants to merge 4 commits into
ravendb:mainfrom
poissoncorp:RDoc-3439-new-documentation-search-results-improvements

Conversation

@poissoncorp

@poissoncorp poissoncorp commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Issue link

RDoc-3439 New documentation search results improvements

Additional description

Improves the documentation search experience. Adds new components. Needs frontend code review @kalczur 🙏
Passed it through the superpowers code review on ultracode.

image image image image

Type of change

  • Content - docs
  • Content - cloud
  • Content - guides
  • Content - start pages/other
  • New docs feature (consider updating /templates or readme)
  • Bug fix
  • Optimization
  • Other

Changes in docs URLs

  • No changes in docs URLs
  • Articles are restructured, URLs will change, mapping is required (update /scripts/redirects.json file, set Documents Moved PR label)

Changes in UX/UI

  • No changes in UX/UI
  • Changes in UX/UI (include screenshots and description)

@poissoncorp poissoncorp marked this pull request as ready for review June 26, 2026 16:36
@kalczur kalczur self-requested a review June 29, 2026 08:51
Introduce src/components/Common/contentSource.ts as the single source of truth for the site's
content sources (docs/cloud/guides/samples/external) with their labels and icons, and migrate the
See Also components onto it. Reused by the search-results work.
Make guide/cloud/sample results stand out and filterable across the navbar modal and the /search
page, using the existing ProductionDocsCrawler index and its docusaurus_tag field:
- Color-coded source badges (Docs/Guide/Cloud/Sample) on every result.
- Source filter pills (All/Docs/Guides/Cloud) plus a separated Samples scope.
- Type-to-search from anywhere; pills appear once you type; first keystroke is kept.
- External guides are badged "External" and redirect to their article on both surfaces.
- URL-derived breadcrumb on page-level rows; real per-query "See all N" count.
- /search is swizzled to carry docusaurus_tag and render the same badges + pills.

Source grouping (hierarchy.lvl0) and landing-page exclusion are handled in the Algolia crawler,
not the frontend. Verified: typecheck, lint, prettier, 88 tests, plus live checks on both surfaces.
@poissoncorp poissoncorp force-pushed the RDoc-3439-new-documentation-search-results-improvements branch from 8d0e739 to ccb3392 Compare June 29, 2026 16:17
Final adversarial-review findings (0 must, 2 should, rest may):
- should: restore the flex/gap on .DocSearch-Hit-sourceBadge so dual badges
  (Guide + External) don't touch; give the active filter pill dark:text-black
  (the repo's bg-primary convention; --ifm-color-primary is light in cloud dark mode).
- drop the dead SearchFilter.tag data and exclude "All" by plugin id instead
  (version-agnostic); remove the unused search-source-badge class hook; replace the
  stale Facebook/MIT header on the swizzled CSS; reword a misplaced comment.

Now that the recrawl emits lvl0 + a breadcrumb field, retire the URL-breadcrumb
derivation (getResultBreadcrumb/humanizeSegment/acronyms) and read the crawler
breadcrumb instead, stripping the leading source root.

Verified: typecheck, lint, prettier, 88 tests; live checks of breadcrumb-from-field,
dual-badge spacing, active-pill dark text, and the Samples scope (indexed, shown under
its pill, excluded from All).
Comment thread src/components/Common/CustomSearchButton.tsx Outdated
Comment thread src/components/Common/CustomSearchButton.tsx Outdated
Comment thread src/components/Search/searchSource.ts Outdated
Comment thread src/theme/SearchBar/index.tsx Outdated
Comment thread src/theme/SearchBar/index.tsx Outdated
Addressing kalczur's review comments:
- CustomSearchButton: drop forwardRef (ref is a plain prop in React 19) and use
  useIsBrowser() instead of a useState/useEffect for the shortcut key.
- searchSource: replace the `separated` flag with grouped filters
  (SEARCH_FILTER_GROUPS); the UI divides between groups and the "All" exclusion
  derives from groups after the first, decoupling UI from scope.
- SearchBar: introduce a typed SearchHit instead of inline `as {...}` casts.
- SearchBar: render the breadcrumb declaratively (right-aligned) instead of the
  imperative DOM injection.
@poissoncorp poissoncorp requested a review from kalczur June 30, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants