feat(keys/cc-switch-dialog): 修复自定义cc-switch名称失焦后重置问题 - #5170
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe CCSwitchDialog component now enables custom name entry in the Name ComboboxInput field by setting ChangesCustom CC Switch Names
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
* chore(repo): ignore playwright mcp artifacts * perf(form): focus first validation error on submit - scope validation queries with a form root id so feedback stays inside the submitted form. - scroll to the earliest invalid control or message and move focus without fighting scroll position. - avoid handling the same failed submit twice to keep retries from jumping unexpectedly. * feat(keys/cc-switch-dialog): 修复自定义cc-switch名称失焦后重置问题 (QuantumNous#5170) * feat: add subscription balance redemption toggle (QuantumNous#3071) --------- Co-authored-by: QuentinHsu <xuquentinyang@gmail.com> Co-authored-by: 同語 <133845290+t0ng7u@users.noreply.github.com> Co-authored-by: zengwei <51938905+GnezIew@users.noreply.github.com> Co-authored-by: CaIon <i@caion.me> Co-authored-by: Claude <noreply@anthropic.com>
Important
📝 变更描述 / Description
(简述:做了什么?为什么这样改能生效?请基于你对代码逻辑的理解来写,避免粘贴未经整理的内容)
问题阐述:用户输入的文字只存在于组件内部的 searchValue 状态中,因为 allowCustomValue 为 false ,这些文字 从未同步到父组件的 name state 。失焦后内部状态清空,显示就恢复成了父组件持有的旧值。
在 cc-switch-dialog.tsx 的 Name 输入框上加 allowCustomValue={true} ,在 cc-switch-dialog.tsx 的 Name 输入框上加 allowCustomValue={true} :
🚀 变更类型 / Type of change
🔗 关联任务 / Related Issue
✅ 提交前检查项 / Checklist
Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。📸 运行证明 / Proof of Work
(请在此粘贴截图、关键日志或测试报告,以证明变更生效)

Summary by CodeRabbit