Repository navigation
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eb980fb913
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
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.
问题
群友反馈译文会超出对话框,希望「超过对话框就缩小字号」。这个功能本来就有,但判断经常出错:
改动
web/reader/modules/text-place.js:inject.js等翻译时会按最近三句译文的高度预留空间。逐字定位和锚定的窗口里,这个预留在译文就绪后还在,短译文被当成长译文来量。现在这两种窗口里就绪的译文不再带预留(对话带除外,避免原文跳动)shrinkTo(),逐步缩小、每步实测,只缩到刚好放得下,最多缩 15%。apply()、pin()、underGameLine()、applyPage()共用它pin()写进去的字号和高度限制placement.bottomReserveLines(core/profiles/defaults.cjs,默认 1.3,原行为不变;domains.cjs登记 0~6)。底下没有按钮条的游戏可以在自己的差分里设 0,用满整个高度。档案还没加载时按 1.3 算开关:
translationAutoShrink,两份game-style.js的默认值和清洗规则一致;默认开,旧设置文件里没有这个字段时也按开处理game-fit.js)都不缩译文字号,放不下的部分截断或滚动;切换时当前这句立刻重排验证
新增
validation/translation-auto-shrink.test.cjs,在无头 Edge 里跑阅读层的真实代码,只模拟宿主消息。在 origin/main(c6a9722a)上 5 项失败、1 项通过(对照):本分支全部通过;
text-place-user-row-layout、text-place-dom也都通过。PR 前做过一次独立只读审查,查出的问题都已在第二个提交里修掉:
text-place-user-row-layout的正则对不上了未验证: