Skip to content

Commit ca782c3

Browse files
committed
enhance UI a bit
1 parent d3433c2 commit ca782c3

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

AgentCrew/modules/chat/message/handler.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,8 @@ async def get_assistant_response(
348348

349349
return assistant_response, input_tokens, output_tokens
350350

351+
except GeneratorExit as e:
352+
return assistant_response, input_tokens, output_tokens
351353
except Exception as e:
352354
if self.current_user_input:
353355
self.conversation_manager.store_conversation_turn(

AgentCrew/modules/gui/components/input_components.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
QPushButton,
88
QCompleter,
99
QFileDialog,
10+
QSizePolicy,
1011
)
1112
from PySide6.QtCore import Qt, QStringListModel
1213
from PySide6.QtGui import QTextCursor
@@ -41,6 +42,9 @@ def _setup_input_area(self):
4142
self.chat_window.message_input.setStyleSheet(
4243
self.chat_window.style_provider.get_input_style()
4344
)
45+
self.chat_window.message_input.setSizePolicy(
46+
QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Expanding
47+
)
4448

4549
# Create buttons layout
4650
buttons_layout = QVBoxLayout()

AgentCrew/modules/gui/components/ui_state_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def _set_send_button_state(self, is_stop_stated: bool = False):
8181
self.chat_window.send_button.setStyleSheet(
8282
self.chat_window.style_provider.get_button_style("stop")
8383
)
84-
self.animation_timer.setInterval(150) # Update every 150ms for spinner
84+
self.animation_timer.setInterval(80) # Update every 150ms for spinner
8585
self.animation_timer.start()
8686

8787
# Change the button to stop functionality

AgentCrew/modules/gui/widgets/message_bubble.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def __init__(
140140
self.set_text(text)
141141

142142
# self.message_label.setSizePolicy(
143-
# QSizePolicy.Policy.Maximum, QSizePolicy.Policy.Minimum
143+
# QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum
144144
# )
145145

146146
if text is not None:
@@ -314,7 +314,7 @@ def add_streaming_chunk(self, chunk_queue: list):
314314

315315
# Start the streaming timer if not active
316316
if not self.streaming_timer.isActive():
317-
self.streaming_timer.start(24)
317+
self.streaming_timer.start(40)
318318

319319
# Add characters to queue for smooth rendering
320320
self.character_queue = chunk_queue
@@ -328,11 +328,11 @@ def _render_next_character(self):
328328

329329
# Adaptive rendering speed based on queue size
330330
if len(self.character_queue) > 100:
331-
chars_per_frame = 21 # Speed up for large queues
331+
chars_per_frame = 40 # Speed up for large queues
332332
elif len(self.character_queue) > 50:
333-
chars_per_frame = 15
333+
chars_per_frame = 30
334334
else:
335-
chars_per_frame = 10 # Slower for natural effect
335+
chars_per_frame = 20 # Slower for natural effect
336336

337337
# Render characters for this frame
338338
new_chars = ""

0 commit comments

Comments
 (0)