checkpoint: I have to fix try/finally spam by this ai
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
provider = "minimax"
|
provider = "minimax"
|
||||||
model = "MiniMax-M2.5"
|
model = "MiniMax-M2.5"
|
||||||
temperature = 0.0
|
temperature = 0.0
|
||||||
|
top_p = 1.0
|
||||||
max_tokens = 32000
|
max_tokens = 32000
|
||||||
history_trunc_limit = 900000
|
history_trunc_limit = 900000
|
||||||
active_preset = "Default"
|
active_preset = "Default"
|
||||||
@@ -53,13 +54,13 @@ Response = false
|
|||||||
"Tool Calls" = true
|
"Tool Calls" = true
|
||||||
Theme = true
|
Theme = true
|
||||||
"Log Management" = true
|
"Log Management" = true
|
||||||
Diagnostics = true
|
Diagnostics = false
|
||||||
|
|
||||||
[theme]
|
[theme]
|
||||||
palette = "Nord Dark"
|
palette = "Nord Dark"
|
||||||
font_path = "C:/projects/manual_slop/assets/fonts/Inter-Regular.ttf"
|
font_path = "C:/projects/manual_slop/assets/fonts/Inter-Regular.ttf"
|
||||||
font_size = 14.0
|
font_size = 14.0
|
||||||
scale = 1.2999999523162842
|
scale = 1.0
|
||||||
transparency = 1.0
|
transparency = 1.0
|
||||||
child_transparency = 1.0
|
child_transparency = 1.0
|
||||||
|
|
||||||
|
|||||||
@@ -74,8 +74,8 @@ Collapsed=0
|
|||||||
DockId=0xAFC85805,2
|
DockId=0xAFC85805,2
|
||||||
|
|
||||||
[Window][Theme]
|
[Window][Theme]
|
||||||
Pos=0,1370
|
Pos=0,1786
|
||||||
Size=788,767
|
Size=788,351
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
DockId=0x00000002,2
|
DockId=0x00000002,2
|
||||||
|
|
||||||
@@ -85,14 +85,14 @@ Size=900,700
|
|||||||
Collapsed=0
|
Collapsed=0
|
||||||
|
|
||||||
[Window][Diagnostics]
|
[Window][Diagnostics]
|
||||||
Pos=2641,22
|
Pos=2641,34
|
||||||
Size=1199,2115
|
Size=1199,2103
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
DockId=0x00000010,2
|
DockId=0x00000010,2
|
||||||
|
|
||||||
[Window][Context Hub]
|
[Window][Context Hub]
|
||||||
Pos=0,1370
|
Pos=0,1786
|
||||||
Size=788,767
|
Size=788,351
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
DockId=0x00000002,1
|
DockId=0x00000002,1
|
||||||
|
|
||||||
@@ -103,26 +103,26 @@ Collapsed=0
|
|||||||
DockId=0x0000000D,0
|
DockId=0x0000000D,0
|
||||||
|
|
||||||
[Window][Discussion Hub]
|
[Window][Discussion Hub]
|
||||||
Pos=1668,26
|
Pos=1668,25
|
||||||
Size=971,2111
|
Size=915,2112
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
DockId=0x00000013,0
|
DockId=0x00000013,0
|
||||||
|
|
||||||
[Window][Operations Hub]
|
[Window][Operations Hub]
|
||||||
Pos=790,26
|
Pos=790,25
|
||||||
Size=876,1455
|
Size=876,2112
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
DockId=0x00000005,0
|
DockId=0x00000005,0
|
||||||
|
|
||||||
[Window][Files & Media]
|
[Window][Files & Media]
|
||||||
Pos=0,1370
|
Pos=0,1786
|
||||||
Size=788,767
|
Size=788,351
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
DockId=0x00000002,0
|
DockId=0x00000002,0
|
||||||
|
|
||||||
[Window][AI Settings]
|
[Window][AI Settings]
|
||||||
Pos=0,26
|
Pos=0,25
|
||||||
Size=788,1342
|
Size=788,1759
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
DockId=0x00000001,0
|
DockId=0x00000001,0
|
||||||
|
|
||||||
@@ -132,14 +132,14 @@ Size=416,325
|
|||||||
Collapsed=0
|
Collapsed=0
|
||||||
|
|
||||||
[Window][MMA Dashboard]
|
[Window][MMA Dashboard]
|
||||||
Pos=2641,26
|
Pos=2585,25
|
||||||
Size=1199,1689
|
Size=1255,2112
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
DockId=0x00000010,0
|
DockId=0x00000010,0
|
||||||
|
|
||||||
[Window][Log Management]
|
[Window][Log Management]
|
||||||
Pos=2641,26
|
Pos=2585,25
|
||||||
Size=1199,1689
|
Size=1255,2112
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
DockId=0x00000010,1
|
DockId=0x00000010,1
|
||||||
|
|
||||||
@@ -167,8 +167,8 @@ Collapsed=0
|
|||||||
DockId=0x00000004,0
|
DockId=0x00000004,0
|
||||||
|
|
||||||
[Window][Tier 3: Workers]
|
[Window][Tier 3: Workers]
|
||||||
Pos=2641,1717
|
Pos=2641,1719
|
||||||
Size=916,420
|
Size=916,418
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
DockId=0x0000000C,0
|
DockId=0x0000000C,0
|
||||||
|
|
||||||
@@ -323,8 +323,8 @@ Size=420,966
|
|||||||
Collapsed=0
|
Collapsed=0
|
||||||
|
|
||||||
[Window][Preset Manager]
|
[Window][Preset Manager]
|
||||||
Pos=2239,1184
|
Pos=937,444
|
||||||
Size=904,777
|
Size=1759,1245
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
|
|
||||||
[Window][Task DAG]
|
[Window][Task DAG]
|
||||||
@@ -333,19 +333,24 @@ Size=967,499
|
|||||||
Collapsed=0
|
Collapsed=0
|
||||||
|
|
||||||
[Window][Usage Analytics]
|
[Window][Usage Analytics]
|
||||||
Pos=3559,1717
|
Pos=2641,1719
|
||||||
Size=281,420
|
Size=1199,418
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
DockId=0x0000000F,0
|
DockId=0x0000000F,0
|
||||||
|
|
||||||
[Window][Tool Preset Manager]
|
[Window][Tool Preset Manager]
|
||||||
Pos=970,1111
|
Pos=1298,303
|
||||||
Size=1103,921
|
Size=2219,1661
|
||||||
Collapsed=0
|
Collapsed=1
|
||||||
|
|
||||||
[Window][Persona Editor]
|
[Window][Persona Editor]
|
||||||
Pos=889,365
|
Pos=909,391
|
||||||
Size=1183,713
|
Size=1886,1234
|
||||||
|
Collapsed=0
|
||||||
|
|
||||||
|
[Window][Prompt Presets Manager]
|
||||||
|
Pos=856,546
|
||||||
|
Size=1000,800
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
|
|
||||||
[Table][0xFB6E3870,4]
|
[Table][0xFB6E3870,4]
|
||||||
@@ -379,11 +384,11 @@ Column 3 Width=20
|
|||||||
Column 4 Weight=1.0000
|
Column 4 Weight=1.0000
|
||||||
|
|
||||||
[Table][0x2A6000B6,4]
|
[Table][0x2A6000B6,4]
|
||||||
RefScale=14
|
RefScale=24
|
||||||
Column 0 Width=42
|
Column 0 Width=72
|
||||||
Column 1 Width=62
|
Column 1 Width=106
|
||||||
Column 2 Weight=1.0000
|
Column 2 Weight=1.0000
|
||||||
Column 3 Width=105
|
Column 3 Width=180
|
||||||
|
|
||||||
[Table][0x8BCC69C7,6]
|
[Table][0x8BCC69C7,6]
|
||||||
RefScale=13
|
RefScale=13
|
||||||
@@ -402,11 +407,11 @@ Column 2 Weight=1.0000
|
|||||||
Column 3 Width=105
|
Column 3 Width=105
|
||||||
|
|
||||||
[Table][0x2C515046,4]
|
[Table][0x2C515046,4]
|
||||||
RefScale=18
|
RefScale=24
|
||||||
Column 0 Width=55
|
Column 0 Width=73
|
||||||
Column 1 Weight=1.0000
|
Column 1 Weight=1.0000
|
||||||
Column 2 Width=136
|
Column 2 Width=181
|
||||||
Column 3 Width=54
|
Column 3 Width=72
|
||||||
|
|
||||||
[Table][0xD99F45C5,4]
|
[Table][0xD99F45C5,4]
|
||||||
Column 0 Sort=0v
|
Column 0 Sort=0v
|
||||||
@@ -427,29 +432,54 @@ Column 1 Width=100
|
|||||||
Column 2 Weight=1.0000
|
Column 2 Weight=1.0000
|
||||||
|
|
||||||
[Table][0xA02D8C87,3]
|
[Table][0xA02D8C87,3]
|
||||||
RefScale=14
|
RefScale=24
|
||||||
Column 0 Width=158
|
Column 0 Width=270
|
||||||
Column 1 Width=105
|
Column 1 Width=180
|
||||||
Column 2 Weight=1.0000
|
Column 2 Weight=1.0000
|
||||||
|
|
||||||
|
[Table][0xD0277E63,2]
|
||||||
|
RefScale=17
|
||||||
|
Column 0 Width=141
|
||||||
|
Column 1 Weight=1.0000
|
||||||
|
|
||||||
|
[Table][0x3AAF84D5,2]
|
||||||
|
RefScale=24
|
||||||
|
Column 0 Width=150
|
||||||
|
Column 1 Weight=1.0000
|
||||||
|
|
||||||
|
[Table][0x8D8494AB,2]
|
||||||
|
RefScale=24
|
||||||
|
Column 0 Width=200
|
||||||
|
Column 1 Weight=1.0000
|
||||||
|
|
||||||
|
[Table][0x2C261E6E,2]
|
||||||
|
RefScale=24
|
||||||
|
Column 0 Width=150
|
||||||
|
Column 1 Weight=1.0000
|
||||||
|
|
||||||
|
[Table][0x9CB1E6FD,2]
|
||||||
|
RefScale=17
|
||||||
|
Column 0 Width=200
|
||||||
|
Column 1 Weight=1.0000
|
||||||
|
|
||||||
[Docking][Data]
|
[Docking][Data]
|
||||||
DockNode ID=0x00000008 Pos=3125,170 Size=593,1157 Split=Y
|
DockNode ID=0x00000008 Pos=3125,170 Size=593,1157 Split=Y
|
||||||
DockNode ID=0x00000009 Parent=0x00000008 SizeRef=1029,147 Selected=0x0469CA7A
|
DockNode ID=0x00000009 Parent=0x00000008 SizeRef=1029,147 Selected=0x0469CA7A
|
||||||
DockNode ID=0x0000000A Parent=0x00000008 SizeRef=1029,145 Selected=0xDF822E02
|
DockNode ID=0x0000000A Parent=0x00000008 SizeRef=1029,145 Selected=0xDF822E02
|
||||||
DockSpace ID=0xAFC85805 Window=0x079D3A04 Pos=0,26 Size=3840,2111 Split=X
|
DockSpace ID=0xAFC85805 Window=0x079D3A04 Pos=0,25 Size=3840,2112 Split=X
|
||||||
DockNode ID=0x00000003 Parent=0xAFC85805 SizeRef=2639,1183 Split=X
|
DockNode ID=0x00000003 Parent=0xAFC85805 SizeRef=2583,1183 Split=X
|
||||||
DockNode ID=0x0000000B Parent=0x00000003 SizeRef=404,1186 Split=X Selected=0xF4139CA2
|
DockNode ID=0x0000000B Parent=0x00000003 SizeRef=404,1186 Split=X Selected=0xF4139CA2
|
||||||
DockNode ID=0x00000007 Parent=0x0000000B SizeRef=788,858 Split=Y Selected=0x8CA2375C
|
DockNode ID=0x00000007 Parent=0x0000000B SizeRef=788,858 Split=Y Selected=0x8CA2375C
|
||||||
DockNode ID=0x00000001 Parent=0x00000007 SizeRef=824,1342 CentralNode=1 Selected=0x7BD57D6A
|
DockNode ID=0x00000001 Parent=0x00000007 SizeRef=824,1759 CentralNode=1 Selected=0x7BD57D6A
|
||||||
DockNode ID=0x00000002 Parent=0x00000007 SizeRef=824,767 Selected=0x1DCB2623
|
DockNode ID=0x00000002 Parent=0x00000007 SizeRef=824,351 Selected=0x1DCB2623
|
||||||
DockNode ID=0x0000000E Parent=0x0000000B SizeRef=1849,858 Split=X Selected=0x418C7449
|
DockNode ID=0x0000000E Parent=0x0000000B SizeRef=1793,858 Split=X Selected=0x418C7449
|
||||||
DockNode ID=0x00000012 Parent=0x0000000E SizeRef=876,402 Split=Y Selected=0x418C7449
|
DockNode ID=0x00000012 Parent=0x0000000E SizeRef=876,402 Split=Y Selected=0x418C7449
|
||||||
DockNode ID=0x00000005 Parent=0x00000012 SizeRef=876,1455 Selected=0x418C7449
|
DockNode ID=0x00000005 Parent=0x00000012 SizeRef=876,1455 Selected=0x418C7449
|
||||||
DockNode ID=0x00000006 Parent=0x00000012 SizeRef=876,654 Selected=0x1D56B311
|
DockNode ID=0x00000006 Parent=0x00000012 SizeRef=876,654 Selected=0x1D56B311
|
||||||
DockNode ID=0x00000013 Parent=0x0000000E SizeRef=971,402 Selected=0x6F2B5B04
|
DockNode ID=0x00000013 Parent=0x0000000E SizeRef=915,402 Selected=0x6F2B5B04
|
||||||
DockNode ID=0x0000000D Parent=0x00000003 SizeRef=435,1186 Selected=0x363E93D6
|
DockNode ID=0x0000000D Parent=0x00000003 SizeRef=435,1186 Selected=0x363E93D6
|
||||||
DockNode ID=0x00000004 Parent=0xAFC85805 SizeRef=1199,1183 Split=Y Selected=0x3AEC3498
|
DockNode ID=0x00000004 Parent=0xAFC85805 SizeRef=1255,1183 Split=Y Selected=0x3AEC3498
|
||||||
DockNode ID=0x00000010 Parent=0x00000004 SizeRef=1199,1689 Selected=0x3AEC3498
|
DockNode ID=0x00000010 Parent=0x00000004 SizeRef=1199,1689 Selected=0x2C0206CE
|
||||||
DockNode ID=0x00000011 Parent=0x00000004 SizeRef=1199,420 Split=X Selected=0xDEB547B6
|
DockNode ID=0x00000011 Parent=0x00000004 SizeRef=1199,420 Split=X Selected=0xDEB547B6
|
||||||
DockNode ID=0x0000000C Parent=0x00000011 SizeRef=916,380 Selected=0x655BC6E9
|
DockNode ID=0x0000000C Parent=0x00000011 SizeRef=916,380 Selected=0x655BC6E9
|
||||||
DockNode ID=0x0000000F Parent=0x00000011 SizeRef=281,380 Selected=0xDEB547B6
|
DockNode ID=0x0000000F Parent=0x00000011 SizeRef=281,380 Selected=0xDEB547B6
|
||||||
|
|||||||
@@ -17,3 +17,4 @@ model = "gemini-3-flash-preview"
|
|||||||
temperature = -1.4901161193847656e-08
|
temperature = -1.4901161193847656e-08
|
||||||
max_output_tokens = 32000
|
max_output_tokens = 32000
|
||||||
history_trunc_limit = 900000
|
history_trunc_limit = 900000
|
||||||
|
top_p = 1.0
|
||||||
|
|||||||
404
src/gui_2.py
404
src/gui_2.py
@@ -942,8 +942,8 @@ class App:
|
|||||||
avail = imgui.get_content_region_avail()
|
avail = imgui.get_content_region_avail()
|
||||||
if not hasattr(self, "_prompt_md_preview"): self._prompt_md_preview = False
|
if not hasattr(self, "_prompt_md_preview"): self._prompt_md_preview = False
|
||||||
|
|
||||||
try:
|
if imgui.begin_table("prompt_main_split", 2, imgui.TableFlags_.resizable | imgui.TableFlags_.borders_inner_v):
|
||||||
if imgui.begin_table("prompt_main_split", 2, imgui.TableFlags_.resizable | imgui.TableFlags_.borders_inner_v):
|
try:
|
||||||
imgui.table_setup_column("List", imgui.TableColumnFlags_.width_fixed, 200)
|
imgui.table_setup_column("List", imgui.TableColumnFlags_.width_fixed, 200)
|
||||||
imgui.table_setup_column("Editor", imgui.TableColumnFlags_.width_stretch)
|
imgui.table_setup_column("Editor", imgui.TableColumnFlags_.width_stretch)
|
||||||
imgui.table_next_row()
|
imgui.table_next_row()
|
||||||
@@ -951,66 +951,68 @@ class App:
|
|||||||
# Left Column: Presets
|
# Left Column: Presets
|
||||||
imgui.table_next_column()
|
imgui.table_next_column()
|
||||||
imgui.begin_child("prompt_list_pane", imgui.ImVec2(0, 0), False)
|
imgui.begin_child("prompt_list_pane", imgui.ImVec2(0, 0), False)
|
||||||
if imgui.button("New Preset", imgui.ImVec2(-1, 0)):
|
try:
|
||||||
self._editing_preset_name = ""
|
if imgui.button("New Preset", imgui.ImVec2(-1, 0)):
|
||||||
self._editing_preset_system_prompt = ""
|
self._editing_preset_name = ""
|
||||||
self._editing_preset_scope = "project"
|
self._editing_preset_system_prompt = ""
|
||||||
self._selected_preset_idx = -1
|
self._editing_preset_scope = "project"
|
||||||
imgui.separator()
|
self._selected_preset_idx = -1
|
||||||
preset_names = sorted(self.controller.presets.keys())
|
imgui.separator()
|
||||||
for i, name in enumerate(preset_names):
|
preset_names = sorted(self.controller.presets.keys())
|
||||||
if imgui.selectable(name, self._selected_preset_idx == i)[0]:
|
for i, name in enumerate(preset_names):
|
||||||
self._selected_preset_idx = i
|
if name and imgui.selectable(f"{name}##p_{i}", self._selected_preset_idx == i)[0]:
|
||||||
self._editing_preset_name = name
|
self._selected_preset_idx = i
|
||||||
p = self.controller.presets[name]
|
self._editing_preset_name = name
|
||||||
self._editing_preset_system_prompt = p.system_prompt
|
p = self.controller.presets[name]
|
||||||
self._editing_preset_scope = self.controller.preset_manager.get_preset_scope(name)
|
self._editing_preset_system_prompt = p.system_prompt
|
||||||
imgui.end_child()
|
self._editing_preset_scope = self.controller.preset_manager.get_preset_scope(name)
|
||||||
|
finally:
|
||||||
|
imgui.end_child()
|
||||||
|
|
||||||
# Right Column: Editor
|
# Right Column: Editor
|
||||||
imgui.table_next_column()
|
imgui.table_next_column()
|
||||||
avail_r = imgui.get_content_region_avail()
|
avail_r = imgui.get_content_region_avail()
|
||||||
# Subtract space for bottom buttons
|
# Subtract space for bottom buttons
|
||||||
imgui.begin_child("prompt_edit_pane", imgui.ImVec2(0, avail_r.y - 45), False)
|
imgui.begin_child("prompt_edit_pane", imgui.ImVec2(0, avail_r.y - 45), False)
|
||||||
|
try:
|
||||||
|
p_disp = self._editing_preset_name or "(New Preset)"
|
||||||
|
imgui.text_colored(C_IN, f"Editing Prompt Preset: {p_disp}")
|
||||||
|
imgui.separator()
|
||||||
|
|
||||||
p_disp = self._editing_preset_name or "(New Preset)"
|
if imgui.begin_table("p_meta", 2):
|
||||||
imgui.text_colored(C_IN, f"Editing Prompt Preset: {p_disp}")
|
try:
|
||||||
imgui.separator()
|
imgui.table_setup_column("L", imgui.TableColumnFlags_.width_fixed, 80)
|
||||||
|
imgui.table_setup_column("F", imgui.TableColumnFlags_.width_stretch)
|
||||||
|
imgui.table_next_row()
|
||||||
|
imgui.table_next_column(); imgui.text("Name:")
|
||||||
|
imgui.table_next_column(); imgui.set_next_item_width(-1)
|
||||||
|
_, self._editing_preset_name = imgui.input_text("##epn", self._editing_preset_name)
|
||||||
|
imgui.table_next_row()
|
||||||
|
imgui.table_next_column(); imgui.text("Scope:")
|
||||||
|
imgui.table_next_column()
|
||||||
|
if imgui.radio_button("Global", self._editing_preset_scope == "global"): self._editing_preset_scope = "global"
|
||||||
|
imgui.same_line()
|
||||||
|
if imgui.radio_button("Project", self._editing_preset_scope == "project"): self._editing_preset_scope = "project"
|
||||||
|
finally:
|
||||||
|
imgui.end_table()
|
||||||
|
|
||||||
if imgui.begin_table("p_meta", 2):
|
imgui.dummy(imgui.ImVec2(0, 4))
|
||||||
imgui.table_setup_column("L", imgui.TableColumnFlags_.width_fixed, 80)
|
imgui.separator()
|
||||||
imgui.table_setup_column("F", imgui.TableColumnFlags_.width_stretch)
|
imgui.text("Prompt Content:")
|
||||||
imgui.table_next_row()
|
|
||||||
imgui.table_next_column()
|
|
||||||
imgui.text("Name:")
|
|
||||||
imgui.table_next_column()
|
|
||||||
imgui.set_next_item_width(-1)
|
|
||||||
_, self._editing_preset_name = imgui.input_text("##epn", self._editing_preset_name)
|
|
||||||
imgui.table_next_row()
|
|
||||||
imgui.table_next_column()
|
|
||||||
imgui.text("Scope:")
|
|
||||||
imgui.table_next_column()
|
|
||||||
if imgui.radio_button("Global", self._editing_preset_scope == "global"):
|
|
||||||
self._editing_preset_scope = "global"
|
|
||||||
imgui.same_line()
|
imgui.same_line()
|
||||||
if imgui.radio_button("Project", self._editing_preset_scope == "project"):
|
if imgui.button("MD Preview" if not self._prompt_md_preview else "Edit Mode"):
|
||||||
self._editing_preset_scope = "project"
|
self._prompt_md_preview = not self._prompt_md_preview
|
||||||
imgui.end_table()
|
|
||||||
|
|
||||||
imgui.dummy(imgui.ImVec2(0, 4))
|
if self._prompt_md_preview:
|
||||||
imgui.separator()
|
imgui.begin_child("prompt_preview", imgui.ImVec2(-1, imgui.get_content_region_avail().y), True)
|
||||||
imgui.text("Prompt Content:")
|
try:
|
||||||
imgui.same_line()
|
markdown_helper.render(self._editing_preset_system_prompt, context_id="prompt_preset_preview")
|
||||||
if imgui.button("MD Preview" if not self._prompt_md_preview else "Edit Mode"):
|
finally:
|
||||||
self._prompt_md_preview = not self._prompt_md_preview
|
imgui.end_child()
|
||||||
|
else:
|
||||||
if self._prompt_md_preview:
|
_, self._editing_preset_system_prompt = imgui.input_text_multiline("##pcont", self._editing_preset_system_prompt, imgui.ImVec2(-1, imgui.get_content_region_avail().y))
|
||||||
imgui.begin_child("prompt_preview", imgui.ImVec2(-1, imgui.get_content_region_avail().y), True)
|
finally:
|
||||||
self.markdown_renderer.render(self._editing_preset_system_prompt)
|
|
||||||
imgui.end_child()
|
imgui.end_child()
|
||||||
else:
|
|
||||||
_, self._editing_preset_system_prompt = imgui.input_text_multiline("##pcont", self._editing_preset_system_prompt, imgui.ImVec2(-1, imgui.get_content_region_avail().y))
|
|
||||||
imgui.end_child()
|
|
||||||
|
|
||||||
# Bottom Buttons
|
# Bottom Buttons
|
||||||
imgui.separator()
|
imgui.separator()
|
||||||
@@ -1030,9 +1032,8 @@ class App:
|
|||||||
imgui.same_line()
|
imgui.same_line()
|
||||||
if imgui.button("Close", imgui.ImVec2(100, 0)):
|
if imgui.button("Close", imgui.ImVec2(100, 0)):
|
||||||
self.show_preset_manager_window = False
|
self.show_preset_manager_window = False
|
||||||
|
finally:
|
||||||
imgui.end_table()
|
imgui.end_table()
|
||||||
finally:
|
|
||||||
pass
|
|
||||||
|
|
||||||
def _render_preset_manager_window(self, is_embedded: bool = False) -> None:
|
def _render_preset_manager_window(self, is_embedded: bool = False) -> None:
|
||||||
if not self.show_preset_manager_window and not is_embedded: return
|
if not self.show_preset_manager_window and not is_embedded: return
|
||||||
@@ -1063,8 +1064,8 @@ class App:
|
|||||||
if not hasattr(self, "_bias_weights_open"): self._bias_weights_open = True
|
if not hasattr(self, "_bias_weights_open"): self._bias_weights_open = True
|
||||||
if not hasattr(self, "_bias_cats_open"): self._bias_cats_open = True
|
if not hasattr(self, "_bias_cats_open"): self._bias_cats_open = True
|
||||||
|
|
||||||
try:
|
if imgui.begin_table("tp_main_split", 2, imgui.TableFlags_.resizable | imgui.TableFlags_.borders_inner_v):
|
||||||
if imgui.begin_table("tp_main_split", 2, imgui.TableFlags_.resizable | imgui.TableFlags_.borders_inner_v):
|
try:
|
||||||
imgui.table_setup_column("List", imgui.TableColumnFlags_.width_fixed, 200)
|
imgui.table_setup_column("List", imgui.TableColumnFlags_.width_fixed, 200)
|
||||||
imgui.table_setup_column("Editor", imgui.TableColumnFlags_.width_stretch)
|
imgui.table_setup_column("Editor", imgui.TableColumnFlags_.width_stretch)
|
||||||
imgui.table_next_row()
|
imgui.table_next_row()
|
||||||
@@ -1072,154 +1073,182 @@ class App:
|
|||||||
# Left Sidebar
|
# Left Sidebar
|
||||||
imgui.table_next_column()
|
imgui.table_next_column()
|
||||||
imgui.begin_child("tp_list_pane", imgui.ImVec2(0, 0), False)
|
imgui.begin_child("tp_list_pane", imgui.ImVec2(0, 0), False)
|
||||||
if imgui.button("New Preset", imgui.ImVec2(-1, 0)):
|
try:
|
||||||
self._editing_tool_preset_name = ""; self._editing_tool_preset_categories = {cat: {} for cat in models.DEFAULT_TOOL_CATEGORIES}
|
if imgui.button("New Preset", imgui.ImVec2(-1, 0)):
|
||||||
self._editing_tool_preset_scope = "project"; self._selected_tool_preset_idx = -1
|
self._editing_tool_preset_name = ""; self._editing_tool_preset_categories = {cat: {} for cat in models.DEFAULT_TOOL_CATEGORIES}
|
||||||
imgui.separator()
|
self._editing_tool_preset_scope = "project"; self._selected_tool_preset_idx = -1
|
||||||
preset_names = sorted(self.controller.tool_presets.keys())
|
imgui.separator()
|
||||||
for i, name in enumerate(preset_names):
|
preset_names = sorted(self.controller.tool_presets.keys())
|
||||||
if imgui.selectable(name, self._selected_tool_preset_idx == i)[0]:
|
for i, name in enumerate(preset_names):
|
||||||
self._selected_tool_preset_idx = i; self._editing_tool_preset_name = name
|
if imgui.selectable(f"{name}##tp_{i}", self._selected_tool_preset_idx == i)[0]:
|
||||||
preset = self.controller.tool_presets[name]
|
self._selected_tool_preset_idx = i; self._editing_tool_preset_name = name
|
||||||
self._editing_tool_preset_categories = {cat: copy.deepcopy(tools) for cat, tools in preset.categories.items()}
|
preset = self.controller.tool_presets[name]
|
||||||
imgui.end_child()
|
self._editing_tool_preset_categories = {cat: copy.deepcopy(tools) for cat, tools in preset.categories.items()}
|
||||||
|
finally:
|
||||||
|
imgui.end_child()
|
||||||
|
|
||||||
# Right Editor
|
# Right Editor
|
||||||
imgui.table_next_column()
|
imgui.table_next_column()
|
||||||
avail_r = imgui.get_content_region_avail()
|
avail_r = imgui.get_content_region_avail()
|
||||||
# Bottom buttons reserved space
|
# Bottom buttons reserved space
|
||||||
imgui.begin_child("tp_editor_content", imgui.ImVec2(0, avail_r.y - 45), False)
|
imgui.begin_child("tp_editor_content", imgui.ImVec2(0, avail_r.y - 45), False)
|
||||||
|
try:
|
||||||
|
p_name = self._editing_tool_preset_name or "(New Tool Preset)"
|
||||||
|
imgui.text_colored(C_IN, f"Editing Tool Preset: {p_name}"); imgui.separator()
|
||||||
|
|
||||||
p_name = self._editing_tool_preset_name or "(New Tool Preset)"
|
if imgui.begin_table("tp_meta", 2):
|
||||||
imgui.text_colored(C_IN, f"Editing Tool Preset: {p_name}"); imgui.separator()
|
try:
|
||||||
|
imgui.table_setup_column("L", imgui.TableColumnFlags_.width_fixed, 80); imgui.table_setup_column("F", imgui.TableColumnFlags_.width_stretch)
|
||||||
|
imgui.table_next_row(); imgui.table_next_column(); imgui.text("Name:"); imgui.table_next_column(); imgui.set_next_item_width(-1); _, self._editing_tool_preset_name = imgui.input_text("##etpn", self._editing_tool_preset_name)
|
||||||
|
imgui.table_next_row(); imgui.table_next_column(); imgui.text("Scope:"); imgui.table_next_column()
|
||||||
|
if imgui.radio_button("Global", self._editing_tool_preset_scope == "global"): self._editing_tool_preset_scope = "global"
|
||||||
|
imgui.same_line();
|
||||||
|
if imgui.radio_button("Project", self._editing_tool_preset_scope == "project"): self._editing_tool_preset_scope = "project"
|
||||||
|
finally:
|
||||||
|
imgui.end_table()
|
||||||
|
|
||||||
if imgui.begin_table("tp_meta", 2):
|
# Vertical split calculation
|
||||||
imgui.table_setup_column("L", imgui.TableColumnFlags_.width_fixed, 80); imgui.table_setup_column("F", imgui.TableColumnFlags_.width_stretch)
|
rem_y = imgui.get_content_region_avail().y - 80
|
||||||
imgui.table_next_row(); imgui.table_next_column(); imgui.text("Name:"); imgui.table_next_column(); imgui.set_next_item_width(-1); _, self._editing_tool_preset_name = imgui.input_text("##etpn", self._editing_tool_preset_name)
|
if self._tool_list_open and self._bias_list_open:
|
||||||
imgui.table_next_row(); imgui.table_next_column(); imgui.text("Scope:"); imgui.table_next_column()
|
h1 = rem_y * self._tool_split_v; h2 = rem_y - h1 - 10
|
||||||
if imgui.radio_button("Global", self._editing_tool_preset_scope == "global"): self._editing_tool_preset_scope = "global"
|
elif self._tool_list_open: h1, h2 = rem_y, 0
|
||||||
imgui.same_line();
|
elif self._bias_list_open: h1, h2 = 0, rem_y
|
||||||
if imgui.radio_button("Project", self._editing_tool_preset_scope == "project"): self._editing_tool_preset_scope = "project"
|
else: h1, h2 = 0, 0
|
||||||
imgui.end_table()
|
|
||||||
|
|
||||||
# Vertical split calculation
|
imgui.dummy(imgui.ImVec2(0, 4))
|
||||||
rem_y = imgui.get_content_region_avail().y - 80
|
opened_tools = imgui.collapsing_header("Categories & Tools", imgui.TreeNodeFlags_.default_open)
|
||||||
if self._tool_list_open and self._bias_list_open:
|
if opened_tools != self._tool_list_open: self._tool_list_open = opened_tools
|
||||||
h1 = rem_y * self._tool_split_v; h2 = rem_y - h1 - 10
|
|
||||||
elif self._tool_list_open: h1, h2 = rem_y, 0
|
|
||||||
elif self._bias_list_open: h1, h2 = 0, rem_y
|
|
||||||
else: h1, h2 = 0, 0
|
|
||||||
|
|
||||||
imgui.dummy(imgui.ImVec2(0, 4))
|
if self._tool_list_open:
|
||||||
opened_tools = imgui.collapsing_header("Categories & Tools", imgui.TreeNodeFlags_.default_open)
|
imgui.text("Filter:"); imgui.same_line()
|
||||||
if opened_tools != self._tool_list_open: self._tool_list_open = opened_tools
|
cat_opts = ["All"] + sorted(list(models.DEFAULT_TOOL_CATEGORIES.keys()))
|
||||||
|
f_idx = cat_opts.index(self.ui_tool_filter_category) if self.ui_tool_filter_category in cat_opts else 0
|
||||||
|
imgui.set_next_item_width(200); ch_cat, next_f_idx = imgui.combo("##tp_filter", f_idx, cat_opts)
|
||||||
|
if ch_cat: self.ui_tool_filter_category = cat_opts[next_f_idx]
|
||||||
|
|
||||||
if self._tool_list_open:
|
imgui.begin_child("tp_scroll", imgui.ImVec2(0, h1), True)
|
||||||
imgui.text("Filter:"); imgui.same_line()
|
try:
|
||||||
cat_opts = ["All"] + sorted(list(models.DEFAULT_TOOL_CATEGORIES.keys()))
|
|
||||||
f_idx = cat_opts.index(self.ui_tool_filter_category) if self.ui_tool_filter_category in cat_opts else 0
|
|
||||||
imgui.set_next_item_width(200); ch_cat, next_f_idx = imgui.combo("##tp_filter", f_idx, cat_opts)
|
|
||||||
if ch_cat: self.ui_tool_filter_category = cat_opts[next_f_idx]
|
|
||||||
|
|
||||||
imgui.begin_child("tp_scroll", imgui.ImVec2(0, h1), True)
|
|
||||||
for cat_name, default_tools in models.DEFAULT_TOOL_CATEGORIES.items():
|
|
||||||
if self.ui_tool_filter_category != "All" and self.ui_tool_filter_category != cat_name: continue
|
|
||||||
if imgui.tree_node(cat_name):
|
|
||||||
if cat_name not in self._editing_tool_preset_categories: self._editing_tool_preset_categories[cat_name] = []
|
|
||||||
curr_cat_tools = self._editing_tool_preset_categories[cat_name]
|
|
||||||
if imgui.begin_table(f"tt_{cat_name}", 2, imgui.TableFlags_.borders_inner_v):
|
|
||||||
imgui.table_setup_column("Tool", imgui.TableColumnFlags_.width_fixed, 250); imgui.table_setup_column("Ctrls", imgui.TableColumnFlags_.width_stretch)
|
|
||||||
for tool_name in default_tools:
|
|
||||||
tool = next((t for t in curr_cat_tools if t.name == tool_name), None)
|
|
||||||
mode = "disabled" if tool is None else tool.approval
|
|
||||||
imgui.table_next_row(); imgui.table_next_column(); imgui.text(tool_name); imgui.table_next_column()
|
|
||||||
if imgui.radio_button(f"Off##{cat_name}_{tool_name}", mode == "disabled"):
|
|
||||||
if tool: current_cat_tools.remove(tool)
|
|
||||||
imgui.same_line();
|
|
||||||
if imgui.radio_button(f"Auto##{cat_name}_{tool_name}", mode == "auto"):
|
|
||||||
if not tool: tool = models.Tool(name=tool_name, approval="auto"); current_cat_tools.append(tool)
|
|
||||||
else: tool.approval = "auto"
|
|
||||||
imgui.same_line();
|
|
||||||
if imgui.radio_button(f"Ask##{cat_name}_{tool_name}", mode == "ask"):
|
|
||||||
if not tool: tool = models.Tool(name=tool_name, approval="ask"); current_cat_tools.append(tool)
|
|
||||||
else: tool.approval = "ask"
|
|
||||||
imgui.end_table(); imgui.tree_pop()
|
|
||||||
imgui.end_child()
|
|
||||||
if self._bias_list_open:
|
|
||||||
imgui.button("###tool_splitter", imgui.ImVec2(-1, 4))
|
|
||||||
if imgui.is_item_active(): self._tool_split_v = max(0.1, min(0.9, self._tool_split_v + imgui.get_io().mouse_delta.y / rem_y))
|
|
||||||
|
|
||||||
imgui.dummy(imgui.ImVec2(0, 4))
|
|
||||||
opened_bias = imgui.collapsing_header("Bias Profiles", imgui.TreeNodeFlags_.default_open)
|
|
||||||
if opened_bias != self._bias_list_open: self._bias_list_open = opened_bias
|
|
||||||
|
|
||||||
if self._bias_list_open:
|
|
||||||
imgui.begin_child("bias_area", imgui.ImVec2(0, h2), True)
|
|
||||||
if imgui.begin_table("bias_split", 2, imgui.TableFlags_.resizable | imgui.TableFlags_.borders_inner_v):
|
|
||||||
imgui.table_setup_column("BList", imgui.TableColumnFlags_.width_fixed, 150); imgui.table_setup_column("BEdit", imgui.TableColumnFlags_.width_stretch)
|
|
||||||
imgui.table_next_row(); imgui.table_next_column()
|
|
||||||
imgui.begin_child("blist_pane", imgui.ImVec2(0, 0), False)
|
|
||||||
if imgui.button("New Profile", imgui.ImVec2(-1, 0)):
|
|
||||||
self._editing_bias_profile_name = ""; self._editing_bias_profile_tool_weights = {}
|
|
||||||
self._editing_bias_profile_category_multipliers = {}; self._selected_bias_profile_idx = -1
|
|
||||||
imgui.separator(); bnames = sorted(self.bias_profiles.keys())
|
|
||||||
for i, bname in enumerate(bnames):
|
|
||||||
if imgui.selectable(bname, self._selected_bias_profile_idx == i)[0]:
|
|
||||||
self._selected_bias_profile_idx = i; self._editing_bias_profile_name = bname; prof = self.bias_profiles[bname]
|
|
||||||
self._editing_bias_profile_tool_weights = copy.deepcopy(prof.tool_weights); self._editing_bias_profile_category_multipliers = copy.deepcopy(prof.category_multipliers)
|
|
||||||
imgui.end_child()
|
|
||||||
imgui.table_next_column()
|
|
||||||
imgui.begin_child("bedit_pane", imgui.ImVec2(0, 0), False)
|
|
||||||
imgui.text("Name:"); imgui.same_line(); imgui.set_next_item_width(-1); _, self._editing_bias_profile_name = imgui.input_text("##bname", self._editing_bias_profile_name)
|
|
||||||
|
|
||||||
rem_bias_y = imgui.get_content_region_avail().y - 45 # Save button space
|
|
||||||
if self._bias_weights_open and self._bias_cats_open:
|
|
||||||
bh1 = rem_bias_y * self._bias_split_v; bh2 = rem_bias_y - bh1 - 10
|
|
||||||
elif self._bias_weights_open: bh1, bh2 = rem_bias_y, 0
|
|
||||||
elif self._bias_cats_open: bh1, bh2 = 0, rem_bias_y
|
|
||||||
else: bh1, bh2 = 0, 0
|
|
||||||
|
|
||||||
opened_bw = imgui.collapsing_header("Tool Weights", imgui.TreeNodeFlags_.default_open)
|
|
||||||
if opened_bw != self._bias_weights_open: self._bias_weights_open = opened_bw
|
|
||||||
if self._bias_weights_open:
|
|
||||||
imgui.begin_child("btool_scroll", imgui.ImVec2(0, bh1), True)
|
|
||||||
for cat_name, default_tools in models.DEFAULT_TOOL_CATEGORIES.items():
|
for cat_name, default_tools in models.DEFAULT_TOOL_CATEGORIES.items():
|
||||||
if imgui.tree_node(f"{cat_name}##b"):
|
if self.ui_tool_filter_category != "All" and self.ui_tool_filter_category != cat_name: continue
|
||||||
if imgui.begin_table(f"bt_{cat_name}", 2):
|
if imgui.tree_node(cat_name):
|
||||||
imgui.table_setup_column("T", imgui.TableColumnFlags_.width_fixed, 220); imgui.table_setup_column("W", imgui.TableColumnFlags_.width_stretch)
|
if cat_name not in self._editing_tool_preset_categories: self._editing_tool_preset_categories[cat_name] = []
|
||||||
for tn in default_tools:
|
curr_cat_tools = self._editing_tool_preset_categories[cat_name]
|
||||||
imgui.table_next_row(); imgui.table_next_column(); imgui.text(tn); imgui.table_next_column()
|
if imgui.begin_table(f"tt_{cat_name}", 2, imgui.TableFlags_.borders_inner_v):
|
||||||
curr_w = self._editing_bias_profile_tool_weights.get(tn, 3); imgui.set_next_item_width(-1)
|
try:
|
||||||
ch_w, n_w = imgui.slider_int(f"##bw_{tn}", curr_w, 1, 10);
|
imgui.table_setup_column("Tool", imgui.TableColumnFlags_.width_fixed, 250); imgui.table_setup_column("Ctrls", imgui.TableColumnFlags_.width_stretch)
|
||||||
if ch_w: self._editing_bias_profile_tool_weights[tn] = n_w
|
for tool_name in default_tools:
|
||||||
imgui.end_table(); imgui.tree_pop()
|
tool = next((t for t in curr_cat_tools if t.name == tool_name), None)
|
||||||
|
mode = "disabled" if tool is None else tool.approval
|
||||||
|
imgui.table_next_row(); imgui.table_next_column(); imgui.text(tool_name); imgui.table_next_column()
|
||||||
|
if imgui.radio_button(f"Off##{cat_name}_{tool_name}", mode == "disabled"):
|
||||||
|
if tool: curr_cat_tools.remove(tool)
|
||||||
|
imgui.same_line();
|
||||||
|
if imgui.radio_button(f"Auto##{cat_name}_{tool_name}", mode == "auto"):
|
||||||
|
if not tool: tool = models.Tool(name=tool_name, approval="auto"); current_cat_tools.append(tool)
|
||||||
|
else: tool.approval = "auto"
|
||||||
|
imgui.same_line();
|
||||||
|
if imgui.radio_button(f"Ask##{cat_name}_{tool_name}", mode == "ask"):
|
||||||
|
if not tool: tool = models.Tool(name=tool_name, approval="ask"); current_cat_tools.append(tool)
|
||||||
|
else: tool.approval = "ask"
|
||||||
|
finally:
|
||||||
|
imgui.end_table()
|
||||||
|
imgui.tree_pop()
|
||||||
|
finally:
|
||||||
imgui.end_child()
|
imgui.end_child()
|
||||||
if self._bias_cats_open:
|
if self._bias_list_open:
|
||||||
imgui.button("###bias_splitter", imgui.ImVec2(-1, 4))
|
imgui.button("###tool_splitter", imgui.ImVec2(-1, 4))
|
||||||
if imgui.is_item_active(): self._bias_split_v = max(0.1, min(0.9, self._bias_split_v + imgui.get_io().mouse_delta.y / rem_bias_y))
|
if imgui.is_item_active(): self._tool_split_v = max(0.1, min(0.9, self._tool_split_v + imgui.get_io().mouse_delta.y / rem_y))
|
||||||
|
|
||||||
opened_bc = imgui.collapsing_header("Category Multipliers", imgui.TreeNodeFlags_.default_open)
|
imgui.dummy(imgui.ImVec2(0, 4))
|
||||||
if opened_bc != self._bias_cats_open: self._bias_cats_open = opened_bc
|
opened_bias = imgui.collapsing_header("Bias Profiles", imgui.TreeNodeFlags_.default_open)
|
||||||
if self._bias_cats_open:
|
if opened_bias != self._bias_list_open: self._bias_list_open = opened_bias
|
||||||
imgui.begin_child("bcat_scroll", imgui.ImVec2(0, bh2), True)
|
|
||||||
if imgui.begin_table("bcats", 2):
|
|
||||||
imgui.table_setup_column("C", imgui.TableColumnFlags_.width_fixed, 220); imgui.table_setup_column("M", imgui.TableColumnFlags_.width_stretch)
|
|
||||||
for cn in sorted(models.DEFAULT_TOOL_CATEGORIES.keys()):
|
|
||||||
imgui.table_next_row(); imgui.table_next_column(); imgui.text(cn); imgui.table_next_column()
|
|
||||||
curr_m = self._editing_bias_profile_category_multipliers.get(cn, 1.0); imgui.set_next_item_width(-1)
|
|
||||||
ch_m, n_m = imgui.slider_float(f"##cm_{cn}", curr_m, 0.1, 5.0, "%.1fx");
|
|
||||||
if ch_m: self._editing_bias_profile_category_multipliers[cn] = n_m
|
|
||||||
imgui.end_table(); imgui.end_child()
|
|
||||||
|
|
||||||
if imgui.button("Save Profile", imgui.ImVec2(-1, 0)):
|
if self._bias_list_open:
|
||||||
try:
|
imgui.begin_child("bias_area", imgui.ImVec2(0, h2), True)
|
||||||
p = models.BiasProfile(name=self._editing_bias_profile_name, tool_weights=self._editing_bias_profile_tool_weights, category_multipliers=self._editing_bias_profile_category_multipliers)
|
try:
|
||||||
self.controller._cb_save_bias_profile(p, self._editing_tool_preset_scope); self.ai_status = f"Saved: {p.name}"
|
if imgui.begin_table("bias_split", 2, imgui.TableFlags_.resizable | imgui.TableFlags_.borders_inner_v):
|
||||||
except Exception as e: self.ai_status = f"Error: {e}"
|
try:
|
||||||
imgui.end_child()
|
imgui.table_setup_column("BList", imgui.TableColumnFlags_.width_fixed, 150); imgui.table_setup_column("BEdit", imgui.TableColumnFlags_.width_stretch)
|
||||||
imgui.end_table()
|
imgui.table_next_row(); imgui.table_next_column()
|
||||||
|
imgui.begin_child("blist_pane", imgui.ImVec2(0, 0), False)
|
||||||
|
try:
|
||||||
|
if imgui.button("New Profile", imgui.ImVec2(-1, 0)):
|
||||||
|
self._editing_bias_profile_name = ""; self._editing_bias_profile_tool_weights = {}
|
||||||
|
self._editing_bias_profile_category_multipliers = {}; self._selected_bias_profile_idx = -1
|
||||||
|
imgui.separator(); bnames = sorted(self.bias_profiles.keys())
|
||||||
|
for i, bname in enumerate(bnames):
|
||||||
|
if imgui.selectable(f"{bname}##b_{i}", self._selected_bias_profile_idx == i)[0]:
|
||||||
|
self._selected_bias_profile_idx = i; self._editing_bias_profile_name = bname; prof = self.bias_profiles[bname]
|
||||||
|
self._editing_bias_profile_tool_weights = copy.deepcopy(prof.tool_weights); self._editing_bias_profile_category_multipliers = copy.deepcopy(prof.category_multipliers)
|
||||||
|
finally:
|
||||||
|
imgui.end_child()
|
||||||
|
imgui.table_next_column()
|
||||||
|
imgui.begin_child("bedit_pane", imgui.ImVec2(0, 0), False)
|
||||||
|
try:
|
||||||
|
imgui.text("Name:"); imgui.same_line(); imgui.set_next_item_width(-1); _, self._editing_bias_profile_name = imgui.input_text("##bname", self._editing_bias_profile_name)
|
||||||
|
|
||||||
|
rem_bias_y = imgui.get_content_region_avail().y - 45 # Save button space
|
||||||
|
if self._bias_weights_open and self._bias_cats_open:
|
||||||
|
bh1 = rem_bias_y * self._bias_split_v; bh2 = rem_bias_y - bh1 - 10
|
||||||
|
elif self._bias_weights_open: bh1, bh2 = rem_bias_y, 0
|
||||||
|
elif self._bias_cats_open: bh1, bh2 = 0, rem_bias_y
|
||||||
|
else: bh1, bh2 = 0, 0
|
||||||
|
|
||||||
|
opened_bw = imgui.collapsing_header("Tool Weights", imgui.TreeNodeFlags_.default_open)
|
||||||
|
if opened_bw != self._bias_weights_open: self._bias_weights_open = opened_bw
|
||||||
|
if self._bias_weights_open:
|
||||||
|
imgui.begin_child("btool_scroll", imgui.ImVec2(0, bh1), True)
|
||||||
|
try:
|
||||||
|
for cat_name, default_tools in models.DEFAULT_TOOL_CATEGORIES.items():
|
||||||
|
if imgui.tree_node(f"{cat_name}##b"):
|
||||||
|
if imgui.begin_table(f"bt_{cat_name}", 2):
|
||||||
|
try:
|
||||||
|
imgui.table_setup_column("T", imgui.TableColumnFlags_.width_fixed, 220); imgui.table_setup_column("W", imgui.TableColumnFlags_.width_stretch)
|
||||||
|
for tn in default_tools:
|
||||||
|
imgui.table_next_row(); imgui.table_next_column(); imgui.text(tn); imgui.table_next_column()
|
||||||
|
curr_w = self._editing_bias_profile_tool_weights.get(tn, 3); imgui.set_next_item_width(-1)
|
||||||
|
ch_w, n_w = imgui.slider_int(f"##bw_{tn}", curr_w, 1, 10);
|
||||||
|
if ch_w: self._editing_bias_profile_tool_weights[tn] = n_w
|
||||||
|
finally:
|
||||||
|
imgui.end_table()
|
||||||
|
imgui.tree_pop()
|
||||||
|
finally:
|
||||||
|
imgui.end_child()
|
||||||
|
if self._bias_cats_open:
|
||||||
|
imgui.button("###bias_splitter", imgui.ImVec2(-1, 4))
|
||||||
|
if imgui.is_item_active(): self._bias_split_v = max(0.1, min(0.9, self._bias_split_v + imgui.get_io().mouse_delta.y / rem_bias_y))
|
||||||
|
|
||||||
|
opened_bc = imgui.collapsing_header("Category Multipliers", imgui.TreeNodeFlags_.default_open)
|
||||||
|
if opened_bc != self._bias_cats_open: self._bias_cats_open = opened_bc
|
||||||
|
if self._bias_cats_open:
|
||||||
|
imgui.begin_child("bcat_scroll", imgui.ImVec2(0, bh2), True)
|
||||||
|
try:
|
||||||
|
if imgui.begin_table("bcats", 2):
|
||||||
|
try:
|
||||||
|
imgui.table_setup_column("C", imgui.TableColumnFlags_.width_fixed, 220); imgui.table_setup_column("M", imgui.TableColumnFlags_.width_stretch)
|
||||||
|
for cn in sorted(models.DEFAULT_TOOL_CATEGORIES.keys()):
|
||||||
|
imgui.table_next_row(); imgui.table_next_column(); imgui.text(cn); imgui.table_next_column()
|
||||||
|
curr_m = self._editing_bias_profile_category_multipliers.get(cn, 1.0); imgui.set_next_item_width(-1)
|
||||||
|
ch_m, n_m = imgui.slider_float(f"##cm_{cn}", curr_m, 0.1, 5.0, "%.1fx");
|
||||||
|
if ch_m: self._editing_bias_profile_category_multipliers[cn] = n_m
|
||||||
|
finally:
|
||||||
|
imgui.end_table()
|
||||||
|
finally:
|
||||||
|
imgui.end_child()
|
||||||
|
|
||||||
|
if imgui.button("Save Profile", imgui.ImVec2(-1, 0)):
|
||||||
|
try:
|
||||||
|
p = models.BiasProfile(name=self._editing_bias_profile_name, tool_weights=self._editing_bias_profile_tool_weights, category_multipliers=self._editing_bias_profile_category_multipliers)
|
||||||
|
self.controller._cb_save_bias_profile(p, self._editing_tool_preset_scope); self.ai_status = f"Saved: {p.name}"
|
||||||
|
except Exception as e: self.ai_status = f"Error: {e}"
|
||||||
|
finally:
|
||||||
|
imgui.end_child()
|
||||||
|
finally:
|
||||||
|
imgui.end_table()
|
||||||
|
finally:
|
||||||
|
imgui.end_child()
|
||||||
|
finally:
|
||||||
imgui.end_child()
|
imgui.end_child()
|
||||||
imgui.end_child()
|
|
||||||
|
|
||||||
# --- Footer Buttons ---
|
# --- Footer Buttons ---
|
||||||
imgui.separator()
|
imgui.separator()
|
||||||
@@ -1231,6 +1260,7 @@ class App:
|
|||||||
imgui.same_line();
|
imgui.same_line();
|
||||||
if not is_embedded:
|
if not is_embedded:
|
||||||
if imgui.button("Close", imgui.ImVec2(100, 0)): self.show_tool_preset_manager_window = False
|
if imgui.button("Close", imgui.ImVec2(100, 0)): self.show_tool_preset_manager_window = False
|
||||||
|
finally:
|
||||||
imgui.end_table()
|
imgui.end_table()
|
||||||
finally:
|
finally:
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -45,3 +45,10 @@ search_files = 4
|
|||||||
[bias_profiles.Discovery-Heavy.category_multipliers]
|
[bias_profiles.Discovery-Heavy.category_multipliers]
|
||||||
Web = 1.5
|
Web = 1.5
|
||||||
Analysis = 1.3
|
Analysis = 1.3
|
||||||
|
|
||||||
|
[bias_profiles.""]
|
||||||
|
name = ""
|
||||||
|
|
||||||
|
[bias_profiles."".tool_weights]
|
||||||
|
|
||||||
|
[bias_profiles."".category_multipliers]
|
||||||
|
|||||||
Reference in New Issue
Block a user