Skip to content

feat(docs): identifier-aware, keyboard-first search (CIP-3350) - #117

Merged
coderdan merged 2 commits into
mainfrom
dan/cip-3350-docs-search-identifier-aware-keyboard-first-tailwind-quality
Oct 20, 2026
Merged

coderdan merged 2 commits into
mainfrom
dan/cip-3350-docs-search-identifier-aware-keyboard-first-tailwind-quality

Conversation

@coderdan

@coderdan coderdan commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Docs search omitted standalone code examples and treated developer identifiers as ordinary prose. Keep Orama, index code fences with their rendered heading anchors, and support namespace separators, suffixes, camelCase, prefixes and typo fallback. Queries such as text_eq, eql_v3.text, ord_term, encryptedSupabase and CS_CLIENT_KEY now find the relevant documentation.

  • Rank titles/headings above code and prose, show each page once at its best matching anchor, and filter by frontmatter page type. Navigation cards no longer crowd out the destination pages.
  • Replace the default dialog with section groups, highlighted excerpts, ⌘K/Ctrl+K, arrow navigation, Enter-to-anchor, accessible filters, loading/error/empty states and mobile layout.
  • Capture settled queries, result selections and zero-result queries in PostHog. Cancelled/failed requests do not become content gaps; repeated queries within a dialog session are deduplicated.
  • Build the index from each deployment's current MDX collection, expose a content revision for verification, and keep retired /stack pages excluded. The issue's dual-tree migration requirement was superseded by fix(docs): retire legacy stack pages and preserve redirects #116.
  • Add engine, live ranking/anchor and browser checks, with a CI job against a complete production build. Document the Orama decision and the separate account/domain-owner steps for an optional DocSearch application; no external application is submitted.

Validation: full production build and prebuild checks pass (content, Mermaid, links and all 621 legacy redirects); TypeScript and changed-file Biome checks pass; six engine tests and five Chromium tests pass, including intercepted PostHog event assertions. All six required queries plus six additional symbol/regression queries pass top-three relevance checks, along with destination anchors, filters, zero results and input validation. The complete suite also passed in GitHub Actions on the committed revision.

Vercel preview deployed successfully. Direct preview verification is pending authenticated Vercel access: requests currently redirect to Vercel SSO. Local and CI production-build acceptance checks are complete; they are not a claim that the protected preview has been tested.

Closes CIP-3350.

@vercel

vercel Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
public-docs Ready Ready Preview Oct 20, 2026 11:51am UTC

Request Review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Retry-dependent analytics keys allow duplicate query and zero-result events within one dialog session.

1 open issue
What changed in this PR

Improves documentation search while retaining Orama and the current MDX collection, building on the legacy-tree retirement in #116.

Changes:

  • Adds identifier-aware indexing, weighted ranking, matching anchors, and page-type filters.
  • Introduces a keyboard-first search dialog with excerpts and PostHog analytics.
  • Adds engine, browser, and production-build validation.
File Description
tests/​search.spec.ts Tests navigation, filters, errors, analytics, and mobile layout.
src/​lib/​search/​tokenizer.ts Normalizes identifiers and indexes suffixes.
src/​lib/​search/​shared.ts Defines result types, filters, and grouping.
src/​lib/​search/​engine.ts Builds and queries the weighted search index.
src/​components/​docs-search.tsx Implements the search dialog and analytics.
src/​components/​docs-provider.tsx Registers the custom search dialog.
src/​app/​layout.tsx Integrates the docs provider.
src/​app/​api/​search/​route.ts Serves validated queries and index metadata.
source.config.ts Includes code fences and excludes navigation cards.
scripts/​validate-search.ts Checks live ranking, anchors, and filters.
scripts/​search.test.ts Tests search engine behavior.
README.md Documents search design and validation.
playwright.config.ts Configures browser checks.
package.json Adds dependencies and validation commands.
IA.md Records search feature completion.
bun.lock Locks search and browser-test dependencies.
.gitignore Excludes browser-test artifacts.
.github/​workflows/​search.yml Runs production-build search checks in CI.

Review effort: Balanced

Comment thread src/components/docs-search.tsx Outdated
@coderdan
coderdan merged commit 53fae08 into main Oct 20, 2026
3 checks passed

This branch was successfully deployed

1 active deployment
Preview — ad15b208 Deployed Oct 20, 2026 by vercel[bot]
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