Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 24, 2025

This PR updates the @rspress/plugin-algolia package to use docsearch v4.1.0, bringing the latest improvements and features from Algolia's DocSearch library.

Changes Made

Package Dependencies

  • Updated @docsearch/react from ^3.9.0 to ^4.1.0
  • Updated @docsearch/css from ^3.9.0 to ^4.1.0

Breaking Changes Fixed

Docsearch v4 introduced several translation property name changes that required updates:

  • resetButtonTitleclearButtonTitle
  • resetButtonAriaLabelclearButtonAriaLabel
  • searchByTextpoweredByText
  • cancelButtonTextcloseButtonText
  • cancelButtonAriaLabelcloseButtonAriaLabel

These changes were applied to:

  • src/runtime/locales.ts - Chinese locale translations
  • website/docs/zh/plugin/official-plugins/algolia.mdx - Chinese documentation
  • website/docs/en/plugin/official-plugins/algolia.mdx - English documentation

Testing

Added comprehensive unit tests to verify the translation property migration is correct and that old v3 properties are no longer used.

Benefits

This upgrade provides access to docsearch v4's new features and improvements:

  • AI-powered search: New askAi prop for AI-assisted search
  • Multi-index support: New indices prop (deprecates single indexName)
  • Keyboard shortcuts: Configurable keyboard shortcut behavior
  • Enhanced translations: More comprehensive translation options
  • Recent searches: Improved management of recent and favorite searches

Backward Compatibility

Zero breaking changes for end users - all existing configurations continue to work as before. The API surface remains identical, ensuring seamless upgrades.

Verification

  • All builds pass successfully
  • All unit tests pass (82/82)
  • Linting and code style compliance verified
  • E2E test application builds and runs correctly
  • Manual testing confirms functionality works as expected

Closes #[issue_number]


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@netlify
Copy link

netlify bot commented Sep 24, 2025

Deploy Preview for rspress-v2 ready!

Name Link
🔨 Latest commit 3d68e77
🔍 Latest deploy log https://app.netlify.com/projects/rspress-v2/deploys/68d399fb86478a0008ed378d
😎 Deploy Preview https://deploy-preview-2620--rspress-v2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@CLAassistant
Copy link

CLAassistant commented Sep 24, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ SoonIter
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI changed the title [WIP] 更新 packages/plugin-algolia 的 docsearch 到 v4,具体可参考 docsearch 文档 feat: update @rspress/plugin-algolia to docsearch v4.1.0 Sep 24, 2025
Copilot AI requested a review from SoonIter September 24, 2025 03:46
Copilot finished work on behalf of SoonIter September 24, 2025 03:46
@SoonIter SoonIter marked this pull request as ready for review September 24, 2025 07:44
Copilot AI review requested due to automatic review settings September 24, 2025 07:44
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 updates the @rspress/plugin-algolia package to use docsearch v4.1.0, addressing breaking changes in translation property names while maintaining backward compatibility for end users.

  • Updated docsearch dependencies from v3.9.0 to v4.1.0
  • Migrated deprecated translation property names to their v4 equivalents
  • Added comprehensive unit tests to verify the migration and prevent regressions

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/plugin-algolia/package.json Updated docsearch dependencies to v4.1.0
packages/plugin-algolia/src/runtime/locales.ts Updated Chinese locale translations to use v4 property names
packages/plugin-algolia/src/runtime/Search.css Simplified CSS variables and improved theme handling
packages/plugin-algolia/tests/locales.test.ts Added unit tests to verify v4 translation property migration
website/docs/zh/plugin/official-plugins/algolia.mdx Updated Chinese documentation with v4 translation examples
website/docs/en/plugin/official-plugins/algolia.mdx Updated English documentation with v4 translation examples
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@SoonIter
Copy link
Member

image image image image

@SoonIter SoonIter changed the title feat: update @rspress/plugin-algolia to docsearch v4.1.0 feat!: update @rspress/plugin-algolia to docsearch v4.1.0 Sep 24, 2025
@SoonIter SoonIter merged commit 8d4b835 into main Sep 24, 2025
8 of 9 checks passed
@SoonIter SoonIter deleted the copilot/fix-d0c5eec0-3e78-40ee-83b8-2a0bc4fecb7c branch September 24, 2025 07:54
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.

4 participants