Private
Public Access
0
0

chore(conductor): Add new track 'text_viewer_and_tool_call_fixes_20260601'

This commit is contained in:
2026-06-01 23:46:05 -04:00
parent 6f733a64fa
commit b33a213697
9 changed files with 156 additions and 27 deletions
+6 -2
View File
@@ -3022,6 +3022,8 @@ class AppController:
if "context_snapshot" in disc_data:
snapshot_data = disc_data["context_snapshot"]
self.context_files = [models.FileItem.from_dict(f) if isinstance(f, dict) else models.FileItem(path=str(f)) for f in snapshot_data]
if self._app:
self._app.ui_selected_context_files = {f.path for f in self.context_files if f.auto_aggregate}
self.ai_status = f"discussion: {name}"
def _flush_disc_entries_to_project(self) -> None:
@@ -3050,9 +3052,11 @@ class AppController:
if name in discussions:
self.ai_status = f"discussion '{name}' already exists"
return
discussions[name] = project_manager.default_discussion()
new_disc = project_manager.default_discussion()
# Inherit context from current session if available
if self.context_files:
discussions[name]["context_snapshot"] = [f.to_dict() for f in self.context_files]
new_disc["context_snapshot"] = [f.to_dict() if hasattr(f, 'to_dict') else f for f in self.context_files]
discussions[name] = new_disc
self._switch_discussion(name)
def _branch_discussion(self, index: int) -> None:
+63 -3
View File
@@ -192,12 +192,17 @@ class App:
self.context_preview_text = ""
self.ui_separate_context_preview = False
self.ui_active_context_preset = ""
self.ui_new_context_preset_name = ""
self.target_context_preset_name = ""
self.show_empty_context_modal = False
self._pending_generation_action = None # 'generate' or 'md_only'
self._pending_save_ctx_click = False
self._pending_save_anyway_click = False
self.show_missing_files_modal = False
self.missing_context_files = []
self.target_context_preset_name = ""
self.show_empty_context_warning_modal = False
self._pending_proceed_generate = False
self._pending_proceed_md_only = False
self._new_preset_name = ""
self._editing_preset_name = ""
self._editing_preset_system_prompt = ""
@@ -454,6 +459,20 @@ class App:
else:
object.__setattr__(self, name, value)
def _handle_generate_send(self) -> None:
if not self.ui_selected_context_files and not getattr(self, "_pending_proceed_generate", False):
self.show_empty_context_warning_modal = True
else:
self._pending_proceed_generate = False
self.controller._handle_generate_send()
def _handle_md_only(self) -> None:
if not self.ui_selected_context_files and not getattr(self, "_pending_proceed_md_only", False):
self.show_empty_context_warning_modal = True
else:
self._pending_proceed_md_only = False
self.controller._handle_md_only()
@property
def current_provider(self) -> str:
return self.controller.current_provider
@@ -5418,7 +5437,45 @@ def render_mma_focus_selector(app: App) -> None:
#endregion: MMA
def render_empty_context_modal(app: App) -> None:
if app.show_empty_context_modal:
imgui.open_popup("Empty Context Warning")
app.show_empty_context_modal = False
if imgui.begin_popup_modal("Empty Context Warning", True, imgui.WindowFlags_.always_auto_resize)[0]:
imgui.text_colored(imgui.ImVec4(1.0, 1.0, 0.0, 1.0), "WARNING: Empty Context Composition")
imgui.text("You are attempting to generate a response without any files selected.")
imgui.text("This may result in poor AI performance or loss of project context.")
imgui.separator()
if imgui.button("Proceed Anyway", imgui.ImVec2(150, 0)):
if app._pending_generation_action == 'generate': app.controller._handle_generate_send()
elif app._pending_generation_action == 'md_only': app.controller._handle_md_only()
imgui.close_current_popup()
imgui.same_line()
if imgui.button("Cancel", imgui.ImVec2(120, 0)):
imgui.close_current_popup()
imgui.end_popup()
def render_context_modals(app: App) -> None:
render_empty_context_modal(app)
if app.show_empty_context_warning_modal:
imgui.open_popup("Empty Context Warning")
app.show_empty_context_warning_modal = False
if imgui.begin_popup_modal("Empty Context Warning", True, imgui.WindowFlags_.always_auto_resize)[0]:
imgui.text_colored(imgui.ImVec4(1.0, 1.0, 0.0, 1.0), "WARNING: Empty Context Composition")
imgui.text("You are attempting to generate a response without any files selected.")
imgui.text("This may result in poor AI performance or loss of project context.")
imgui.separator()
if imgui.button("Proceed Anyway", imgui.ImVec2(150, 0)):
if app._empty_context_target_action == 'generate': app.controller._handle_generate_send()
elif app._empty_context_target_action == 'md_only': app.controller._handle_md_only()
imgui.close_current_popup()
imgui.same_line()
if imgui.button("Cancel", imgui.ImVec2(120, 0)):
imgui.close_current_popup()
imgui.end_popup()
if app.show_missing_files_modal:
imgui.open_popup("Missing Files Warning")
app.show_missing_files_modal = False
@@ -5464,10 +5521,10 @@ def _get_context_composition_state(app: App) -> tuple:
for f in app.context_files:
p = f.path if hasattr(f, 'path') else str(f)
vm = f.view_mode if hasattr(f, 'view_mode') else 'summary'
sel = f.selected if hasattr(f, 'selected') else False
agg = f.auto_aggregate if hasattr(f, 'auto_aggregate') else False
slc = tuple((s.get('start_line'), s.get('end_line'), s.get('tag'), s.get('comment')) for s in getattr(f, 'custom_slices', []))
mask = tuple(sorted(getattr(f, 'ast_mask', {}).items()))
files_state.append((p, vm, sel, slc, mask))
files_state.append((p, vm, agg, slc, mask))
screenshots_state = tuple(app.screenshots)
return (tuple(files_state), screenshots_state)
@@ -5475,6 +5532,9 @@ def _check_auto_refresh_context_preview(app: App) -> None:
current_state = _get_context_composition_state(app)
if not hasattr(app, "_last_context_preview_state") or app._last_context_preview_state != current_state:
app._last_context_preview_state = current_state
if not any(getattr(f, 'auto_aggregate', False) for f in app.context_files) and not app.screenshots:
app.context_preview_text = "# Context Composition Empty\n\nNo files or screenshots have been selected for aggregation."
return
try:
app.controller.context_files = app.context_files
res = app.controller._do_generate()