feat(persona)/add distinct voice-first Neko presets - #2560
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
Walkthrough本次更新新增六组人格预设及多语言卡片、提示词内容,加入语言切换刷新机制,收紧 onboarding 布局,并同步更新前端与路由测试喵。 Changes人格预设与 onboarding
Estimated code review effort: 4 (Complex) | ~45 minutes 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
🧹 Nitpick comments (4)
tests/frontend/test_initial_personality_onboarding.py (1)
1690-1705: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value像素级的「不出滚动条」断言在 CI 里可能会闹脾气喵。
shellScrollHeight <= shellClientHeight + 1和actionsBottom <= viewportHeight完全取决于 headless 环境的字体度量;换个 CI 镜像、字体缺失回退、或者以后有人给标题加两个字,都可能让这条断言莫名其妙地红掉呐。列数断言(Line 1689 / 1711)本身已经把「两列/一列」的核心契约锁住了喵。如果只是想防「布局撑爆」的回归,放宽成一个小容差(比如几像素)会更耐造一点;当然要是本地跑得稳,留着也行喵~
🤖 Prompt for 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. In `@tests/frontend/test_initial_personality_onboarding.py` around lines 1690 - 1705, Relax the pixel-sensitive assertions in the desktop layout check around desktop_fit, allowing a small multi-pixel tolerance for actionsBottom versus viewportHeight and shellScrollHeight versus shellClientHeight. Preserve the existing column-count assertions as the primary layout contract while still detecting substantial overflow.static/css/character_personality_onboarding.css (1)
628-636: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value720px 里的
min-height: 208px和桌面一模一样,写了等于没写喵。单列布局下卡片宽度变大、文案更容易一行放完,反而可以更矮一点;现在这条声明只是把桌面值又抄了一遍呐。
另外 720px 这个新断点和文件里原有的
max-width: 900px媒体块并存,720–900px 这段区间是「两列 + 900px 旧覆盖」的组合,而新测试只验了 1280 和 680 两个宽度喵。有空的话顺手截图看一眼平板宽度会不会挤到出滚动条~🎨 可选的清理方式
`@media` (max-width: 720px) { .character-personality-grid { grid-template-columns: 1fr; } - - .character-personality-card { - min-height: 208px; - } }🤖 Prompt for 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. In `@static/css/character_personality_onboarding.css` around lines 628 - 636, Update the 720px `.character-personality-card` rule to use a mobile-specific min-height shorter than the desktop value instead of repeating 208px. Also verify the combined behavior of the existing 900px media rule and the new 720px breakpoint across 720–900px, ensuring the two-column layout does not create horizontal overflow.utils/persona_presets.py (2)
146-148: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value旧人格数据已经彻底走不通了喵,注释只写在
_PERSONA_SHARED_EN上有点孤单呢。
_build_persona_prompt一开头就用_ACTIVE_PRESET_IDS拦住了,所以classic_genki/tsundere_helper/elegant_butler/venomous_jirai_girl/silly_tang_cat在_PERSONA_SHARED_EN和_PERSONA_L10N里的几百行都是不可达数据喵。既然这里已经解释了保留原因,建议在_PERSONA_L10N(Line 216 附近)也补一句同样的说明,否则下一个人看到那一大坨多语言文案会以为它还生效喵~(或者干脆后续 PR 一起清掉,本来就只是历史文本嘛)🤖 Prompt for 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. In `@utils/persona_presets.py` around lines 146 - 148, 在 `_PERSONA_L10N` 定义附近补充与 `_PERSONA_SHARED_EN` 一致的注释,明确说明旧人格文案仅作为历史提示词源文本保留,因 `_build_persona_prompt` 开头的 `_ACTIVE_PRESET_IDS` 校验而不可解析,且已保存覆盖使用 `prompt_guidance` 和 `profile`。不要修改或删除多语言文案内容。
888-889: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value
_PERSONA_PERFORMANCE_L10N/_PERSONA_VOICE_SIGNATURE_L10N只覆盖 4 个 active 预设,未来复活旧预设会直接 KeyError 喵。
_build_persona_prompt里 Line 1014 与 Line 1017 是直接下标取值,现在靠「_ACTIVE_PRESET_IDS恰好等于这两张表的键集」才安全喵。哪天有人把venomous_jirai_girl加回_PRESETS,就会当场炸 KeyError 而不是优雅降级。建议在这两张表上方加一行注释,明确「键集必须与_PRESETS保持一致」,人格增删时才不会踩坑喵~Also applies to: 944-945
🤖 Prompt for 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. In `@utils/persona_presets.py` around lines 888 - 889, 在 _PERSONA_PERFORMANCE_L10N 和 _PERSONA_VOICE_SIGNATURE_L10N 定义上方添加注释,明确两张本地化表的键集必须与 _PRESETS 保持一致;同时说明新增、移除或复活人格预设时必须同步更新这两张表,避免 _build_persona_prompt 中的直接下标访问触发 KeyError。
🤖 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/locales/zh-CN.json`:
- Line 1988: Update the "boundaries" entry in static/locales/zh-CN.json to
preserve the source text’s five separate items: 敷衍、失约、无视边界、情绪勒索、控制;do not merge
items or change “控制” to “跟踪控制”.
In `@tests/frontend/test_initial_personality_onboarding.py`:
- Around line 117-126: 补齐该 personality mock 的 profile 数据,使其与真实 persona preset
返回结构一致:在现有 profile 中加入“性格”和“隐藏设定”字段,并提供适合病弱妹妹预设的非空中文值,确保 buildPreviewCopy 的
profileSummary fallback 不会退化为裸 i18n key。
---
Nitpick comments:
In `@static/css/character_personality_onboarding.css`:
- Around line 628-636: Update the 720px `.character-personality-card` rule to
use a mobile-specific min-height shorter than the desktop value instead of
repeating 208px. Also verify the combined behavior of the existing 900px media
rule and the new 720px breakpoint across 720–900px, ensuring the two-column
layout does not create horizontal overflow.
In `@tests/frontend/test_initial_personality_onboarding.py`:
- Around line 1690-1705: Relax the pixel-sensitive assertions in the desktop
layout check around desktop_fit, allowing a small multi-pixel tolerance for
actionsBottom versus viewportHeight and shellScrollHeight versus
shellClientHeight. Preserve the existing column-count assertions as the primary
layout contract while still detecting substantial overflow.
In `@utils/persona_presets.py`:
- Around line 146-148: 在 `_PERSONA_L10N` 定义附近补充与 `_PERSONA_SHARED_EN`
一致的注释,明确说明旧人格文案仅作为历史提示词源文本保留,因 `_build_persona_prompt` 开头的 `_ACTIVE_PRESET_IDS`
校验而不可解析,且已保存覆盖使用 `prompt_guidance` 和 `profile`。不要修改或删除多语言文案内容。
- Around line 888-889: 在 _PERSONA_PERFORMANCE_L10N 和
_PERSONA_VOICE_SIGNATURE_L10N 定义上方添加注释,明确两张本地化表的键集必须与 _PRESETS
保持一致;同时说明新增、移除或复活人格预设时必须同步更新这两张表,避免 _build_persona_prompt 中的直接下标访问触发 KeyError。
🪄 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: d29922f1-bb9e-4a0b-81e5-60f49cb6eec8
📒 Files selected for processing (14)
static/css/character_personality_onboarding.cssstatic/js/character_personality_onboarding.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/frontend/test_initial_personality_onboarding.pytests/unit/test_character_persona_router.pytests/unit/test_persona_presets.pyutils/persona_presets.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)
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/locales/pt.json`:
- Around line 1941-1945: Update the speechHabits entry for this profile to
remove “frio” and “insônia” as reasons for seeking company, and add the
constraint that she does not continue trying to keep the user after being
refused. Keep the existing non-coercive behavior and boundaries intact.
🪄 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: 29c6d6e0-a045-4473-a94d-be7508c53335
📒 Files selected for processing (10)
static/css/character_personality_onboarding.cssstatic/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/frontend/test_initial_personality_onboarding.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)
🚧 Files skipped from review as they are similar to previous changes (5)
- static/locales/es.json
- static/locales/ja.json
- static/locales/ru.json
- static/locales/zh-TW.json
- static/locales/ko.json
…mifox/N.E.K.O-Himifox into fix(role)/reset-the-role-card
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
static/locales/es.json (1)
1943-1943: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win别把体弱当成留人的理由喵。 这两处把“冷/失眠”写成索要陪伴的理由,会和该预设“不用健康状况留人、被拒即停止”的核心边界相冲突,也会误导用户预期喵。
static/locales/es.json#L1943-L1943: 改为仅在休息、分别或自然亲近的场景请求一次陪伴,并明确被拒后不再追问喵。static/locales/ja.json#L1943-L1943: 同步移除以寒冷或失眠作为理由的表述,改为自然场景下的一次请求与拒绝后停止喵。🤖 Prompt for 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. In `@static/locales/es.json` at line 1943, Update the speechHabits entry at static/locales/es.json:1943-1943 to request companionship only once during rest, parting, or naturally intimate moments, and explicitly stop asking after rejection. Apply the same change to static/locales/ja.json:1943-1943, removing coldness or insomnia as reasons for seeking company.
🤖 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.
Outside diff comments:
In `@static/locales/es.json`:
- Line 1943: Update the speechHabits entry at static/locales/es.json:1943-1943
to request companionship only once during rest, parting, or naturally intimate
moments, and explicitly stop asking after rejection. Apply the same change to
static/locales/ja.json:1943-1943, removing coldness or insomnia as reasons for
seeking company.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: fb30a594-4552-40d7-8bba-bbebd3cf2ac2
📒 Files selected for processing (11)
static/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_character_persona_router.pytests/unit/test_persona_presets.pyutils/persona_presets.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)
🚧 Files skipped from review as they are similar to previous changes (5)
- static/locales/zh-CN.json
- static/locales/zh-TW.json
- static/locales/pt.json
- static/locales/ru.json
- static/locales/ko.json
…mifox/N.E.K.O-Himifox into fix(role)/reset-the-role-card
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/js/character_personality_onboarding.js`:
- Around line 436-462: Update refreshForLocaleChange to re-read the current
stage-two visibility and selectedPresetId after await
fetchPresets(nextLanguage), immediately before deciding which stage to render.
Use these post-fetch values to preserve a user-triggered renderStageOne
navigation, while retaining the existing locale runId and empty-presets guards.
🪄 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: 6ec998c4-bbf7-472b-a638-0042e48bd23e
📒 Files selected for processing (4)
static/i18n-i18next.jsstatic/js/character_personality_onboarding.jstests/frontend/test_initial_personality_onboarding.pytests/unit/test_persona_presets.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)
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
static/locales/ru.json (1)
1942-1942: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win修正“不用身体不适挽留”的俄语表达喵
не удерживает здоровьем不是自然的俄语,可能让模型误解为“用健康留住对方”,无法清楚表达“不用身体不适、悲伤或内疚感挽留”喵。建议改成не удерживает ссылками на плохое самочувствие, грустью или чувством вины,并在当前已有的多语言变更 hunk 内一起调整,避免破坏 locale 同步检查喵。🤖 Prompt for 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. In `@static/locales/ru.json` at line 1942, Update the Russian hiddenRule translation to replace the unnatural “не удерживает здоровьем” wording with the suggested expression using “ссылками на плохое самочувствие”, while preserving the existing meaning about not holding someone back with sadness or guilt and keeping the change within the current localized entry.Source: Learnings
🤖 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.
Outside diff comments:
In `@static/locales/ru.json`:
- Line 1942: Update the Russian hiddenRule translation to replace the unnatural
“не удерживает здоровьем” wording with the suggested expression using “ссылками
на плохое самочувствие”, while preserving the existing meaning about not holding
someone back with sadness or guilt and keeping the change within the current
localized entry.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 84aa6653-2ac4-44e3-bb2b-e38f58bd0eb0
📒 Files selected for processing (6)
static/locales/en.jsonstatic/locales/es.jsonstatic/locales/ja.jsonstatic/locales/ko.jsonstatic/locales/pt.jsonstatic/locales/ru.json
🔗 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)
🚧 Files skipped from review as they are similar to previous changes (5)
- static/locales/es.json
- static/locales/en.json
- static/locales/ja.json
- static/locales/ko.json
- static/locales/pt.json
Greptile Summary本次 PR 重做四套多语言人格预设,并优化人格选择界面的布局与语言切换刷新行为喵。
Confidence Score: 5/5当前未发现仍需阻止合并的故障,这个 PR 看起来可以安全合并喵。 先前报告的异步语言刷新问题已通过读取请求完成后的实时阶段可见性与当前选择来修复,当前没有遗留的阻塞性失败喵。
|
| Filename | Overview |
|---|---|
| static/js/character_personality_onboarding.js | 新增弹窗语言切换刷新及异步失效保护;先前报告的返回导航被旧请求恢复的问题在当前实现中已解决喵。 |
| static/css/character_personality_onboarding.css | 收紧弹窗和卡片尺寸,将桌面网格改为 2×2,并为窄屏提供单列布局喵。 |
| utils/persona_presets.py | 重做四套人格 Prompt,同时维持既有预设接口和字段契约喵。 |
| tests/frontend/test_initial_personality_onboarding.py | 更新人格选择界面的布局、文案及语言刷新相关测试喵。 |
| tests/unit/test_persona_presets.py | 更新人格预设内容、字段与多语言约束的单元测试喵。 |
Sequence Diagram
sequenceDiagram
participant U as 用户
participant UI as 人格选择弹窗
participant API as 人格预设接口
U->>UI: 切换语言
UI->>API: 获取新语言的人格预设
U->>UI: 可继续返回、选择或关闭
API-->>UI: 返回本地化预设
UI->>UI: 校验运行标识与实时界面状态
alt 弹窗仍在第二阶段且选择有效
UI->>UI: 使用当前选择刷新预览
else 已返回第一阶段
UI->>UI: 保持第一阶段
end
Reviews (3): Last reviewed commit: "fix(onboarding): invalidate stale locale..." | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fa31d7174f
ℹ️ 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".
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
static/js/character_personality_onboarding.js (1)
436-462: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win让 overlay 隐藏或重新打开时使旧刷新请求失效喵
当前只校验
runId;请求等待期间如果用户关闭 overlay,再重新打开它,旧请求仍可能通过校验并在 Line 449-460 覆盖新语言的presets。请在隐藏/重新打开 overlay 时递增刷新令牌,并在await后同时确认 overlay 仍是同一个且仍可更新喵。🤖 Prompt for 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. In `@static/js/character_personality_onboarding.js` around lines 436 - 462, Update refreshForLocaleChange and the overlay hide/reopen lifecycle to invalidate localeRefreshRunId whenever the overlay is hidden or reopened. Capture the overlay instance before fetchPresets, then after awaiting verify both the runId and that the same overlay instance is still present and visible before updating presets or rendering stages.
🤖 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.
Outside diff comments:
In `@static/js/character_personality_onboarding.js`:
- Around line 436-462: Update refreshForLocaleChange and the overlay hide/reopen
lifecycle to invalidate localeRefreshRunId whenever the overlay is hidden or
reopened. Capture the overlay instance before fetchPresets, then after awaiting
verify both the runId and that the same overlay instance is still present and
visible before updating presets or rendering stages.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 93e1bf55-6540-4311-89e5-76d8ebaf06cf
📒 Files selected for processing (2)
static/js/character_personality_onboarding.jsutils/persona_presets.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)
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
|
已处理 CodeRabbit 的 outside-diff overlay 生命周期建议(review |
|
@codex review |
|
codex这是死了吗? |
改动概述 / Summary
main分支原有三套初始人格的字段、Prompt 模板和接口为结构基线,重做四种差异化猫娘人格:{MASTER_NAME},卡片文案使用自然关系称呼。main原有章节结构,不新增Voice Interaction、Distinctive Behavior、角色字段、接口字段或 locale key。回归报告 / Regression Report
不适用。本 PR 未修改
app/、main_logic/或memory/下的 Python 文件。不拆分理由 / Why Not Split
不适用。排除 i18n locale 文件和测试文件后,计入上限的改动文件不超过 20 个。
测试 / Testing
人格预设与接口单元测试:
结果:
人格选择页前端测试:
当前本地结果:
5 个错误均发生在 session fixture 复制正在使用的应用数据目录时;
runtime/launcher.lock被运行中的应用占用并返回Permission denied。错误发生在相关浏览器用例进入测试逻辑之前,不是人格或布局断言失败。此外已通过:
八种语言的 locale JSON 均已验证可正常解析。
----------end----------
Summary by CodeRabbit