fix(desktop): prevent Korean character swallowing in terminal and xterm.js surfaces (INPUT-04, INPUT-19)

This commit is contained in:
Yun Chan 2026-10-31 03:38:56 +09:00
parent f18cebaa24
commit 61123b5ad8
11 changed files with 264 additions and 50 deletions

View file

@ -589,6 +589,40 @@ describe('TypoCorrectionService', () => {
).toBe('pass')
expect(fake.replaceBeforeCaret).not.toHaveBeenCalled()
})
it('터미널에서 공백 없이 끝난 한글 음절(예: ㅎ샤ㅗㅕㅠ에)은 조합 중 글자를 삼키지 않도록 공백 확정 전까지 치환하지 않는다', async () => {
const fake = deps({ warmModel: () => null })
const service = new TypoCorrectionService(fake.deps)
// 공백 전(조합 중인 마지막 음절 '에' 가 아직 xterm-helper-textarea 안에 있을 때)에는 건드리지 않는다.
expect(
service.handleTypingContext(
typingContext({
prefix: 'ㅎ샤ㅗㅕㅠ에',
appName: 'Agent Switchboard.exe',
terminalMode: true,
isComposing: true,
idleMs: 1200
})
)
).toBe('pass')
expect(fake.replaceBeforeCaret).not.toHaveBeenCalled()
// 공백으로 어절이 확정된 뒤('ㅎ샤ㅗㅕㅠ에 ')에는 'github에 ' 로 정상 치환한다.
expect(
service.handleTypingContext(
typingContext({
prefix: 'ㅎ샤ㅗㅕㅠ에 ',
appName: 'Agent Switchboard.exe',
terminalMode: true,
isComposing: false,
idleMs: 80
})
)
).toBe('correcting')
await flush()
expect(fake.replaceBeforeCaret).toHaveBeenCalledWith('ㅎ샤ㅗㅕㅠ에 '.length, 'github에 ')
})
})
describe('TypoCorrectionService.propose — 제안 창에 함께 내놓을 교정 (적용하지 않음)', () => {