fix(gui_2,app_controller): two regressions blocking uv run sloppy.py
1. gui_2.py:_gui_func — ws was only assigned inside 'if bg_shader_enabled' (default False), but used unconditionally on the next line. When the shader feature was off, theme.render_post_fx(ws.x, ws.y, ...) raised UnboundLocalError, which immapp.run caught and degraded the app. This is what was blocking the GUI from appearing. Fix: hoist 'ws = imgui.get_io().display_size' above the conditional so it's always assigned. The 'if bg_shader_enabled' branch now uses the already-assigned ws. 2. app_controller.py:_push_mma_state_update_result — production code did 'Ticket(id=t.id, ...)' on each element of self.active_tickets, but the test sets self.active_tickets to a list of dicts (mock data). Production callers go through _load_active_tickets which converts, but mock callers bypass. Added 'Ticket.from_dict(t) if isinstance(t, dict) else t' normalization at the entry point (same pattern as line 3295). After these fixes: - live_gui_health_endpoint returns healthy=True - test_push_mma_state_update passes - test_api_hooks_gui_health_live passes
This commit is contained in:
@@ -5088,6 +5088,13 @@ class AppController:
|
||||
from src import project_manager
|
||||
track = self.active_track
|
||||
if track is None: return OK
|
||||
# Normalize dict inputs to Ticket dataclass (test callers may set
|
||||
# self.active_tickets to a list of dicts; production callers normalize
|
||||
# at _load_active_tickets time).
|
||||
normalized = [
|
||||
t if isinstance(t, Ticket) else Ticket.from_dict(t)
|
||||
for t in self.active_tickets
|
||||
]
|
||||
new_tickets = [
|
||||
Ticket(
|
||||
id=t.id,
|
||||
@@ -5096,7 +5103,7 @@ class AppController:
|
||||
assigned_to=t.assigned_to,
|
||||
depends_on=list(t.depends_on),
|
||||
)
|
||||
for t in self.active_tickets
|
||||
for t in normalized
|
||||
]
|
||||
track.tickets = new_tickets
|
||||
state = TrackState(metadata=track, tasks=list(new_tickets))
|
||||
|
||||
+3
-2
@@ -1092,10 +1092,11 @@ class App:
|
||||
render_shader_live_editor(self)
|
||||
render_history_window(self)
|
||||
pushed_prior_tint = False
|
||||
|
||||
|
||||
ws = imgui.get_io().display_size
|
||||
|
||||
# Render background shader
|
||||
if getattr(self, 'bg_shader_enabled', False):
|
||||
ws = imgui.get_io().display_size
|
||||
get_bg().render(ws.x, ws.y)
|
||||
|
||||
theme.render_post_fx(ws.x, ws.y, self.ai_status, self.ui_crt_filter)
|
||||
|
||||
Reference in New Issue
Block a user