T2: 实现首次语言检测逻辑 (closes #109) - #121
Merged
Merged
Conversation
devcxl
commented
Jun 29, 2026
devcxl
left a comment
Owner
Author
There was a problem hiding this comment.
审查结论:有条件通过 ✅
验证结果
- 全部 781 个测试通过(含 15 个语言检测测试)
detectLanguage()逻辑正确:zh→zh-CN, en→en, 其它→zh-CNdetectAndSetLanguage()raw storage 策略正确,成功避免默认值干扰- 无越界修改,仅新增 2 个文件
发现问题:3 Medium + 1 Low(均不阻塞合并)
| 级别 | 问题 |
|---|---|
| MEDIUM | mockBrowserStorage 与 config-store 测试重复,建议抽取共享 mock |
| MEDIUM | 缺少 preferences key 不存在的边界测试(逻辑正确但无显式覆盖) |
| MEDIUM | detectAndSetLanguage 无错误处理,极端情况下可能抛出未捕获异常 |
| LOW | 测试中断言风格轻微不一致 |
详细审查报告见 docs/review/pr-121-review.md
…ault value interference
devcxl
force-pushed
the
feat/implement-language-detector
branch
from
June 29, 2026 01:17
daa1505 to
b584aa7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更说明
实现语言检测 infrastructure,首次启动自动检测浏览器语言。
detectLanguage()— navigator.language 匹配逻辑detectAndSetLanguage()— 首次启动写入 ConfigStore验收标准
Closes #109