diff --git a/src/gui_2.py b/src/gui_2.py index 230d7b3a..bcc51b93 100644 --- a/src/gui_2.py +++ b/src/gui_2.py @@ -454,6 +454,8 @@ class App: self._slice_sel_start = -1 self._slice_sel_end = -1 self.context_files = [] + self.ui_synthesis_prompt: str = "" + self.ui_synthesis_selected_takes: dict[str, bool] = {} # --- Rendering & Theme State --- self.perf_show_graphs: dict[str, bool] = {} self.ui_crt_filter = False @@ -3998,8 +4000,8 @@ def render_synthesis_panel(app: App) -> None: """ imgui.text("Select takes to synthesize:") discussions = app.project.get('discussion', {}).get('discussions', {}) - if not hasattr(app, 'ui_synthesis_selected_takes'): app.ui_synthesis_selected_takes = {name: False for name in discussions} - if not hasattr(app, 'ui_synthesis_prompt'): app.ui_synthesis_prompt = "" + if not isinstance(getattr(app, 'ui_synthesis_selected_takes', None), dict): app.ui_synthesis_selected_takes = {name: False for name in discussions} + if not isinstance(getattr(app, 'ui_synthesis_prompt', None), str): app.ui_synthesis_prompt = "" for name in discussions: _, app.ui_synthesis_selected_takes[name] = imgui.checkbox(name, app.ui_synthesis_selected_takes.get(name, False)) imgui.spacing() imgui.text("Synthesis Prompt:") @@ -4134,9 +4136,9 @@ def render_takes_panel(app: App) -> None: imgui.text("Takes & Synthesis") imgui.separator() discussions = app.project.get('discussion', {}).get('discussions', {}) - if not hasattr(app, 'ui_synthesis_selected_takes'): + if not isinstance(getattr(app, 'ui_synthesis_selected_takes', None), dict): app.ui_synthesis_selected_takes = {name: False for name in discussions} - if not hasattr(app, 'ui_synthesis_prompt'): + if not isinstance(getattr(app, 'ui_synthesis_prompt', None), str): app.ui_synthesis_prompt = "" if imgui.begin_table("takes_table", 3, imgui.TableFlags_.resizable | imgui.TableFlags_.borders): imgui.table_setup_column("Name", imgui.TableColumnFlags_.width_stretch)