From 635e516616e79e69696999c7db3b0b4b36f99471 Mon Sep 17 00:00:00 2001 From: sepehr Date: Sun, 3 May 2026 01:42:22 +0200 Subject: [PATCH] fix(ai): live update for translation language input + preset sync --- .../components/contextual-ai-chat.tsx | 6 +-- memento-note/scripts/fix-translation-ui.js | 51 +++++++++++++++++++ 2 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 memento-note/scripts/fix-translation-ui.js diff --git a/memento-note/components/contextual-ai-chat.tsx b/memento-note/components/contextual-ai-chat.tsx index 580609f..44dcf1f 100644 --- a/memento-note/components/contextual-ai-chat.tsx +++ b/memento-note/components/contextual-ai-chat.tsx @@ -841,7 +841,7 @@ export function ContextualAIChat({ ))} @@ -849,8 +849,8 @@ export function ContextualAIChat({ className="text-xs px-3 py-1.5 rounded-lg border border-border bg-card outline-none focus:border-primary w-full" placeholder={t('ai.action.customLang') || 'Autre langue...'} value={customLangInput} - onChange={e => setCustomLangInput(e.target.value)} - onKeyDown={e => { if (e.key === 'Enter' && customLangInput.trim()) { setTranslateTarget(customLangInput.trim()); setCustomLangInput('') } }} + onChange={e => { const val = e.target.value; setCustomLangInput(val); setTranslateTarget(val); }} + onKeyDown={e => { if (e.key === 'Enter' && translateTarget.trim()) { handleAction(action, translateTarget.trim()); } }} />