chore: revert Files & Media to original working code

This commit is contained in:
2026-05-10 16:44:08 -04:00
parent b8155c0745
commit fe11b41364
+16 -29
View File
@@ -760,8 +760,7 @@ class App:
ts_str = datetime.datetime.fromtimestamp(ts).strftime("%H:%M:%S") ts_str = datetime.datetime.fromtimestamp(ts).strftime("%H:%M:%S")
label = f"[{ts_str}] {desc}##{actual_idx}" label = f"[{ts_str}] {desc}##{actual_idx}"
_, selected = imgui.selectable(label, False) if imgui.selectable(label)[0]:
if selected:
self._handle_jump_to_history(actual_idx) self._handle_jump_to_history(actual_idx)
imgui.end_child() imgui.end_child()
imgui.end() imgui.end()
@@ -873,13 +872,11 @@ class App:
exp, opened = imgui.begin("Files & Media", self.show_windows["Files & Media"]) exp, opened = imgui.begin("Files & Media", self.show_windows["Files & Media"])
self.show_windows["Files & Media"] = bool(opened) self.show_windows["Files & Media"] = bool(opened)
if exp: if exp:
files_open = imgui.collapsing_header("Files", imgui.TreeNodeFlags_.default_open) if imgui.collapsing_header("Files"):
if files_open:
self._render_files_panel() self._render_files_panel()
shots_open = imgui.collapsing_header("Screenshots", imgui.TreeNodeFlags_.default_open) if imgui.collapsing_header("Screenshots"):
if shots_open:
self._render_screenshots_panel() self._render_screenshots_panel()
imgui.end() imgui.end()
if self.show_windows.get("AI Settings", False): if self.show_windows.get("AI Settings", False):
exp, opened = imgui.begin("AI Settings", self.show_windows["AI Settings"]) exp, opened = imgui.begin("AI Settings", self.show_windows["AI Settings"])
self.show_windows["AI Settings"] = bool(opened) self.show_windows["AI Settings"] = bool(opened)
@@ -1762,18 +1759,10 @@ class App:
imgui.end_table() imgui.end_table()
rem_y = imgui.get_content_region_avail().y - 80 rem_y = imgui.get_content_region_avail().y - 80
if self._tool_list_open and self._bias_list_open: if self._tool_list_open and self._bias_list_open: h1, h2 = rem_y * self._tool_split_v, rem_y - (rem_y * self._tool_split_v) - 10
h1, h2 = rem_y * self._tool_split_v, rem_y - (rem_y * self._tool_split_v) - 10 elif self._tool_list_open: h1, h2 = rem_y, 0
h1 = min(h1, max(200, rem_y * 0.3)) elif self._bias_list_open: h1, h2 = 0, rem_y
h2 = min(h2, max(150, rem_y * 0.5)) else: h1, h2 = 0, 0
elif self._tool_list_open:
h1 = min(rem_y, 400)
h2 = 0
elif self._bias_list_open:
h1 = 0
h2 = min(rem_y, 400)
else:
h1, h2 = 0, 0
imgui.dummy(imgui.ImVec2(0, 4)) imgui.dummy(imgui.ImVec2(0, 4))
opened_t = imgui.collapsing_header("Categories & Tools", imgui.TreeNodeFlags_.default_open) opened_t = imgui.collapsing_header("Categories & Tools", imgui.TreeNodeFlags_.default_open)
@@ -1800,11 +1789,11 @@ class App:
if tool: curr_cat_tools.remove(tool) if tool: curr_cat_tools.remove(tool)
imgui.same_line(); imgui.same_line();
if imgui.radio_button(f"Auto##{cat_name}_{tool_name}", mode == "auto"): if imgui.radio_button(f"Auto##{cat_name}_{tool_name}", mode == "auto"):
if not tool: tool = models.Tool(name=tool_name, approval="auto"); curr_cat_tools.append(tool) if not tool: tool = models.Tool(name=tool_name, approval="auto"); current_cat_tools.append(tool)
else: tool.approval = "auto" else: tool.approval = "auto"
imgui.same_line(); imgui.same_line();
if imgui.radio_button(f"Ask##{cat_name}_{tool_name}", mode == "ask"): if imgui.radio_button(f"Ask##{cat_name}_{tool_name}", mode == "ask"):
if not tool: tool = models.Tool(name=tool_name, approval="ask"); curr_cat_tools.append(tool) if not tool: tool = models.Tool(name=tool_name, approval="ask"); current_cat_tools.append(tool)
else: tool.approval = "ask" else: tool.approval = "ask"
imgui.end_table() imgui.end_table()
imgui.tree_pop() imgui.tree_pop()
@@ -1857,9 +1846,9 @@ class App:
imgui.end_table() imgui.end_table()
imgui.tree_pop() imgui.tree_pop()
imgui.end_child() imgui.end_child()
if self._bias_cats_open: if self._bias_cats_open:
imgui.button("###bias_splitter", imgui.ImVec2(-1, 4)) 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)) 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) 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 opened_bc != self._bias_cats_open: self._bias_cats_open = opened_bc
@@ -1963,8 +1952,6 @@ class App:
elif self._persona_models_open: h1, h2 = rem_y, 0 elif self._persona_models_open: h1, h2 = rem_y, 0
elif self._persona_prompt_open: h1, h2 = 0, rem_y elif self._persona_prompt_open: h1, h2 = 0, rem_y
else: h1, h2 = 0, 0 else: h1, h2 = 0, 0
h1 = min(h1, 300)
h2 = min(h2, 300)
imgui.dummy(imgui.ImVec2(0, 4)) imgui.dummy(imgui.ImVec2(0, 4))
opened_models = imgui.collapsing_header("Preferred Models", imgui.TreeNodeFlags_.default_open) opened_models = imgui.collapsing_header("Preferred Models", imgui.TreeNodeFlags_.default_open)
@@ -2009,7 +1996,7 @@ class App:
imgui.pop_id() imgui.pop_id()
for i in reversed(to_remove): self._editing_persona_preferred_models_list.pop(i) for i in reversed(to_remove): self._editing_persona_preferred_models_list.pop(i)
imgui.end_child() imgui.end_child()
if self._persona_models_open and self._persona_prompt_open: if self._persona_prompt_open:
imgui.button("###persona_splitter", imgui.ImVec2(-1, 4)) imgui.button("###persona_splitter", imgui.ImVec2(-1, 4))
if imgui.is_item_active(): self._persona_split_v = max(0.1, min(0.9, self._persona_split_v + imgui.get_io().mouse_delta.y / rem_y)) if imgui.is_item_active(): self._persona_split_v = max(0.1, min(0.9, self._persona_split_v + imgui.get_io().mouse_delta.y / rem_y))
@@ -2933,7 +2920,7 @@ def hello():
r.destroy() r.destroy()
if d: self.ui_files_base_dir = d if d: self.ui_files_base_dir = d
imgui.separator() imgui.separator()
imgui.begin_child("f_paths", imgui.ImVec2(0, min(len(self.files) * 30 + 50, 300)), True) imgui.begin_child("f_paths", imgui.ImVec2(0, -40), True)
if imgui.begin_table("files_table", 4, imgui.TableFlags_.resizable | imgui.TableFlags_.borders): if imgui.begin_table("files_table", 4, imgui.TableFlags_.resizable | imgui.TableFlags_.borders):
imgui.table_setup_column("Actions", imgui.TableColumnFlags_.width_fixed, 40) imgui.table_setup_column("Actions", imgui.TableColumnFlags_.width_fixed, 40)
imgui.table_setup_column("File Path", imgui.TableColumnFlags_.width_stretch) imgui.table_setup_column("File Path", imgui.TableColumnFlags_.width_stretch)
@@ -3006,7 +2993,7 @@ def hello():
r.destroy() r.destroy()
if d: self.ui_shots_base_dir = d if d: self.ui_shots_base_dir = d
imgui.separator() imgui.separator()
imgui.begin_child("s_paths", imgui.ImVec2(0, min(len(self.screenshots) * 30 + 50, 300)), True) imgui.begin_child("s_paths", imgui.ImVec2(0, -40), True)
for i, s in enumerate(self.screenshots): for i, s in enumerate(self.screenshots):
if imgui.button(f"x##s{i}"): if imgui.button(f"x##s{i}"):
self.screenshots.pop(i) self.screenshots.pop(i)