fix(gui): Skip empty strings in selectable to prevent ImGui ID assertion
Empty strings in bias_profiles.keys() and personas.keys() caused imgui.selectable() to fail with 'Cannot have an empty ID at root of window' assertion error. Added guards to skip empty names.
This commit is contained in:
@@ -2652,6 +2652,8 @@ def hello():
|
||||
if imgui.selectable("None", not self.ui_active_persona)[0]:
|
||||
self.ui_active_persona = ""
|
||||
for pname in sorted(personas.keys()):
|
||||
if not pname:
|
||||
continue
|
||||
if imgui.selectable(pname, pname == self.ui_active_persona)[0]:
|
||||
self.ui_active_persona = pname
|
||||
if pname in personas:
|
||||
@@ -4219,6 +4221,8 @@ def hello():
|
||||
from src import ai_client
|
||||
ai_client.set_bias_profile(None)
|
||||
for bname in sorted(self.controller.bias_profiles.keys()):
|
||||
if not bname:
|
||||
continue
|
||||
if imgui.selectable(bname, bname == getattr(self, 'ui_active_bias_profile', ""))[0]:
|
||||
self.ui_active_bias_profile = bname
|
||||
from src import ai_client
|
||||
|
||||
Reference in New Issue
Block a user