feat(personas): Add Persona selector to AI Settings panel and PersonaManager init

This commit is contained in:
2026-03-10 11:15:33 -04:00
parent 7ae99f2bc3
commit 523cf31f76
2 changed files with 17 additions and 0 deletions

View File

@@ -859,6 +859,11 @@ class AppController:
self.tool_preset_manager = tool_presets.ToolPresetManager(Path(self.active_project_path).parent if self.active_project_path else None) self.tool_preset_manager = tool_presets.ToolPresetManager(Path(self.active_project_path).parent if self.active_project_path else None)
self.tool_presets = self.tool_preset_manager.load_all_presets() self.tool_presets = self.tool_preset_manager.load_all_presets()
self.bias_profiles = self.tool_preset_manager.load_all_bias_profiles() self.bias_profiles = self.tool_preset_manager.load_all_bias_profiles()
from src.personas import PersonaManager
self.persona_manager = PersonaManager(Path(self.active_project_path).parent if self.active_project_path else None)
self.personas = self.persona_manager.load_all()
self.ui_active_tool_preset = os.environ.get('SLOP_TOOL_PRESET') or ai_cfg.get("active_tool_preset") self.ui_active_tool_preset = os.environ.get('SLOP_TOOL_PRESET') or ai_cfg.get("active_tool_preset")
self.ui_active_bias_profile = ai_cfg.get("active_bias_profile") self.ui_active_bias_profile = ai_cfg.get("active_bias_profile")
ai_client.set_tool_preset(self.ui_active_tool_preset) ai_client.set_tool_preset(self.ui_active_tool_preset)

View File

@@ -1978,6 +1978,18 @@ def hello():
self.ui_active_bias_profile = bname self.ui_active_bias_profile = bname
ai_client.set_bias_profile(bname) ai_client.set_bias_profile(bname)
imgui.end_combo() imgui.end_combo()
imgui.text("Persona")
if not hasattr(self, 'ui_active_persona'):
self.ui_active_persona = ""
if imgui.begin_combo("##persona", self.ui_active_persona or "None"):
if imgui.selectable("None", not self.ui_active_persona)[0]:
self.ui_active_persona = ""
for pname in sorted(getattr(self.controller, 'personas', {}).keys()):
if imgui.selectable(pname, pname == self.ui_active_persona)[0]:
self.ui_active_persona = pname
imgui.end_combo()
if self.current_provider == "gemini_cli": if self.current_provider == "gemini_cli":
imgui.separator() imgui.separator()
imgui.text("Gemini CLI") imgui.text("Gemini CLI")