Skip to content

fix: fix CC Switch model selector - #5515

Merged
seefs001 merged 1 commit into
QuantumNous:mainfrom
seefs001:fix/cc-switch-codex-selector
Jun 15, 2026
Merged

fix: fix CC Switch model selector#5515
seefs001 merged 1 commit into
QuantumNous:mainfrom
seefs001:fix/cc-switch-codex-selector

Conversation

@seefs001

@seefs001 seefs001 commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

⚠️ 提交说明 / PR Notice

Important

  • 请提供人工撰写的简洁摘要,避免直接粘贴未经整理的 AI 输出。

📝 变更描述 / Description

(简述:做了什么?为什么这样改能生效?请基于你对代码逻辑的理解来写,避免粘贴未经整理的内容)

修复codex/gemini导入cc switch看不到下拉模型列表数据的样式问题。
修正cc switch i18n

🚀 变更类型 / 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

(请在此粘贴截图、关键日志或测试报告,以证明变更生效)

Summary by CodeRabbit

  • Style

    • Adjusted dialog layout spacing for the CC Switch feature based on app configuration.
  • Chores

    • Updated "CC Switch" translations across French, Japanese, Russian, Vietnamese, and Chinese locales.

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

Walkthrough

CCSwitchDialog gains a conditional bodyClassName that adds pb-52 bottom padding when the selected app's modelFields array has exactly one entry, fixing a dropdown occlusion issue. Separately, the "CC Switch" translation value is reverted to the English string "CC Switch" across French, Japanese, Russian, Vietnamese, and Chinese locale files.

Changes

CCSwitchDialog Layout Fix and i18n Normalization

Layer / File(s) Summary
Conditional bodyClassName padding
web/default/src/features/keys/components/dialogs/cc-switch-dialog.tsx
bodyClassName is now a conditional expression: adds pb-52 when the selected app has exactly one modelField, otherwise keeps space-y-4, fixing dropdown occlusion for single-field apps like Codex.
CC Switch label normalized to English
web/default/src/i18n/locales/fr.json, web/default/src/i18n/locales/ja.json, web/default/src/i18n/locales/ru.json, web/default/src/i18n/locales/vi.json, web/default/src/i18n/locales/zh.json
The "CC Switch" translation value is set to the untranslated string "CC Switch" in all five locale files, replacing French, Japanese, Russian, Vietnamese, and Chinese translations.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • QuantumNous/new-api#5346: Refactored cc-switch-dialog.tsx to use a shared prop-driven Dialog layout, which is the direct predecessor to the conditional bodyClassName change introduced in this PR.

Poem

🐇 Hop hop, the dropdown was lost from view,
Tucked under the field where no rabbit could see,
A sprinkle of pb-52 and it popped into view,
CC Switch stays "CC Switch" — consistent and free,
Five locales now speak the same English refrain,
The bunny fixed padding and i18n in one lane! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: fix CC Switch model selector' directly addresses the main issue from #5501 about the non-functional model selector in CC Switch, which is the primary change in this PR.
Linked Issues check ✅ Passed The PR fixes the CC Switch model selector styling issue (#5501) by adding conditional bottom padding when modelFields has one field, allowing the dropdown to display properly for Codex/Gemini models.
Out of Scope Changes check ✅ Passed All changes are in-scope: the main fix addresses the model selector dropdown display issue, while i18n updates align with the CC Switch feature correction mentioned in PR objectives.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

@seefs001
seefs001 merged commit 9bc1a53 into QuantumNous:main Jun 15, 2026
1 of 2 checks passed
YeMao11 pushed a commit to YeMao11/new-api that referenced this pull request Jun 16, 2026
Upstream changes (50+ commits, v1.0.0-rc.11):
- data-table perf: row selection memo, column pinning, badge display
- Fixes: channel test dialog (QuantumNous#5517), CC Switch model selector (QuantumNous#5515),
  API key form options (QuantumNous#5512), cell overflow (QuantumNous#5510), kimi k2.6 temp (QuantumNous#5390),
  Anthropic-compatible GLM chunked encoding (QuantumNous#5307), streaming image relay (QuantumNous#4608)
- Feat: audit auth method tracking (QuantumNous#5462), channel affinity clear toggle (QuantumNous#5306),
  relay idle timeout config (QuantumNous#5309), 6-decimal pricing precision (QuantumNous#5332)
- Classic frontend: Rsbuild support, Semi React 19 adapter
- Shared dialog wrapper, JSON code editor, debounce channel search

Conflict resolved: web/bun.lock (accepted upstream, will regenerate)

Co-Authored-By: Claude <noreply@anthropic.com>
YeMao11 pushed a commit to YeMao11/new-api that referenced this pull request Jun 16, 2026
Merge upstream v1.0.0-rc.11 (50+ commits):
- data-table perf: row selection memo, column pinning, badge display
- Fixes: channel test dialog (QuantumNous#5517), CC Switch (QuantumNous#5515), API key (QuantumNous#5512),
  kimi k2.6 temp (QuantumNous#5390), GLM chunked encoding (QuantumNous#5307), streaming image (QuantumNous#4608)
- Feat: audit auth tracking (QuantumNous#5462), channel affinity toggle (QuantumNous#5306),
  relay idle timeout (QuantumNous#5309), 6-decimal pricing (QuantumNous#5332)
- Shared dialog wrapper, JSON code editor, classic Rsbuild support

SEO optimization:
- robots.txt: 10 AI crawler blocks + 22 path disallows + crawl-delay
- sitemap.xml: 7 public URLs with 6-language hreflang annotations
- index.html: hreflang tags, og:locale:alternate, og:image, canonical,
  5 structured data types (Organization, SoftwareApplication, FAQPage,
  WebSite, SearchAction), expanded keywords (gateway, agent router,
  aggregation, orchestration)
- i18n/config.ts: sync <html lang> with active language for SEO

Co-Authored-By: Claude <noreply@anthropic.com>
ruanhangjian pushed a commit to ruanhangjian/new-api that referenced this pull request Jul 11, 2026
noah-wung pushed a commit to noah-wung/new-api that referenced this pull request Jul 17, 2026
zhaodechao2008 pushed a commit to zhaodechao2008/new-api that referenced this pull request Jul 27, 2026
330079598 pushed a commit to 330079598/new-api that referenced this pull request Aug 19, 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密钥cc切换,选择codex,主模型无法选择,手动填写模型名无效

1 participant