Repository navigation
fix(input-dot): 点文字末尾时常误触输入翻译圆点、整段被译文替换 —— 圆点沿用逐段翻译按钮 4px 的间隙,可点区只与文字末尾隔开 1px,点在最后一个字右半边或点偏一点就落进可点区;圆点改用自己的 8px 安全距离,约束落在可点区上,末尾之后、下方、上方、光标另一侧四种摆法都与末尾隔开这段距离(#1180) - #1181
Merged
Conversation
…末尾隔开 1px,点在最后一个字右半边或点偏一点就落进可点区;圆点改用自己的 8px 安全距离,约束落在可点区上,末尾之后、下方、上方、光标另一侧四种摆法都与末尾隔开这段距离(#1180)
…圆点推回安全距离以内;末尾在可见区域里时,钳边之后再守一次安全距离,圆点宁可伸出框外(末尾是硬边界、框是软边界),末尾滚出可见区域时照旧钳在边缘(#1180)
…AP 并列(#1180) - 圆点贴文字末尾的期望位置从“末尾 + 4px”改为“末尾 + INPUT_DOT_SAFE_DISTANCE”,e2e 直接引用源码里的常量,不再写死数字 - TC-E2E-137 窄框换到下方的那一步,加断言可点区上沿离光标所在那一行至少安全距离 - 单测删掉只断言常量本身的那一条;补上“行高收小后换到下方”“末尾滚出可见区域仍钳在框内”两条
…生效;拖之前先把滑块滚进视口(修 #1180 时发现,main 上同样红) Co-Authored-By: zhexuancai-uts <261878103+zhexuancai-uts@users.noreply.github.com>
Teeeeeeeerry
added a commit
that referenced
this pull request
Nov 20, 2026
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.
问题
在输入框里点文字末尾想把光标放回去,或者点最后几个字改错字时,常常点中的是输入翻译圆点,整段文字被译文替换。
根因
圆点沿用了逐段翻译按钮 4px 的间隙。可点区(透明的一圈,至少 24px 见方)虽然不往文字末尾那一侧伸,但只保证和末尾隔开 1px。点在最后一个字的右半边、或者点偏一点,就落进了圆点的可点区。换到末尾那一行下方、上方时,竖直方向也只隔 1px。
另外,窄的单行框里,如果末尾两侧都放不下圆点,“光标另一侧”这种摆法会被钳回框内,直接压在光标上。
修复
INPUT_DOT_SAFE_DISTANCE = 8(约半个常见字宽),和逐段翻译按钮的GAP(仍为 4px)分开。验证
pnpm test:215 个文件、2646 条通过;pnpm typecheck通过。Closes #1180