Skip to content

输入翻译圆点在多行文本框里贴文字末尾:镜像测量复制排版样式量出末尾坐标,量不出来时回落框内侧右下角(#665) - #702

Merged
Teeeeeeeerry merged 2 commits into
mainfrom
feat/665-textarea-dot-at-text-end
Oct 5, 2026
Merged

Teeeeeeeerry merged 2 commits into
mainfrom
feat/665-textarea-dot-at-text-end

Conversation

@Teeeeeeeerry

Copy link
Copy Markdown
Owner

问题

输入翻译的圆点一直待在框内侧右下角。这是 ADR-0006 明确否决的方案:那一角被站点的发送、表情、附件、字数等控件占满,视线也要离开刚打完的文字。ADR-0006 定的是圆点贴文字末尾,右下角只作测不出来时的回落。

根因

圆点只有 placeFallback() 一种定位。多行文本框的内容是 value 而不是 DOM 文本,逐段按钮用的 Range 量不到末尾,必须另建镜像元素来测量,而这个测量还没有。

修复

验证

  • 端到端 TC-E2E-134(真实浏览器断言位置,误差不超过 2px):
    • 真值是框的内容区起点与行高,加上用画布按同一字体量出的文字宽度
    • 覆盖首行末尾、换行后第二行末尾、连按两次回车后的空行行首、末尾空格计入宽度
    • 在未实现的代码上跑过,红(横向差 307px)
  • TC-E2E-111 原来断言圆点在框的右下半区,那是回落位置;现在位置由规格改为贴文字末尾,这条改为断言圆点在框内,精确位置交给 TC-E2E-134
  • 单元(生命周期注册表):jsdom 没有布局,只覆盖回落分支 —— 量不出来时多行文本框回落框内侧右下角、照常显示、量完不留镜像
  • pnpm test 115 个文件 1418 条全绿;pnpm typecheck 通过;pnpm build 通过;pnpm test:e2e:core 91 过、2 跳过

Closes #665

Teeeeeeeerry and others added 2 commits October 5, 2026 12:26
Co-Authored-By: zhexuancai-uts <261878103+zhexuancai-uts@users.noreply.github.com>
@Teeeeeeeerry
Teeeeeeeerry merged commit b6ce2d7 into main Oct 5, 2026
6 checks passed
@Teeeeeeeerry
Teeeeeeeerry deleted the feat/665-textarea-dot-at-text-end branch October 5, 2026 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

输入翻译:多行文本框的圆点贴文字末尾(镜像测量)(#633)

1 participant