feat(desktop): propose typo fixes inside the suggestion popup and make suggestions snappier

While suggestions are on, typos are no longer replaced silently. The popup shows
the fix next to the candidate and applies it only when the candidate is accepted.
The per-minute request cap rises from 6 to 20 so suggestions keep appearing after
accepting one and continuing to type.
This commit is contained in:
Yun Chan 2026-10-18 07:06:55 +09:00
parent d63854db67
commit f5ae4c8c04
38 changed files with 1239 additions and 660 deletions

View file

@ -97,10 +97,22 @@ export class TextInsertService extends EventEmitter {
* 커서를 옮기지 않고 백스페이스로만 지운다 — 앱마다 다른 단어 이동/선택 동작에 기대지 않는다.
* 다른 삽입과 같은 직렬화 꼬리를 탄다(클립보드 save/restore 가 엇갈리지 않게).
*/
replaceBeforeCaret(deleteCount: number, text: string, method: InsertMethod = 'clipboard'): Promise<InsertResult> {
replaceBeforeCaret(
deleteCount: number,
text: string,
method: InsertMethod = 'clipboard',
options: { commitComposition?: boolean } = {}
): Promise<InsertResult> {
const run = this._tail.then(async () => {
try {
await this._keyboard.backspace(deleteCount)
let count = deleteCount
// 커서 앞 글자가 IME 조합 중이면 먼저 확정한다 (Space → 남은 공백까지 지운다).
if (options.commitComposition && this._keyboard.commitComposition) {
await this._keyboard.commitComposition()
await this._sleep(15)
count += 1
}
await this._keyboard.backspace(count)
} catch (error) {
throw error instanceof D3ROError
? error