From 3f2b8e2a1f0d637788a0bed89bd9ea634c8689f3 Mon Sep 17 00:00:00 2001 From: Jack Kingsman Date: Sun, 5 Apr 2026 11:55:52 -0700 Subject: [PATCH] Refocus CLI textbox after command completion. Closes #164. --- .../src/components/repeater/RepeaterConsolePane.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/frontend/src/components/repeater/RepeaterConsolePane.tsx b/frontend/src/components/repeater/RepeaterConsolePane.tsx index 183499d..027a69e 100644 --- a/frontend/src/components/repeater/RepeaterConsolePane.tsx +++ b/frontend/src/components/repeater/RepeaterConsolePane.tsx @@ -13,6 +13,8 @@ export function ConsolePane({ }) { const [input, setInput] = useState(''); const outputRef = useRef(null); + const inputRef = useRef(null); + const prevLoadingRef = useRef(loading); // Auto-scroll to bottom on new entries useEffect(() => { @@ -21,6 +23,14 @@ export function ConsolePane({ } }, [history]); + // Refocus input after command completes + useEffect(() => { + if (prevLoadingRef.current && !loading) { + inputRef.current?.focus(); + } + prevLoadingRef.current = loading; + }, [loading]); + const handleSubmit = useCallback( async (e: FormEvent) => { e.preventDefault(); @@ -59,6 +69,7 @@ export function ConsolePane({