贴边探身 Beta:统一多语言状态提示 - #2452
Conversation
WalkthroughWidget Mode 的运行时回退逻辑、八种语言的 Beta 文案及单元测试均更新为新的“贴边探身”命名,并覆盖状态提示、失败提示、开关标签和 tooltip,喵。 ChangesWidget Mode 文案更新
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@static/app/app-widget-mode.js`:
- Around line 125-130: 统一修复 Widget Mode 的 i18n fallback:在 static/i18n-i18next.js
的共享 fallback 中,当 params.defaultValue 为字符串时返回它,否则返回原始翻译 key;同步更新
static/app/app-widget-mode.js 的 toggle 失败提示,以及 static/avatar/avatar-ui-popup.js
第389行和第412行的翻译调用,传入对应的 defaultValue,三处均遵循相同约定。
In `@tests/unit/test_app_widget_mode.py`:
- Around line 211-228: 更新测试中的三个状态提示断言,使用 expected_name 完整匹配 widgetMode 的
enabledNotice、disabledNotice 和 toggleFailed,而不是仅匹配 name_root;同时调整运行时旧名称检查,使用
legacy_names[locale] 的根词进行排除,确保裸旧名称残留也会使契约测试失败。
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: e2bb6f73-6dbe-419d-922f-a65eb02ba371
📒 Files selected for processing (11)
static/app/app-widget-mode.jsstatic/avatar/avatar-ui-popup.jsstatic/locales/en.jsonstatic/locales/es.jsonstatic/locales/ja.jsonstatic/locales/ko.jsonstatic/locales/pt.jsonstatic/locales/ru.jsonstatic/locales/zh-CN.jsonstatic/locales/zh-TW.jsontests/unit/test_app_widget_mode.py
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
Project-N-E-K-O/N.E.K.O.-PC(manual)
Widget Mode 多语言名称补充本 PR 最终采用以下 8 个 locale 名称:
中文强调“贴边 + 探身”的实际表现;英文保留产品名称 边界保持不变:不重命名 i18n key、API、事件名或内部 |
a9d490b to
f0d560e
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f0d560eee6
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| "widgetMode": { | ||
| "enabledNotice": "Edge Peek is on.", | ||
| "disabledNotice": "Edge Peek is off. Live2D is visible and draggable again.", | ||
| "enabledNotice": "Widget Mode Beta is on.", |
There was a problem hiding this comment.
Bump the locale cache version with these strings
When this release is installed over a previous build, users whose browser/Electron cache already has /static/locales/<lng>.json?v=2026-07-27-merged-main-i18n can keep seeing the old Widget Mode notices, because the locale JSON is fetched via the fixed LOCALE_VERSION in static/i18n-i18next.js rather than the template asset version. Please bump that locale version (or otherwise vary the locale URL) alongside these locale edits so the updated localized status copy is actually fetched.
Useful? React with 👍 / 👎.
改动概述
PR #2467 已完成贴边探身父级能力、隐身模式子状态和互动生命周期的实现,并移除了网页头像设置中的 Widget Mode 入口。本 PR 仅在该架构上收口用户可见名称:
app-widget-mode.js的中文 fallback;当翻译缺失、为空或返回原始 key 时,仍显示标准名称。与 #2467 的关系
风险与边界