Skip to content

Accept API hits in navigation-search schemas - #4143

Open
reakaleek wants to merge 1 commit into
mainfrom
feat/nav-search-accept-api-hits
Open

reakaleek wants to merge 1 commit into
mainfrom
feat/nav-search-accept-api-hits

Conversation

@reakaleek

Copy link
Copy Markdown
Member

Navigation-search and Codex modal hooks now parse mixed docs and api hits. The store type filter matches the indexed docs value.

Affects: Site UI, Search

Prompt summary: Ship the Jump to page API story as stacked PRs. This first PR is the root on main and covers elastic/docs-eng-team#857: accept api hits, fix the store type union, and align the mock service.

Stack: 1 of 5, root on main. Later PRs for elastic/docs-eng-team#858 through elastic/docs-eng-team#861 stack on this branch.

Why

A navigation-search hit with type: "api" fails Zod parse and drops the whole response. The store filter still uses doc, which never matches the indexed value docs. Local mock results use the same stale value, so a type=docs query returns nothing.

Closes elastic/docs-eng-team#857

What

Result schema

Both query hooks accept docs and api on each hit. A mixed response now parses instead of throwing.

Type filter

TypeFilter is 'all' | 'docs' | 'api'. A later type=docs query can match indexed documents.

Mock results

MockNavigationSearchService emits Type = "docs" so local filtered queries match the same contract.

Verify

cd src/Elastic.Documentation.Site && npm run test
# SearchResponse parses a mixed docs and api navigation-search response
# stores docs and api filters, never doc

Out of scope: Mounting the box, the type attribute, API-shaped rows, and leftover cleanup. Those land in the stacked PRs above.

Made with Cursor

@github-actions

Copy link
Copy Markdown
Contributor

Docs preview (local build)

Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4143/

@reakaleek
reakaleek added this pull request to stack #4146 September 18, 2026 10:35

@github-actions github-actions Bot 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.

Approved: no actionable issues found in this diff.


What is this? | From workflow: PR Review

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

The Jump to page hooks rejected type "api" and the store filter used "doc", which never matches indexed "docs".

Co-Authored-By: Cursor Grok 4.6 <noreply@anthropic.com>

This branch was successfully deployed

2 active deployments
assembler-preview c4b2a63a Deployed Sep 22, 2026 by github-actions[bot]
docs-preview c4b2a63a Deployed Sep 22, 2026 by github-actions[bot]
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.

3 participants