Skip to content

Replace PageFind with Alogia search#606

Open
IEvangelist wants to merge 4 commits intomainfrom
dapine/replace-pagefind-search
Open

Replace PageFind with Alogia search#606
IEvangelist wants to merge 4 commits intomainfrom
dapine/replace-pagefind-search

Conversation

@IEvangelist
Copy link
Member

No description provided.

…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`.
Copilot AI review requested due to automatic review settings March 25, 2026 04:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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: false frontmatter/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.

Comment on lines +25 to +26
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'),
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
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'),

Copilot uses AI. Check for mistakes.
package.json Outdated
Comment on lines +13 to +15
},
"dependencies": {
"@astrojs/starlight-docsearch": "^0.7.0"
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

@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).

Suggested change
},
"dependencies": {
"@astrojs/starlight-docsearch": "^0.7.0"

Copilot uses AI. Check for mistakes.
Comment on lines 79 to 82
"https-proxy-agent": "^8.0.0",
"node-fetch": "^3.3.2",
"preact": "^10.29.0",
"prettier": "^3.8.1",
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

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).

Copilot uses AI. Check for mistakes.
Comment on lines 152 to 160
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
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines +28 to +29
// @ts-expect-error — Zod version mismatch between starlight-docsearch and astro/zod
extend: docSearchI18nSchema(),
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
// @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,

Copilot uses AI. Check for mistakes.
…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.
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