fix(commands): decide whether a deleted command was in use when the delete commits, not when it was clicked

Picking another command during the undo window was overwritten with 'raw'
five seconds later because the selection was captured at click time.
This commit is contained in:
Yun Chan 2026-10-20 22:49:11 +09:00
parent ce8d603b4a
commit b961dfd999
3 changed files with 28 additions and 3 deletions

View file

@ -55,6 +55,17 @@ export function commandSelection<T extends InstructionLike>(pipeline: CommandPip
return ''
}
/**
* 지운 명령이 지금도 받아쓰기에 쓰이는가 — 삭제 확정(되돌리기 알림이 닫힐 때) 시점의 설정으로 판단한다.
* 삭제를 누른 순간 값으로 판단하면, 그사이 사용자가 고른 다른 명령을 '원문 그대로'로 덮었다.
*/
export function isInstructionInUse(
config: { defaultLLMAction?: unknown; activeInstructionId?: unknown } | null | undefined,
instructionId: string,
): boolean {
return config?.defaultLLMAction === 'custom' && config.activeInstructionId === instructionId
}
/** 일반 후처리 액션 이름 */
export function llmActionLabelKey(action: Exclude<LLMAction, 'custom'>): TranslationKey {
switch (action) {