feat(input): upgrade graph personalization, english morphology detection, and atomic SendInput replacement

This commit is contained in:
Yun Chan 2026-10-29 08:16:26 +09:00
parent 52eef21bab
commit cd4a452148
21 changed files with 1098 additions and 110 deletions

View file

@ -104,6 +104,24 @@ export class TextInsertService extends EventEmitter {
options: { commitComposition?: boolean } = {}
): Promise<InsertResult> {
const run = this._tail.then(async () => {
if (method === 'keyboard' && this._keyboard.replaceBeforeCaret) {
const start = performance.now()
const handled = await this._keyboard.replaceBeforeCaret(deleteCount, text, options)
if (handled) {
this.emit('insert-started', { text, method: 'keyboard' })
const result: InsertResult = {
success: true,
method: 'keyboard',
textLength: text.length,
durationMs: performance.now() - start
}
this.emit('insert-completed', { result })
logger.info(
`Text replaced atomically (-${deleteCount} / +${text.length} chars, ${Math.round(result.durationMs)}ms, keyboard)`
)
return result
}
}
try {
let count = deleteCount
// 커서 앞 글자가 IME 조합 중이면 먼저 확정한다 (Space → 남은 공백까지 지운다).