feat(ui): Add blinking indicators and increase diagnostic density

This commit is contained in:
2026-02-23 18:47:14 -05:00
parent 975fcde9bd
commit c5d54cfae2
2 changed files with 95 additions and 21 deletions

63
gui.py
View File

@@ -1052,6 +1052,14 @@ class App:
self.ai_status = status
if dpg.does_item_exist("ai_status"):
dpg.set_value("ai_status", f"Status: {status}")
if dpg.does_item_exist("thinking_indicator"):
is_thinking = status in ["sending...", "running powershell..."]
dpg.configure_item("thinking_indicator", show=is_thinking)
if dpg.does_item_exist("operations_live_indicator"):
is_running = status in ["running powershell...", "fetching url...", "searching web..."]
dpg.configure_item("operations_live_indicator", show=is_running)
def _update_response(self, text: str):
self.ai_response = text
@@ -2001,7 +2009,11 @@ class App:
pass
# Message Composer in Middle
dpg.add_text("Message", color=_SUBHDR_COLOR)
with dpg.group(horizontal=True):
dpg.add_text("Message", color=_SUBHDR_COLOR)
dpg.add_spacer(width=20)
dpg.add_text("THINKING...", tag="thinking_indicator", color=(255, 100, 100), show=False)
dpg.add_input_text(
tag="ai_input",
multiline=True,
@@ -2040,6 +2052,11 @@ class App:
no_close=False,
no_collapse=True,
):
with dpg.group(horizontal=True):
dpg.add_text("OPERATIONS", color=_SUBHDR_COLOR)
dpg.add_spacer(width=20)
dpg.add_text("LIVE", tag="operations_live_indicator", color=(100, 255, 100), show=False)
with dpg.tab_bar():
with dpg.tab(label="Comms Log"):
with dpg.group(horizontal=True):
@@ -2061,26 +2078,29 @@ class App:
with dpg.tab(label="Diagnostics"):
dpg.add_text("Performance Telemetry")
with dpg.group(horizontal=True):
dpg.add_text("FPS:")
dpg.add_text("0.0", tag="perf_fps_text", color=(180, 255, 180))
dpg.add_spacer(width=20)
dpg.add_text("Frame:")
dpg.add_text("0.0ms", tag="perf_frame_text", color=(100, 200, 255))
with dpg.table(header_row=False, borders_innerH=True, borders_outerH=True, borders_innerV=True, borders_outerV=True):
dpg.add_table_column()
dpg.add_table_column()
dpg.add_table_column()
dpg.add_table_column()
with dpg.table_row():
dpg.add_text("FPS", color=_LABEL_COLOR)
dpg.add_text("0.0", tag="perf_fps_text", color=(180, 255, 180))
dpg.add_text("Frame", color=_LABEL_COLOR)
dpg.add_text("0.0ms", tag="perf_frame_text", color=(100, 200, 255))
with dpg.table_row():
dpg.add_text("CPU", color=_LABEL_COLOR)
dpg.add_text("0.0%", tag="perf_cpu_text", color=(255, 220, 100))
dpg.add_text("Lag", color=_LABEL_COLOR)
dpg.add_text("0.0ms", tag="perf_lag_text", color=(255, 180, 80))
dpg.add_spacer(height=4)
dpg.add_plot(label="Frame Time (ms)", tag="plot_frame", height=120, width=-1, no_mouse_pos=True)
dpg.add_plot_axis(dpg.mvXAxis, label="samples", no_tick_labels=True, parent="plot_frame")
with dpg.plot_axis(dpg.mvYAxis, label="ms", tag="axis_frame_y", parent="plot_frame"):
dpg.add_line_series(list(range(100)), self.perf_history["frame_time"], label="frame time", tag="perf_frame_plot")
dpg.set_axis_limits("axis_frame_y", 0, 50)
with dpg.group(horizontal=True):
dpg.add_text("CPU:")
dpg.add_text("0.0%", tag="perf_cpu_text", color=(255, 220, 100))
dpg.add_spacer(width=20)
dpg.add_text("Input Lag:")
dpg.add_text("0.0ms", tag="perf_lag_text", color=(255, 180, 80))
dpg.add_plot(label="CPU Usage (%)", tag="plot_cpu", height=120, width=-1, no_mouse_pos=True)
dpg.add_plot_axis(dpg.mvXAxis, label="samples", no_tick_labels=True, parent="plot_cpu")
with dpg.plot_axis(dpg.mvYAxis, label="%", tag="axis_cpu_y", parent="plot_cpu"):
@@ -2254,8 +2274,21 @@ class App:
self._process_pending_gui_tasks()
self.perf_monitor.end_component("GUI_Tasks")
# Handle retro arcade blinking effect
self.perf_monitor.start_component("Blinking")
# Thinking Indicator Blink (Continuous while shown)
if dpg.does_item_exist("thinking_indicator") and dpg.is_item_shown("thinking_indicator"):
elapsed = time.time()
val = math.sin(elapsed * 10 * math.pi)
alpha = 255 if val > 0 else 0
dpg.configure_item("thinking_indicator", color=(255, 100, 100, alpha))
if dpg.does_item_exist("operations_live_indicator") and dpg.is_item_shown("operations_live_indicator"):
elapsed = time.time()
val = math.sin(elapsed * 10 * math.pi)
alpha = 255 if val > 0 else 0
dpg.configure_item("operations_live_indicator", color=(100, 255, 100, alpha))
if self._trigger_script_blink:
self._trigger_script_blink = False
self._is_script_blinking = True