Private
Public Access
0
0

fix(gui_2): coerce None → "" for input_text value in render_context_presets

sloppy.py crashed in render_context_presets at line 3469 with
TypeError: input_text(): incompatible function arguments.
The second arg getattr(app, "ui_new_context_preset_name", "")
returned None because the attribute EXISTS but is None — the
default "" only fires for missing attributes.

The App's __setattr__ delegates to the AppController when the
controller has the attribute. The controller's init can leave
ui_new_context_preset_name as None (via setattr from a plugin
or a config flush). The defensive getattr doesn't help in that
case.

Fix: append `or ""` to coerce None and empty-string to "" so
imgui.input_text always gets a valid str.

Verified by the previously-failing batched tests (test_command_palette_sim, test_auto_switch_sim, test_live_warmup_canaries_endpoint, test_conductor_api_hook_integration): all 12 now pass.
This commit is contained in:
2026-06-07 17:12:31 -04:00
parent 8130ae34d4
commit e7bfb94c05
+1 -1
View File
@@ -3466,7 +3466,7 @@ def render_context_presets(app: App) -> None:
imgui.table_next_row()
imgui.table_next_column()
imgui.set_next_item_width(-1)
changed, new_name = imgui.input_text("##new_preset", getattr(app, "ui_new_context_preset_name", ""))
changed, new_name = imgui.input_text("##new_preset", getattr(app, "ui_new_context_preset_name", "") or "")
if changed: app.ui_new_context_preset_name = new_name
imgui.table_next_column()