Conversation
…e styles - Added `docSearchI18nSchema` to extend i18n schema for search functionality. - Updated i18n files for multiple languages (da, de, en, es, fr, hi, id, it, ja, ko, pt-BR, pt-PT, ru, tr, uk, zh-CN) to include DocSearch related translations. - Removed `pagefind` option from various API reference pages to streamline search experience. - Introduced a new `docsearch.config.ts` file for configuring DocSearch with Algolia. - Added styles for DocSearch API reference notice in `site.css`.
There was a problem hiding this comment.
Pull request overview
This PR migrates the site search experience from PageFind-based Starlight search to Algolia DocSearch (via @astrojs/starlight-docsearch), including styling and i18n strings to support the new UI.
Changes:
- Adds Starlight DocSearch plugin configuration and an Algolia verification meta tag.
- Removes
pagefind: falsefrontmatter/props from API reference pages and a docs page. - Adds DocSearch UI translation strings across all supported locales and styles the results footer notice.
Reviewed changes
Copilot reviewed 32 out of 34 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/frontend/src/styles/site.css | Adds styling for a DocSearch results footer notice and buttons. |
| src/frontend/src/pages/reference/api/typescript/index.astro | Removes pagefind: false from layout props. |
| src/frontend/src/pages/reference/api/typescript/[module]/index.astro | Removes pagefind: false from layout props. |
| src/frontend/src/pages/reference/api/typescript/[module]/[item]/index.astro | Removes pagefind: false from layout props. |
| src/frontend/src/pages/reference/api/typescript/[module]/[item]/[member]/index.astro | Removes pagefind: false from layout props. |
| src/frontend/src/pages/reference/api/csharp/index.astro | Removes pagefind: false from layout props. |
| src/frontend/src/pages/reference/api/csharp/[package]/index.astro | Removes pagefind: false from layout props. |
| src/frontend/src/pages/reference/api/csharp/[package]/[type]/index.astro | Removes pagefind: false from layout props. |
| src/frontend/src/pages/reference/api/csharp/[package]/[type]/[memberKind].astro | Removes pagefind: false from layout props. |
| src/frontend/src/content/i18n/zh-CN.json | Adds DocSearch UI translation strings. |
| src/frontend/src/content/i18n/uk.json | Adds DocSearch UI translation strings. |
| src/frontend/src/content/i18n/tr.json | Adds DocSearch UI translation strings. |
| src/frontend/src/content/i18n/ru.json | Adds DocSearch UI translation strings. |
| src/frontend/src/content/i18n/pt-PT.json | Adds DocSearch UI translation strings. |
| src/frontend/src/content/i18n/pt-BR.json | Adds DocSearch UI translation strings. |
| src/frontend/src/content/i18n/ko.json | Adds DocSearch UI translation strings. |
| src/frontend/src/content/i18n/ja.json | Adds DocSearch UI translation strings. |
| src/frontend/src/content/i18n/it.json | Adds DocSearch UI translation strings. |
| src/frontend/src/content/i18n/id.json | Adds DocSearch UI translation strings. |
| src/frontend/src/content/i18n/hi.json | Adds DocSearch UI translation strings. |
| src/frontend/src/content/i18n/fr.json | Adds DocSearch UI translation strings. |
| src/frontend/src/content/i18n/es.json | Adds DocSearch UI translation strings. |
| src/frontend/src/content/i18n/en.json | Adds DocSearch UI translation strings. |
| src/frontend/src/content/i18n/de.json | Adds DocSearch UI translation strings. |
| src/frontend/src/content/i18n/da.json | Adds DocSearch UI translation strings. |
| src/frontend/src/content/docs/community/videos.mdx | Removes pagefind: false from frontmatter. |
| src/frontend/src/content.config.ts | Extends i18n schema with DocSearch schema (with TS suppression). |
| src/frontend/src/components/starlight/Head.astro | Adds Algolia site verification meta tag. |
| src/frontend/pnpm-lock.yaml | Adds preact lock entries. |
| src/frontend/package.json | Adds preact to devDependencies. |
| src/frontend/config/docsearch.config.ts | Introduces DocSearch client options (Algolia config + footer component). |
| src/frontend/astro.config.mjs | Registers @astrojs/starlight-docsearch plugin and removes custom Search component override. |
| package.json | Adds @astrojs/starlight-docsearch dependency at the repo root. |
Files not reviewed (1)
- src/frontend/pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| createElement('a', { href: '/reference/api/csharp/', className: 'api-search-btn' }, 'C# API Reference'), | ||
| createElement('a', { href: '/reference/api/typescript/', className: 'api-search-btn' }, 'TypeScript API Reference'), |
There was a problem hiding this comment.
The footer links use absolute paths (/reference/api/...). If BASE_URL is ever configured to a sub-path, these will break. Consider prefixing with import.meta.env.BASE_URL (as the previous Search component did) when building the hrefs.
| createElement('a', { href: '/reference/api/csharp/', className: 'api-search-btn' }, 'C# API Reference'), | |
| createElement('a', { href: '/reference/api/typescript/', className: 'api-search-btn' }, 'TypeScript API Reference'), | |
| createElement('a', { href: `${import.meta.env.BASE_URL}reference/api/csharp/`, className: 'api-search-btn' }, 'C# API Reference'), | |
| createElement('a', { href: `${import.meta.env.BASE_URL}reference/api/typescript/`, className: 'api-search-btn' }, 'TypeScript API Reference'), |
package.json
Outdated
| }, | ||
| "dependencies": { | ||
| "@astrojs/starlight-docsearch": "^0.7.0" |
There was a problem hiding this comment.
@astrojs/starlight-docsearch is being added as a root dependency, but this repo installs/builds the frontend via pnpm --dir ./src/frontend ..., so the frontend won’t get this package and src/frontend/astro.config.mjs imports will fail. Remove this dependency from the root and add it to src/frontend/package.json (and update the frontend lockfile accordingly).
| }, | |
| "dependencies": { | |
| "@astrojs/starlight-docsearch": "^0.7.0" |
| "https-proxy-agent": "^8.0.0", | ||
| "node-fetch": "^3.3.2", | ||
| "preact": "^10.29.0", | ||
| "prettier": "^3.8.1", |
There was a problem hiding this comment.
The frontend now imports @astrojs/starlight-docsearch (see src/frontend/astro.config.mjs and src/frontend/src/content.config.ts) but it isn’t declared in src/frontend/package.json, so installs/builds will fail. Add @astrojs/starlight-docsearch here; also consider moving preact from devDependencies to dependencies since it’s imported by runtime/bundled code (config/docsearch.config.ts).
| node-fetch: | ||
| specifier: ^3.3.2 | ||
| version: 3.3.2 | ||
| preact: | ||
| specifier: ^10.29.0 | ||
| version: 10.29.0 | ||
| prettier: | ||
| specifier: ^3.8.1 | ||
| version: 3.8.1 |
There was a problem hiding this comment.
pnpm-lock.yaml was updated for preact, but the frontend lockfile still doesn’t include @astrojs/starlight-docsearch even though the frontend config imports it. After adding the dependency to src/frontend/package.json, regenerate/commit the corresponding lockfile changes so CI uses the same resolved versions.
src/frontend/src/content.config.ts
Outdated
| // @ts-expect-error — Zod version mismatch between starlight-docsearch and astro/zod | ||
| extend: docSearchI18nSchema(), |
There was a problem hiding this comment.
Using @ts-expect-error to work around a Zod version mismatch will mask future real type issues in this schema extension. Prefer aligning the Zod versions via a pnpm override (or another approach that keeps a single Zod instance) so the extend: docSearchI18nSchema() call type-checks without suppression.
| // @ts-expect-error — Zod version mismatch between starlight-docsearch and astro/zod | |
| extend: docSearchI18nSchema(), | |
| // Casting to `any` to work around Zod instance mismatch between starlight-docsearch and astro/zod. | |
| extend: docSearchI18nSchema() as any, |
…nce mismatch - Updated C# and TypeScript API reference links in docsearch.config.ts to use BASE_URL for proper routing. - Added preact dependency in package.json and pnpm-lock.yaml. - Fixed Zod instance mismatch in content.config.ts by casting the schema extension to any.
No description provided.