feat(desktop): typo auto-correct and context-aware sentence prediction
Some checks failed
ci / 정본·보안·린트·타입·테스트 (push) Has been cancelled
deploy-site / deploy (push) Has been cancelled
ci / 워크스페이스 빌드 검증 (push) Has been cancelled
ci / 모바일 린트·타입·Jest (push) Has been cancelled
ci / Supabase Edge Functions + Cloudflare Worker (push) Has been cancelled
ci / .NET API 서버 테스트 (push) Has been cancelled

Typo auto-correct (INPUT-19)
- TypoCorrectionService + core typo-correction: 2-set Korean layout
  mistypes both ways, always-wrong spellings, near-misses of the user's
  frequent words, optional model check re-validated in core; applied by
  backspace N + paste and cancelled on new keys or window change.

Prediction quality (INPUT-20/21)
- gemma models are sent raw with the user's unfinished sentence pre-filled
  into the model turn, so the model truly continues the text (mid-word
  joins and spacing exact). Other models keep the instruction prompt.
- Context: text before the caret (opening lines and a fact list of names,
  dates, amounts outside the 400-char window), messages just sent in the
  same chat window (memory only, 30 min), personal-graph follow-ups and
  IDF-ranked related sentences with Korean stemming.
- Guards: first sentence only, restated-prefix stripping (also fixes the
  instruction path), repeat drop, no invented dates/names/numbers
  (one retry), plain -다 register, no emoji unless the user uses them,
  search-box keywords. Fill loop mixes instruction prompts for variety.
- Opt-in real-model probe: tests/integration/suggestion-quality.ollama.test.ts

Suggestions now actually show up
- Terminal (Claude Code): caret trust from the input line, not the whole
  screen (status line below the box blocked every keystroke); Korean
  composition counts as typing at the end; a grey placeholder filling the
  empty box at once is not user text.
- Chrome: UIA focus flicker while typing no longer resets "edited".
- KakaoTalk/RichEdit: trailing paragraph mark ignored for edit position
  and stripped so accepted text keeps its separating space.
- While the overlay is visible the suggestion shortcuts are captured so
  Ctrl+Alt+Enter no longer also types a newline; released when hidden.
- nut-js preloaded after boot (first accept waited 4.8 s).
This commit is contained in:
Yun Chan 2026-10-03 21:48:28 +09:00
parent 5ca3709b32
commit 3cac14f668
56 changed files with 4700 additions and 258 deletions

View file

@ -337,6 +337,8 @@
"input.suggestion.minPrefix": "Mindestzeichen",
"input.suggestion.modelDefault": "Standardmodell verwenden",
"input.suggestion.overlayInteractive": "Klick auf das Vorschlagfeld erlauben",
"input.suggestion.typoAutoCorrect": "Tippfehler beim Schreiben korrigieren",
"input.suggestion.typoAutoCorrectHint": "Sobald du innehältst, werden offensichtliche Tippfehler im gerade Geschriebenen sofort korrigiert (falsches Tastaturlayout, häufige Rechtschreibfehler, Vertipper bei oft genutzten Wörtern). Machst du eine Korrektur rückgängig, bleibt dieses Wort künftig unverändert. In Terminals und Code-Editoren aus.",
"input.suggestion.overlayVisible": "Vorschlag wird angezeigt",
"input.suggestion.keyHint": "Übernehmen, wechseln und schließen sind globale Tastenkürzel — ändere sie unter Einstellungen > Tastenkürzel.",
"input.suggestion.requestNow": "Jetzt vorschlagen",

View file

@ -1752,6 +1752,8 @@
"input.suggestion.minPrefix": "Min. characters",
"input.suggestion.modelDefault": "Use default model",
"input.suggestion.overlayInteractive": "Allow clicking the suggestion box",
"input.suggestion.typoAutoCorrect": "Fix typos as you type",
"input.suggestion.typoAutoCorrectHint": "When you pause, obvious typos in what you just typed (wrong keyboard layout, common misspellings, slips in words you use often) are fixed right away. Change a fix back and that word is left alone from then on. Off in terminals and code editors.",
"input.suggestion.overlayVisible": "Suggestion is on screen",
"input.suggestion.keyHint": "Accept, cycle and dismiss are global key bindings — change them in Settings > Shortcuts.",
"input.suggestion.requestNow": "Suggest now",

View file

@ -337,6 +337,8 @@
"input.suggestion.minPrefix": "Caracteres mínimos",
"input.suggestion.modelDefault": "Usar el modelo predeterminado",
"input.suggestion.overlayInteractive": "Permitir clic en el cuadro de sugerencia",
"input.suggestion.typoAutoCorrect": "Corregir erratas al escribir",
"input.suggestion.typoAutoCorrectHint": "Al hacer una pausa, se corrigen al instante las erratas evidentes de lo que acabas de escribir (distribución de teclado equivocada, faltas comunes, deslices en palabras que usas a menudo). Si deshaces una corrección, esa palabra no se volverá a tocar. Desactivado en terminales y editores de código.",
"input.suggestion.overlayVisible": "La sugerencia está en pantalla",
"input.suggestion.keyHint": "Aceptar, alternar y descartar son atajos globales: cámbialos en Ajustes > Atajos.",
"input.suggestion.requestNow": "Sugerir ahora",

View file

@ -337,6 +337,8 @@
"input.suggestion.minPrefix": "Caractères minimum",
"input.suggestion.modelDefault": "Utiliser le modèle par défaut",
"input.suggestion.overlayInteractive": "Autoriser le clic sur la suggestion",
"input.suggestion.typoAutoCorrect": "Corriger les fautes de frappe en tapant",
"input.suggestion.typoAutoCorrectHint": "Dès que vous marquez une pause, les fautes évidentes de ce que vous venez de taper (mauvaise disposition de clavier, fautes d'orthographe courantes, coquilles dans vos mots fréquents) sont corrigées aussitôt. Si vous annulez une correction, ce mot ne sera plus corrigé. Inactif dans les terminaux et les éditeurs de code.",
"input.suggestion.overlayVisible": "Suggestion affichée",
"input.suggestion.keyHint": "Accepter, parcourir et fermer sont des raccourcis globaux — modifiez-les dans Réglages > Raccourcis.",
"input.suggestion.requestNow": "Suggérer maintenant",

View file

@ -337,6 +337,8 @@
"input.suggestion.minPrefix": "最小文字数",
"input.suggestion.modelDefault": "既定のモデルを使用",
"input.suggestion.overlayInteractive": "提案ボックスのクリックを許可",
"input.suggestion.typoAutoCorrect": "入力中の誤字を自動修正",
"input.suggestion.typoAutoCorrectHint": "入力を止めると、直前に打った文の明らかな誤字(韓英切り替えミス、よくある綴り間違い、よく使う単語の打ち間違い)をすぐに直します。直した単語を元に戻すと、その単語は以後直しません。ターミナルやコードエディタでは動作しません。",
"input.suggestion.overlayVisible": "提案を表示中",
"input.suggestion.keyHint": "承認・次候補・閉じるはグローバルキーバインドです(設定 > ショートカット)。",
"input.suggestion.requestNow": "今すぐ提案",

View file

@ -1759,6 +1759,8 @@
"input.suggestion.minPrefix": "최소 글자 수",
"input.suggestion.modelDefault": "기본 모델 사용",
"input.suggestion.overlayInteractive": "제안 상자 클릭 허용",
"input.suggestion.typoAutoCorrect": "입력 중 오타 자동 수정",
"input.suggestion.typoAutoCorrectHint": "멈추면 방금 친 문장의 명백한 오타(한영 전환, 됬→됐 같은 철자, 자주 쓰는 단어의 오타)를 바로 고칩니다. 고친 단어를 원래대로 되돌리면 그 단어는 다시 고치지 않습니다. 터미널·코드 편집기에서는 동작하지 않습니다.",
"input.suggestion.overlayVisible": "제안이 화면에 표시됨",
"input.suggestion.keyHint": "수락·다음 후보·닫기는 전역 키바인딩입니다 — 설정 > 단축키에서 바꿀 수 있습니다.",
"input.suggestion.requestNow": "지금 제안 받기",

View file

@ -337,6 +337,8 @@
"input.suggestion.minPrefix": "Caracteres mínimos",
"input.suggestion.modelDefault": "Usar o modelo padrão",
"input.suggestion.overlayInteractive": "Permitir clique na caixa de sugestão",
"input.suggestion.typoAutoCorrect": "Corrigir erros de digitação ao escrever",
"input.suggestion.typoAutoCorrectHint": "Ao fazer uma pausa, erros óbvios no que você acabou de digitar (layout de teclado errado, erros ortográficos comuns, deslizes em palavras que você usa muito) são corrigidos na hora. Se você desfizer uma correção, essa palavra não será mais corrigida. Desativado em terminais e editores de código.",
"input.suggestion.overlayVisible": "Sugestão na tela",
"input.suggestion.keyHint": "Aceitar, alternar e descartar são atalhos globais — altere em Configurações > Atalhos.",
"input.suggestion.requestNow": "Sugerir agora",

View file

@ -337,6 +337,8 @@
"input.suggestion.minPrefix": "Минимум символов",
"input.suggestion.modelDefault": "Использовать модель по умолчанию",
"input.suggestion.overlayInteractive": "Разрешить клик по окну подсказки",
"input.suggestion.typoAutoCorrect": "Исправлять опечатки при вводе",
"input.suggestion.typoAutoCorrectHint": "Когда вы делаете паузу, явные опечатки в только что набранном тексте (не та раскладка, частые орфографические ошибки, промахи в часто используемых словах) исправляются сразу. Если вернуть исправление обратно, это слово больше не будет исправляться. Не работает в терминалах и редакторах кода.",
"input.suggestion.overlayVisible": "Подсказка на экране",
"input.suggestion.keyHint": "Принять, переключить и закрыть — глобальные сочетания клавиш; измените их в Настройки > Сочетания.",
"input.suggestion.requestNow": "Подсказать сейчас",

View file

@ -337,6 +337,8 @@
"input.suggestion.minPrefix": "จำนวนตัวอักษรขั้นต่ำ",
"input.suggestion.modelDefault": "ใช้โมเดลเริ่มต้น",
"input.suggestion.overlayInteractive": "อนุญาตให้คลิกกล่องคำแนะนำ",
"input.suggestion.typoAutoCorrect": "แก้คำพิมพ์ผิดขณะพิมพ์",
"input.suggestion.typoAutoCorrectHint": "เมื่อคุณหยุดพิมพ์ คำผิดที่ชัดเจนในข้อความที่เพิ่งพิมพ์ (สลับภาษาแป้นพิมพ์ผิด สะกดผิดที่พบบ่อย พิมพ์คำที่ใช้บ่อยผิด) จะถูกแก้ทันที หากคุณเปลี่ยนคำที่แก้กลับเป็นแบบเดิม คำนั้นจะไม่ถูกแก้อีก ไม่ทำงานในเทอร์มินัลและโปรแกรมแก้ไขโค้ด",
"input.suggestion.overlayVisible": "คำแนะนำแสดงอยู่",
"input.suggestion.keyHint": "ยอมรับ เปลี่ยน และปิด เป็นคีย์ลัดส่วนกลาง — แก้ไขได้ที่ ตั้งค่า > คีย์ลัด",
"input.suggestion.requestNow": "ขอคำแนะนำตอนนี้",

View file

@ -337,6 +337,8 @@
"input.suggestion.minPrefix": "Số ký tự tối thiểu",
"input.suggestion.modelDefault": "Dùng mô hình mặc định",
"input.suggestion.overlayInteractive": "Cho phép nhấp vào hộp gợi ý",
"input.suggestion.typoAutoCorrect": "Tự sửa lỗi gõ khi đang nhập",
"input.suggestion.typoAutoCorrectHint": "Khi bạn dừng gõ, các lỗi rõ ràng trong nội dung vừa nhập (sai bố cục bàn phím, lỗi chính tả phổ biến, gõ nhầm từ hay dùng) sẽ được sửa ngay. Nếu bạn hoàn tác một chỗ sửa, từ đó sẽ không bị sửa nữa. Không hoạt động trong terminal và trình soạn thảo mã.",
"input.suggestion.overlayVisible": "Gợi ý đang hiển thị",
"input.suggestion.keyHint": "Chấp nhận, chuyển và đóng là phím tắt toàn cục — đổi trong Cài đặt > Phím tắt.",
"input.suggestion.requestNow": "Gợi ý ngay",

View file

@ -337,6 +337,8 @@
"input.suggestion.minPrefix": "最少字元數",
"input.suggestion.modelDefault": "使用預設模型",
"input.suggestion.overlayInteractive": "允許點擊建議框",
"input.suggestion.typoAutoCorrect": "輸入時自動修正錯字",
"input.suggestion.typoAutoCorrectHint": "停頓時會立即修正剛輸入內容中的明顯錯字(輸入法切換錯誤、常見拼字錯誤、常用詞的誤打)。若把修正改回原樣,該詞之後不再修正。終端機與程式碼編輯器中不會作用。",
"input.suggestion.overlayVisible": "建議正在顯示",
"input.suggestion.keyHint": "接受、切換與關閉都是全域快捷鍵 — 可在設定 > 快捷鍵中修改。",
"input.suggestion.requestNow": "立即建議",

View file

@ -337,6 +337,8 @@
"input.suggestion.minPrefix": "最少字符数",
"input.suggestion.modelDefault": "使用默认模型",
"input.suggestion.overlayInteractive": "允许点击建议框",
"input.suggestion.typoAutoCorrect": "输入时自动纠正错别字",
"input.suggestion.typoAutoCorrectHint": "停顿时会立即纠正刚输入内容中的明显错别字(输入法切换错误、常见拼写错误、常用词的误打)。若把纠正改回原样,该词以后不再纠正。终端和代码编辑器中不生效。",
"input.suggestion.overlayVisible": "建议正在显示",
"input.suggestion.keyHint": "接受、切换与关闭都是全局快捷键 — 可在设置 > 快捷键中修改。",
"input.suggestion.requestNow": "立即建议",