fix: render directory Select options with optionRender#13152
Merged
Conversation
Simplify the Select options by mapping directories to plain {value,label} objects and use optionRender to provide the custom UI. This moves the JSX out of the option data, adds ellipsis/overflow styling for long paths, and ensures the remove (X) handler uses the option's value when removing a directory.
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the working-directory Select UI on the Code Tools page by moving custom option JSX out of options[].label and into Ant Design’s optionRender, so the selected value renders as plain text while the dropdown options can still show a custom remove action.
Changes:
- Change directory
Selectoptions from JSX labels to plain{ value, label }objects. - Add
optionRenderto render the directory row UI (path + remove “X”) inside the dropdown. - Update the remove handler to use the option’s
valuewhen removing a directory.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
GeorgeDong32
approved these changes
Mar 3, 2026
DeJeune
approved these changes
Mar 3, 2026
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: <img width="613" height="112" alt="Screenshot 2026-03-02 at 21 33 19" src="https://github.com/user-attachments/assets/6d49b622-bc13-4cc4-942f-5100605d55c9" /> After this PR: <img width="614" height="112" alt="Screenshot 2026-03-02 at 21 33 50" src="https://github.com/user-attachments/assets/a546743b-7332-4ae1-b914-e0bf6ae04a7f" /> <!-- (optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: --> Fixes #13148 ### Why we need it and why it was done in this way The following tradeoffs were made: Simplify the Select options by mapping directories to plain {value,label} objects and use optionRender to provide the custom UI. This moves the JSX out of the option data, adds ellipsis/overflow styling for long paths, and ensures the remove (X) handler uses the option's value when removing a directory. The following alternatives were considered: Links to places where the discussion took place: <!-- optional: slack, other GH issue, mailinglist, ... --> ### Breaking changes <!-- optional --> If this PR introduces breaking changes, please describe the changes and the impact on users. ### Special notes for your reviewer <!-- optional --> ### 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: render directory Select options with optionRender in CodeToolPage ``` --------- Co-authored-by: Copilot <[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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Before this PR:
After this PR:
Fixes #13148
Why we need it and why it was done in this way
The following tradeoffs were made:
Simplify the Select options by mapping directories to plain {value,label} objects and use optionRender to provide the custom UI. This moves the JSX out of the option data, adds ellipsis/overflow styling for long paths, and ensures the remove (X) handler uses the option's value when removing a directory.
The following alternatives were considered:
Links to places where the discussion took place:
Breaking changes
If this PR introduces breaking changes, please describe the changes and the impact on users.
Special notes for your reviewer
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.
/gh-pr-review,gh pr diff, or GitHub UI) before requesting review from othersRelease note