Next-sentence suggestions now arrive one at a time up to twelve, shown three per page with Ctrl+Alt+Up/Down to move, Left/Right to page, Enter to accept and Esc to close; old default bindings migrate and the panel guide follows the live bindings. The overlay is redesigned, stays put while candidates stream and sits outside the input box when no caret is reported. The personal phrase memory stops learning from terminals, code editors and the coding-agent hub, ignores symbol-heavy lines and empty-field placeholders, and prunes existing entries that break those rules. Fixes suggestion keys starting dictation, installs stuck on a pre-1.5.0 speech engine without the focus endpoint, Ollama runner windows flashing while typing, the speech engine starting twice, and cold-model timeouts. Live captions can be dragged to a remembered position and show a waiting notice until the first line arrives. Bumps the product version to 1.6.0 (Android/iOS build 1060000).
41 lines
1.9 KiB
TypeScript
41 lines
1.9 KiB
TypeScript
// tests/main/suggestion-overlay-policy.test.ts
|
|
// bootstrap.ts 의 suggestion.on('updated') 배선이 쓰는 표시 전략 순수 함수 테스트.
|
|
// 스트리밍 중 매 청크마다 show(=setBounds+present) 를 다시 부르면 X 클릭이 가로채이고
|
|
// 패널이 튀던 문제(실측)를 막는 결정을 검증한다.
|
|
|
|
import { describe, it, expect } from 'vitest'
|
|
import { decideSuggestionOverlayAction, shouldDismissOnEscape } from '../../src/main/suggestion-overlay-policy'
|
|
|
|
describe('decideSuggestionOverlayAction', () => {
|
|
it('보여줄 것이 없으면 오버레이가 떠 있든 아니든 hide', () => {
|
|
expect(decideSuggestionOverlayAction(false, false)).toBe('hide')
|
|
expect(decideSuggestionOverlayAction(true, false)).toBe('hide')
|
|
})
|
|
|
|
it('아직 떠 있지 않으면 show (위치를 새로 계산)', () => {
|
|
expect(decideSuggestionOverlayAction(false, true)).toBe('show')
|
|
})
|
|
|
|
it('이미 떠 있으면 update (재배치/재present 없이 내용만)', () => {
|
|
expect(decideSuggestionOverlayAction(true, true)).toBe('update')
|
|
})
|
|
})
|
|
|
|
const NO_MODS = { ctrl: false, alt: false, shift: false, meta: false }
|
|
|
|
describe('shouldDismissOnEscape', () => {
|
|
it('아무것도 안 떠 있으면 평범한 Esc 도 아무 일도 하지 않는다', () => {
|
|
expect(shouldDismissOnEscape(false, NO_MODS)).toBe(false)
|
|
})
|
|
|
|
it('떠 있고 수정자가 없으면 닫는다', () => {
|
|
expect(shouldDismissOnEscape(true, NO_MODS)).toBe(true)
|
|
})
|
|
|
|
it('떠 있어도 수정자가 있으면(Ctrl+Esc 등) 반응하지 않는다', () => {
|
|
expect(shouldDismissOnEscape(true, { ...NO_MODS, ctrl: true })).toBe(false)
|
|
expect(shouldDismissOnEscape(true, { ...NO_MODS, alt: true })).toBe(false)
|
|
expect(shouldDismissOnEscape(true, { ...NO_MODS, shift: true })).toBe(false)
|
|
expect(shouldDismissOnEscape(true, { ...NO_MODS, meta: true })).toBe(false)
|
|
})
|
|
})
|