feat(input,voice): instant first-word-after-focus PC layout fix and speech disfluency post-processing (INPUT-04, INPUT-19, AI-03, AI-05)

This commit is contained in:
Yun Chan 2026-10-29 19:05:01 +09:00
parent dbed97c348
commit 7a86afa7b0
22 changed files with 359 additions and 39 deletions

View file

@ -36,12 +36,12 @@ beforeEach(async () => {
describe('CustomInstructionService', () => {
describe('initialize + getAll', () => {
it('첫 실행 시 5개 프리셋이 생성된다', () => {
it('첫 실행 시 6개 프리셋이 생성된다', () => {
const svc = getCustomInstructionService()
svc.initialize()
const all = svc.getAll()
expect(all.length).toBe(5)
expect(all.length).toBe(6)
expect(all.every((i) => i.isBuiltin)).toBe(true)
})
@ -88,7 +88,7 @@ describe('CustomInstructionService', () => {
expect(created.isBuiltin).toBe(false)
expect(created.name).toBe('My Custom')
expect(svc.getAll().length).toBe(6)
expect(svc.getAll().length).toBe(7)
})
})
@ -127,7 +127,7 @@ describe('CustomInstructionService', () => {
svc.initialize()
expect(svc.delete('builtin-translate')).toBe(false)
expect(svc.getAll().length).toBe(5)
expect(svc.getAll().length).toBe(6)
})
it('사용자 정의 명령어는 삭제할 수 있다', () => {
@ -142,7 +142,7 @@ describe('CustomInstructionService', () => {
})
expect(svc.delete(created.id)).toBe(true)
expect(svc.getAll().length).toBe(5)
expect(svc.getAll().length).toBe(6)
})
it('없는 ID 삭제 시 false를 반환한다', () => {
@ -184,7 +184,7 @@ describe('CustomInstructionService', () => {
const all = svc.getAll()
const translate = all.find((i) => i.id === 'builtin-translate')
expect(translate!.prompt).toContain('{{targetLanguage}}') // 원래 프롬프트
expect(all.length).toBe(6) // 프리셋 5 + 사용자 1
expect(all.length).toBe(7) // 프리셋 6 + 사용자 1
})
})
})

View file

@ -102,4 +102,22 @@ describe('포커스 깜빡임', () => {
const context = await capture(snapshot({ appName: 'notepad.exe', text: '원래 있던 글' }))
expect(context?.editedSinceFocus).toBe(false)
})
it('검색창 등을 클릭한 직후 첫 스냅샷이 찍히기 전에 글자 키(ㅔㅊ 등)를 쳤다면 첫 스냅샷부터 editedSinceFocus 가 true 이다', async () => {
const internal = service as unknown as Internal & {
_handleMouseDown(event: { x: number; y: number; button: number }): void
_handleKeyDown(event: {
keycode: number
ctrlKey?: boolean
altKey?: boolean
shiftKey?: boolean
metaKey?: boolean
}): void
}
internal._handleMouseDown({ x: 100, y: 100, button: 1 })
internal._handleKeyDown({ keycode: 25 })
const context = await capture(snapshot({ appName: 'SearchHost.exe', controlName: '검색 상자', text: 'ㅔㅊ' }))
expect(context?.editedSinceFocus).toBe(true)
expect(context?.typedRecently).toBe(true)
})
})