make sure you can't send another rquest prompt when one is still being processed

This commit is contained in:
2026-03-12 21:04:14 -04:00
parent 123bcdcb58
commit cf5ee6c0f1

View File

@@ -2589,17 +2589,23 @@ def hello():
ch, self.ui_ai_input = imgui.input_text_multiline("##ai_in", self.ui_ai_input, imgui.ImVec2(-1, -40))
# Keyboard shortcuts
io = imgui.get_io()
ctrl_enter = io.key_ctrl and imgui.is_key_pressed(imgui.Key.enter)
ctrl_l = io.key_ctrl and imgui.is_key_pressed(imgui.Key.l)
if ctrl_l:
self.ui_ai_input = ""
imgui.separator()
is_busy = self.ai_status in ['sending...', 'streaming...']
send_busy = False
with self._send_thread_lock:
if self.send_thread and self.send_thread.is_alive():
send_busy = True
if (imgui.button("Gen + Send") or ctrl_enter) and not send_busy:
if is_busy: send_busy = True
imgui.begin_disabled(send_busy)
ctrl_enter = io.key_ctrl and imgui.is_key_pressed(imgui.Key.enter)
label = "Gen + Send (Busy)" if send_busy else "Gen + Send"
if (imgui.button(label) or ctrl_enter) and not send_busy:
self._handle_generate_send()
imgui.end_disabled()
imgui.same_line()
if imgui.button("MD Only"):
self._handle_md_only()