Skip to content

fix: improve plugin browser UX with three small fixes#13153

Merged
DeJeune merged 1 commit intomainfrom
fix-plugins
Mar 3, 2026
Merged

fix: improve plugin browser UX with three small fixes#13153
DeJeune merged 1 commit intomainfrom
fix-plugins

Conversation

@Pleasurecruise
Copy link
Copy Markdown
Collaborator

@Pleasurecruise Pleasurecruise commented Mar 2, 2026

What this PR does

Before this PR:

  • Plugin detail modal text was not selectable, making it hard to copy plugin names or descriptions
  • Searching for plugins/skills with hyphens or underscores (e.g. web-search, code_review) returned zero results because the API uses word-based matching
  • The search placeholder and "no results" message always said "plugins" even when browsing the skills tab

After this PR:

  • Plugin detail modal content is now selectable (added select-text CSS class)
  • Search queries automatically normalize hyphens/underscores to spaces before sending to the API, improving search hit rate
  • Search placeholder and empty state messages are context-aware: show "Search skills..." / "No skills found" on the skills tab, and "Search plugins..." / "No plugins found" on the plugins tab

Fixes #

Why we need it and why it was done in this way

The following tradeoffs were made:

  • make PluginDetailModal content selectable via select-text class
  • normalize search query by replacing hyphens/underscores with spaces to avoid zero results when API does word-based matching
  • add separate i18n keys for skills vs plugins (search placeholder, no results message) in en-us, zh-cn, and zh-tw locales

The following alternatives were considered:

  • Could have added user-select: all globally, but select-text is more scoped and follows the existing pattern in the codebase
  • Could have done fuzzy matching client-side, but normalizing the query before sending to the API is simpler and leverages existing server-side search

Links to places where the discussion took place:

Breaking changes

None. All changes are additive (new i18n keys, CSS class addition, query normalization).

Special notes for your reviewer

  • The regex [-_]+/g in MarketplaceService.ts replaces consecutive hyphens/underscores with a single space, which should cover common plugin naming patterns like web-search or code_review
  • Only en-us, zh-cn, and zh-tw locale files are updated; other locales will fall back to the existing plugins.* keys

Checklist

This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.

Release note

fix: improve plugin browser UX — make detail modal text selectable, normalize search queries with hyphens/underscores, and show context-aware placeholders for skills vs plugins tabs

- make PluginDetailModal content selectable via select-text class
- normalize search query by replacing hyphens/underscores with spaces
  to avoid zero results when API does word-based matching
- add separate i18n keys for skills vs plugins (search placeholder,
  no results message) in en-us, zh-cn, and zh-tw locales

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Copilot AI review requested due to automatic review settings March 2, 2026 23:09
Copy link
Copy Markdown
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

Improves the marketplace/plugin browser UX by making plugin detail content selectable, improving search query behavior against the marketplace API, and adding skill-specific i18n strings for search UI.

Changes:

  • Normalize marketplace search queries by replacing hyphens/underscores with spaces before sending to the API.
  • Make PluginDetailModal content text-selectable.
  • Add skill-specific i18n keys for search placeholder and “no results” messaging and switch PluginBrowser to use them when browsing skills.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/renderer/src/services/MarketplaceService.ts Normalizes the outgoing q search parameter.
src/renderer/src/pages/settings/AgentSettings/components/PluginsSettings/components/PluginDetailModal.tsx Enables text selection within the modal body.
src/renderer/src/pages/settings/AgentSettings/components/PluginsSettings/components/PluginBrowser.tsx Uses skill-specific i18n keys for placeholder and “no results” when activeType === 'skill'.
src/renderer/src/i18n/locales/en-us.json Adds no_results_skills and search_placeholder_skills strings.
src/renderer/src/i18n/locales/zh-cn.json Adds no_results_skills and search_placeholder_skills strings.
src/renderer/src/i18n/locales/zh-tw.json Adds no_results_skills and search_placeholder_skills strings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 168 to 170
if (params.query) {
url.searchParams.set('q', params.query)
url.searchParams.set('q', params.query.replace(/[-_]+/g, ' ').trim())
}
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

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

params.query is checked before normalization, but the value sent to the API is normalized. This can lead to inconsistent behavior (e.g., queries like "---" or "___" become an empty q param but still get treated as a search), and it can also make caching/TTL decisions diverge if other parts use the raw query. Consider computing a normalizedQuery once, only setting q when it’s non-empty after normalization, and using the same normalized value consistently for cache keys / TTL decisions.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator

@DeJeune DeJeune left a comment

Choose a reason for hiding this comment

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

LGTM

@DeJeune DeJeune merged commit 37efee0 into main Mar 3, 2026
22 checks passed
@DeJeune DeJeune deleted the fix-plugins branch March 3, 2026 05:41
@kangfenmao kangfenmao mentioned this pull request Mar 3, 2026
4 tasks
EurFelux pushed a commit that referenced this pull request Mar 3, 2026
<!-- Template from
https://github.com/kubevirt/kubevirt/blob/main/.github/PULL_REQUEST_TEMPLATE.md?-->
<!--  Thanks for sending a pull request!  Here are some tips for you:
1. Consider creating this PR as draft:
https://github.com/CherryHQ/cherry-studio/blob/main/CONTRIBUTING.md
-->

<!--

⚠️ Important: Redux/IndexedDB Data-Changing Feature PRs Temporarily On
Hold ⚠️

Please note: For our current development cycle, we are not accepting
feature Pull Requests that introduce changes to Redux data models or
IndexedDB schemas.

While we value your contributions, PRs of this nature will be blocked
without merge. We welcome all other contributions (bug fixes, perf
enhancements, docs, etc.). Thank you!

Once version 2.0.0 is released, we will resume reviewing feature PRs.

-->

### What this PR does

Before this PR:
- Plugin detail modal text was not selectable, making it hard to copy
plugin names or descriptions
- Searching for plugins/skills with hyphens or underscores (e.g.
`web-search`, `code_review`) returned zero results because the API uses
word-based matching
- The search placeholder and "no results" message always said "plugins"
even when browsing the skills tab

After this PR:
- Plugin detail modal content is now selectable (added `select-text` CSS
class)
- Search queries automatically normalize hyphens/underscores to spaces
before sending to the API, improving search hit rate
- Search placeholder and empty state messages are context-aware: show
"Search skills..." / "No skills found" on the skills tab, and "Search
plugins..." / "No plugins found" on the plugins tab

<!-- (optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)`
format, will close the issue(s) when PR gets merged)*: -->

Fixes #

### Why we need it and why it was done in this way

The following tradeoffs were made:

- make PluginDetailModal content selectable via select-text class
- normalize search query by replacing hyphens/underscores with spaces to
avoid zero results when API does word-based matching
- add separate i18n keys for skills vs plugins (search placeholder, no
results message) in en-us, zh-cn, and zh-tw locales

The following alternatives were considered:

- Could have added `user-select: all` globally, but `select-text` is
more scoped and follows the existing pattern in the codebase
- Could have done fuzzy matching client-side, but normalizing the query
before sending to the API is simpler and leverages existing server-side
search

Links to places where the discussion took place: <!-- optional: slack,
other GH issue, mailinglist, ... -->

### Breaking changes

None. All changes are additive (new i18n keys, CSS class addition, query
normalization).

### Special notes for your reviewer

- The regex `[-_]+/g` in `MarketplaceService.ts` replaces consecutive
hyphens/underscores with a single space, which should cover common
plugin naming patterns like `web-search` or `code_review`
- Only en-us, zh-cn, and zh-tw locale files are updated; other locales
will fall back to the existing `plugins.*` keys

### Checklist

This checklist is not enforcing, but it's a reminder of items that could
be relevant to every PR.
Approvers are expected to review this list.

- [x] PR: The PR description is expressive enough and will help future
contributors
- [x] Code: [Write code that humans can
understand](https://en.wikiquote.org/wiki/Martin_Fowler#code-for-humans)
and [Keep it simple](https://en.wikipedia.org/wiki/KISS_principle)
- [x] Refactor: You have [left the code cleaner than you found it (Boy
Scout
Rule)](https://learning.oreilly.com/library/view/97-things-every/9780596809515/ch08.html)
- [ ] Upgrade: Impact of this change on upgrade flows was considered and
addressed if required
- [ ] Documentation: A [user-guide update](https://docs.cherry-ai.com)
was considered and is present (link) or not required. Check this only
when the PR introduces or changes a user-facing feature or behavior.
- [ ] Self-review: I have reviewed my own code (e.g., via
[`/gh-pr-review`](/.claude/skills/gh-pr-review/SKILL.md), `gh pr diff`,
or GitHub UI) before requesting review from others

### Release note

<!--  Write your release note:
1. Enter your extended release note in the below block. If the PR
requires additional action from users switching to the new release,
include the string "action required".
2. If no release note is required, just write "NONE".
3. Only include user-facing changes (new features, bug fixes visible to
users, UI changes, behavior changes). For CI, maintenance, internal
refactoring, build tooling, or other non-user-facing work, write "NONE".
-->

```release-note
fix: improve plugin browser UX — make detail modal text selectable, normalize search queries with hyphens/underscores, and show context-aware placeholders for skills vs plugins tabs
```

Co-authored-by: Claude Sonnet 4.6 <[email protected]>
DeJeune added a commit that referenced this pull request Mar 4, 2026
### What this PR does

This is a release PR for **Cherry Studio v1.7.23**.

**Changes included:**
- Bump version from 1.7.22 to 1.7.23
- Update release notes with user-facing bug fixes

### Release Notes

<!--LANG:en-->
Cherry Studio 1.7.23 - Bug Fixes

🐛 Bug Fixes
- [Selection] Fix app crash on Windows when closing action window
- [MiniApp] Fix settings state synchronization and region filter
consistency
- [Plugin Browser] Make detail modal text selectable and improve search
experience
- [Tools] Fix approval card not showing for builtin and provider tools

### Included Commits

- fix(Selection): prevent Windows crash when closing transparent action
window (#13177)
- fix(renderer): synchronize miniapp settings state and respect region
filter (#13166)
- fix: improve plugin browser UX with three small fixes (#13153)
- fix: show approval card for builtin and provider tools (#13154)
- fix: support esc to close modal (#13159)
- fix: open external editor in new window instead of reusing existing
one (#13160)
- fix: render directory Select options with optionRender (#13152)
- refactor: replace static pnpm patch with postinstall script for
claude-agent-sdk (#13139)
- feat: add dev-only message data inspection button (#13142)
- docs: add review workflow to CLAUDE.md (#13145)
- chore(deps): upgrade @uiw/codemirror packages to 4.25.7 (#13149)
- fix(ci): skip CI on PR body/title edits, only re-run on base branch
changes (#13150)

### Review Checklist

- [ ] Review generated release notes in `electron-builder.yml`
- [ ] Verify version bump in `package.json`
- [ ] CI passes
- [ ] Merge to trigger release build

### Release note

```release-note
Cherry Studio 1.7.23 - Bug Fixes

🐛 Bug Fixes
- [Selection] Fix app crash on Windows when closing action window
- [MiniApp] Fix settings state synchronization and region filter consistency
- [Plugin Browser] Make detail modal text selectable and improve search experience
- [Tools] Fix approval card not showing for builtin and provider tools
```

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: suyao <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
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.

4 participants