Skip to content

fix: allow adding model names that differ only by case in multi-select#6061

Merged
t0ng7u merged 1 commit into
QuantumNous:mainfrom
feitianbubu:pr/c33b40b70
Jul 10, 2026
Merged

fix: allow adding model names that differ only by case in multi-select#6061
t0ng7u merged 1 commit into
QuantumNous:mainfrom
feitianbubu:pr/c33b40b70

Conversation

@feitianbubu

@feitianbubu feitianbubu commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

📝 变更描述 / Description

渠道编辑页的模型多选框里,输入 DeepSeek-V3 时如果系统已有小写的 deepseek-v3,"添加自定义模型"选项不会出现,按回车只能选中小写模型,大写模型名无法录入(上游只认大写时渠道就配不了)。

原因是 multi-select.tsx 里判断"输入是否已存在"用了 toLowerCase() 忽略大小写。改为精确匹配后,仅大小写不同的模型名也能正常录入;输入与已有选项完全一致时行为不变。

🚀 变更类型 / Type of change

  • 🐛 Bug 修复 (Bug fix) - 请关联对应 Issue,避免将设计取舍、理解偏差或预期不一致直接归类为 bug
  • ✨ 新功能 (New feature) - 重大特性建议先通过 Issue 沟通
  • ⚡ 性能优化 / 重构 (Refactor)
  • 📝 文档更新 (Documentation)

🔗 关联任务 / Related Issue

✅ 提交前检查项 / Checklist

  • 人工确认: 我已亲自整理并撰写此描述,没有直接粘贴未经处理的 AI 输出。
  • 非重复提交: 我已搜索现有的 IssuesPRs,确认不是重复提交。
  • Bug fix 说明: 若此 PR 标记为 Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。
  • 变更理解: 我已理解这些更改的工作原理及可能影响。
  • 范围聚焦: 本 PR 未包含任何与当前任务无关的代码改动。
  • 本地验证: 已在本地运行并通过测试或手动验证,维护者可以据此复核结果。
  • 安全合规: 代码中无敏感凭据,且符合项目代码规范。

📸 运行证明 / Proof of Work

修复前:
image

修复后:
image

@feitianbubu feitianbubu changed the title fix: 模型多选框允许录入仅大小写不同的模型名 fix: allow adding model names that differ only by case in multi-select Jul 10, 2026
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The multi-select component now matches typed input against existing option values and labels using case-sensitive comparisons, allowing differently cased entries to remain distinct.

Changes

Multi-select matching

Layer / File(s) Summary
Exact option matching
web/default/src/components/multi-select.tsx
inputMatchesExisting now compares trimmed input directly with option values and labels instead of lowercasing both sides.

Estimated code review effort: 2 (Simple) | ~5 minutes

Poem

A rabbit typed DeepSeek-V3 with care,
No lowercase trap was waiting there.
Exact letters now hold their ground,
Distinct names stay distinct when found.
Hop, hop—matching is fair!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The change matches issue #6029 by allowing model names that differ only by case to be added.
Out of Scope Changes check ✅ Passed The PR is narrowly scoped to the MultiSelect matching check and its allowCreate behavior.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: multi-select now allows adding names that differ only by case.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@t0ng7u t0ng7u merged commit d3b01b4 into QuantumNous:main Jul 10, 2026
1 check passed
@t0ng7u t0ng7u self-assigned this Jul 10, 2026
lansine pushed a commit to evin-pubb/new-api-fork that referenced this pull request Jul 14, 2026
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.

新版UI无法区分大小写,只能强制匹配小写模型

2 participants