From 3ba52771e988e15f3a11d6848f49f78b2c0f4dd3 Mon Sep 17 00:00:00 2001 From: dghong Date: Thu, 28 May 2026 18:56:52 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix(meta-agent):=20endpoint=20onChange=20?= =?UTF-8?q?=EC=9E=90=EB=8F=99=20detect=20=EC=A0=9C=EA=B1=B0=20(=EC=99=B8?= =?UTF-8?q?=EB=B6=80=20=EB=B3=B4=EA=B3=A0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 외부 사용자 보고: LM Studio Endpoint 필드에서 `192.168.1.1` 입력 중 `.` (period) 칠 때마다 600 ms 디바운스 후 자동 detect 가 발동하여 부분 입력 상태에서 의도치 않은 검색이 반복되었다. onChange 는 local state 만 갱신하도록 변경하고, debounce 기반 자동 detect 트리거를 제거. 실제 detect 는 후속 commit 에서 Enter 키 + 새로고침 버튼 같은 명시 액션으로만 트리거되도록 한다. 사용처 0 이 된 `debounceRef` 와 `useRef` import 도 함께 정리. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/components/tunaflow/MetaAgentSelector.tsx | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/components/tunaflow/MetaAgentSelector.tsx b/src/components/tunaflow/MetaAgentSelector.tsx index 607222f..0c24fb5 100644 --- a/src/components/tunaflow/MetaAgentSelector.tsx +++ b/src/components/tunaflow/MetaAgentSelector.tsx @@ -1,4 +1,4 @@ -import { useEffect, useMemo, useRef, useState } from "react"; +import { useEffect, useMemo, useState } from "react"; import { invoke } from "@tauri-apps/api/core"; import { CheckCircle2, Loader2, AlertTriangle, ChevronDown, ExternalLink } from "lucide-react"; import { useTranslation } from "react-i18next"; @@ -65,7 +65,6 @@ export function MetaAgentSelector({ onProceed, onSkip, projectName }: Props) { const [modelByEngine, setModelByEngine] = useState>({}); const [skipConfirm, setSkipConfirm] = useState(false); - const debounceRef = useRef(null); // Dynamic model discovery — shared with Settings AgentsSection. // `engineModels` is populated by `list_engine_models` (Rust) and refreshed @@ -132,16 +131,12 @@ export function MetaAgentSelector({ onProceed, onSkip, projectName }: Props) { }); }, [detections, engineModels]); + // 외부 사용자 보고 (e.g. LM Studio endpoint 에 `192.168.1.1` 입력 중 `.` 칠 + // 때마다 자동 detect 가 발동) — onChange 는 local state 만 갱신하고, 실제 + // detect 는 Enter 키 또는 옆 새로고침 버튼 같은 명시 액션으로만 트리거한다. const onEndpointChange = (engine: "ollama" | "lmstudio", value: string) => { if (engine === "ollama") setOllamaEndpoint(value); else setLmstudioEndpoint(value); - - if (debounceRef.current) window.clearTimeout(debounceRef.current); - debounceRef.current = window.setTimeout(() => { - const o = engine === "ollama" ? value : ollamaEndpoint; - const l = engine === "lmstudio" ? value : lmstudioEndpoint; - runDetect(o, l); - }, 600); }; const canProceed = useMemo(() => { From 9a52d10f3d9c0965762a1091a4b1e30006cb6a4a Mon Sep 17 00:00:00 2001 From: dghong Date: Thu, 28 May 2026 18:58:28 +0900 Subject: [PATCH 2/2] =?UTF-8?q?feat(meta-agent):=20Enter=20/=20refresh=20b?= =?UTF-8?q?utton=20=EC=9C=BC=EB=A1=9C=20=EB=AA=85=EC=8B=9C=20detect=20?= =?UTF-8?q?=ED=8A=B8=EB=A6=AC=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit T1 에서 onChange 자동 detect 가 제거된 뒤, 사용자가 endpoint 입력을 끝낸 시점을 표시할 수 있는 명시 액션 두 가지를 추가한다. - 입력 필드 `onKeyDown` 에서 Enter 키 입력 시 `runDetect()` 호출 (e.preventDefault 로 form submit 동작과 분리). - 옆 새로고침 버튼(RefreshCw) 클릭으로도 동일하게 `runDetect()`. - ollama / lmstudio 양쪽 HTTP endpoint 행에 동일 패턴 적용. i18n: `dialog.meta_agent.endpoint_refresh` 키 추가 (ko/en). 버튼은 title + aria-label 양쪽에 같은 문구를 노출하여 hover / 스크린리더 모두에서 의도를 알 수 있도록 했다. 회귀 가드: - Rust 변경 0 (src-tauri/ 비변경) - MetaAgentSelector 외 컴포넌트 변경 0 - runDetect 호출 4 곳 — 정의 / mount useEffect / onKeyDown / button onClick. onChange 영역 0 (T1 그대로 유지). Co-Authored-By: Claude Opus 4.7 (1M context) --- src/components/tunaflow/MetaAgentSelector.tsx | 22 +++++++++++++++++-- src/locales/en/dialog.json | 3 ++- src/locales/ko/dialog.json | 3 ++- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/components/tunaflow/MetaAgentSelector.tsx b/src/components/tunaflow/MetaAgentSelector.tsx index 0c24fb5..8591297 100644 --- a/src/components/tunaflow/MetaAgentSelector.tsx +++ b/src/components/tunaflow/MetaAgentSelector.tsx @@ -1,6 +1,6 @@ import { useEffect, useMemo, useState } from "react"; import { invoke } from "@tauri-apps/api/core"; -import { CheckCircle2, Loader2, AlertTriangle, ChevronDown, ExternalLink } from "lucide-react"; +import { CheckCircle2, Loader2, AlertTriangle, ChevronDown, ExternalLink, RefreshCw } from "lucide-react"; import { useTranslation } from "react-i18next"; import { cn } from "@/lib/utils"; import { useChatStore } from "@/stores/chatStore"; @@ -242,7 +242,8 @@ export function MetaAgentSelector({ onProceed, onSkip, projectName }: Props) {
{d.path}
)} - {/* HTTP endpoint editor */} + {/* HTTP endpoint editor — Enter 키 또는 새로고침 버튼으로만 + detect 트리거. onChange 는 local state 갱신만 한다. */} {d.kind === "http" && (
Endpoint @@ -250,8 +251,25 @@ export function MetaAgentSelector({ onProceed, onSkip, projectName }: Props) { type="text" value={d.engine === "ollama" ? ollamaEndpoint : lmstudioEndpoint} onChange={(e) => onEndpointChange(d.engine as "ollama" | "lmstudio", e.target.value)} + onKeyDown={(e) => { + if (e.key === "Enter") { + e.preventDefault(); + runDetect(ollamaEndpoint, lmstudioEndpoint); + } + }} className="flex-1 text-[10px] font-mono bg-background border border-border/60 rounded px-2 py-1 focus:outline-none focus:border-primary/60" + data-testid={`meta-agent-endpoint-${d.engine}`} /> +
)} diff --git a/src/locales/en/dialog.json b/src/locales/en/dialog.json index bbe2818..7c01ef3 100644 --- a/src/locales/en/dialog.json +++ b/src/locales/en/dialog.json @@ -100,7 +100,8 @@ "ollama_install_hint": "Install from https://ollama.com/download then run `ollama serve`", "lmstudio_install_hint": "Install from https://lmstudio.ai then start the Local Server", "model_loading": "Loading models...", - "model_empty": "No models — install or refresh via Settings → Runtime" + "model_empty": "No models — install or refresh via Settings → Runtime", + "endpoint_refresh": "Re-detect endpoint (Enter or click)" }, "meta_chat": { "new_notification_title": "New notification", diff --git a/src/locales/ko/dialog.json b/src/locales/ko/dialog.json index a24b84a..710ab54 100644 --- a/src/locales/ko/dialog.json +++ b/src/locales/ko/dialog.json @@ -100,7 +100,8 @@ "ollama_install_hint": "https://ollama.com/download 에서 설치 후 `ollama serve`", "lmstudio_install_hint": "https://lmstudio.ai 에서 설치 후 Local Server 시작", "model_loading": "모델 목록 로딩 중...", - "model_empty": "모델 없음 — 설치 또는 Settings → Runtime 에서 새로고침" + "model_empty": "모델 없음 — 설치 또는 Settings → Runtime 에서 새로고침", + "endpoint_refresh": "엔드포인트 다시 감지 (Enter 또는 클릭)" }, "meta_chat": { "new_notification_title": "새 알림",