feat(personas): Add Persona selector to AI Settings panel and PersonaManager init
This commit is contained in:
@@ -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_presets = self.tool_preset_manager.load_all_presets()
|
||||
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_bias_profile = ai_cfg.get("active_bias_profile")
|
||||
ai_client.set_tool_preset(self.ui_active_tool_preset)
|
||||
|
||||
12
src/gui_2.py
12
src/gui_2.py
@@ -1978,6 +1978,18 @@ def hello():
|
||||
self.ui_active_bias_profile = bname
|
||||
ai_client.set_bias_profile(bname)
|
||||
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":
|
||||
imgui.separator()
|
||||
imgui.text("Gemini CLI")
|
||||
|
||||
Reference in New Issue
Block a user