fix(gui): fix tool presets and biases panel and cache analytics section layout
This commit is contained in:
20
src/gui_2.py
20
src/gui_2.py
@@ -2483,9 +2483,7 @@ def hello():
|
|||||||
if self.current_provider != "gemini":
|
if self.current_provider != "gemini":
|
||||||
if self.perf_profiling_enabled: self.perf_monitor.end_component("_render_cache_panel")
|
if self.perf_profiling_enabled: self.perf_monitor.end_component("_render_cache_panel")
|
||||||
return
|
return
|
||||||
if not imgui.collapsing_header("Cache Analytics"):
|
imgui.text_colored(C_LBL, 'Cache Analytics')
|
||||||
if self.perf_profiling_enabled: self.perf_monitor.end_component("_render_cache_panel")
|
|
||||||
return
|
|
||||||
stats = getattr(self.controller, '_cached_cache_stats', {})
|
stats = getattr(self.controller, '_cached_cache_stats', {})
|
||||||
if not stats.get("cache_exists"):
|
if not stats.get("cache_exists"):
|
||||||
imgui.text_disabled("No active cache")
|
imgui.text_disabled("No active cache")
|
||||||
@@ -3667,7 +3665,6 @@ def hello():
|
|||||||
presets = self.controller.tool_presets
|
presets = self.controller.tool_presets
|
||||||
preset_names = [""] + sorted(list(presets.keys()))
|
preset_names = [""] + sorted(list(presets.keys()))
|
||||||
|
|
||||||
# Gracefully handle None or missing preset
|
|
||||||
active = getattr(self, "ui_active_tool_preset", "")
|
active = getattr(self, "ui_active_tool_preset", "")
|
||||||
if active is None: active = ""
|
if active is None: active = ""
|
||||||
try:
|
try:
|
||||||
@@ -3685,6 +3682,20 @@ def hello():
|
|||||||
if imgui.is_item_hovered():
|
if imgui.is_item_hovered():
|
||||||
imgui.set_tooltip("Configure tool availability and default modes.")
|
imgui.set_tooltip("Configure tool availability and default modes.")
|
||||||
|
|
||||||
|
imgui.dummy(imgui.ImVec2(0, 4))
|
||||||
|
imgui.text("Bias Profile")
|
||||||
|
if imgui.begin_combo("##bias", getattr(self, 'ui_active_bias_profile', "") or "None"):
|
||||||
|
if imgui.selectable("None", not getattr(self, 'ui_active_bias_profile', ""))[0]:
|
||||||
|
self.ui_active_bias_profile = ""
|
||||||
|
from src import ai_client
|
||||||
|
ai_client.set_bias_profile(None)
|
||||||
|
for bname in sorted(self.controller.bias_profiles.keys()):
|
||||||
|
if imgui.selectable(bname, bname == getattr(self, 'ui_active_bias_profile', ""))[0]:
|
||||||
|
self.ui_active_bias_profile = bname
|
||||||
|
from src import ai_client
|
||||||
|
ai_client.set_bias_profile(bname)
|
||||||
|
imgui.end_combo()
|
||||||
|
|
||||||
imgui.dummy(imgui.ImVec2(0, 8))
|
imgui.dummy(imgui.ImVec2(0, 8))
|
||||||
active_name = self.ui_active_tool_preset
|
active_name = self.ui_active_tool_preset
|
||||||
if active_name and active_name in presets:
|
if active_name and active_name in presets:
|
||||||
@@ -3715,7 +3726,6 @@ def hello():
|
|||||||
if imgui.radio_button(f"Ask##{cat_name}_{tool.name}", mode == "ask"):
|
if imgui.radio_button(f"Ask##{cat_name}_{tool.name}", mode == "ask"):
|
||||||
tool.approval = "ask"
|
tool.approval = "ask"
|
||||||
imgui.tree_pop()
|
imgui.tree_pop()
|
||||||
|
|
||||||
def _render_theme_panel(self) -> None:
|
def _render_theme_panel(self) -> None:
|
||||||
if self.perf_profiling_enabled: self.perf_monitor.start_component("_render_theme_panel")
|
if self.perf_profiling_enabled: self.perf_monitor.start_component("_render_theme_panel")
|
||||||
exp, opened = imgui.begin("Theme", self.show_windows["Theme"])
|
exp, opened = imgui.begin("Theme", self.show_windows["Theme"])
|
||||||
|
|||||||
Reference in New Issue
Block a user