markdown fix but introduces a regresssion...
This commit is contained in:
+37
-43
@@ -3320,40 +3320,37 @@ def render_context_presets(app: App) -> None:
|
||||
app.ui_active_context_preset = ""
|
||||
|
||||
def render_snapshot_tab(app: App) -> None:
|
||||
if imgui.begin_tab_bar("snapshot_tabs"):
|
||||
if imgui.begin_tab_item("Aggregate MD")[0]:
|
||||
display_md = app.last_aggregate_markdown
|
||||
if app.ui_focus_agent:
|
||||
tier_usage = app.mma_tier_usage.get(app.ui_focus_agent)
|
||||
if tier_usage:
|
||||
persona_name = tier_usage.get("persona")
|
||||
if persona_name:
|
||||
persona = app.controller.personas.get(persona_name)
|
||||
if persona and persona.context_preset:
|
||||
cp_name = persona.context_preset
|
||||
if cp_name in app._focus_md_cache:
|
||||
display_md = app._focus_md_cache[cp_name]
|
||||
else:
|
||||
flat = src.project_manager.flat_config(app.controller.project, app.active_discussion)
|
||||
cp = app.controller.project.get('context_presets', {}).get(cp_name)
|
||||
if cp:
|
||||
flat["files"]["paths"] = cp.get("files", [])
|
||||
flat["screenshots"]["paths"] = cp.get("screenshots", [])
|
||||
full_md, _, _ = src.aggregate.run(flat)
|
||||
app._focus_md_cache[cp_name] = full_md
|
||||
display_md = full_md
|
||||
if imgui.button("Copy"): imgui.set_clipboard_text(display_md)
|
||||
imgui.begin_child("last_agg_md", imgui.ImVec2(0, 0), True)
|
||||
markdown_helper.render(display_md, context_id="snapshot_agg")
|
||||
imgui.end_child()
|
||||
imgui.end_tab_item()
|
||||
if imgui.begin_tab_item("System Prompt")[0]:
|
||||
if imgui.button("Copy"): imgui.set_clipboard_text(app.last_resolved_system_prompt)
|
||||
imgui.begin_child("last_sys_prompt", imgui.ImVec2(0, 0), True)
|
||||
markdown_helper.render(app.last_resolved_system_prompt, context_id="snapshot_sys")
|
||||
imgui.end_child()
|
||||
imgui.end_tab_item()
|
||||
imgui.end_tab_bar()
|
||||
with imscope.tab_bar("snapshot_tabs"):
|
||||
with imscope.tab_item("Aggregate MD") as (exp, _):
|
||||
if exp:
|
||||
display_md = app.last_aggregate_markdown
|
||||
if app.ui_focus_agent:
|
||||
tier_usage = app.mma_tier_usage.get(app.ui_focus_agent)
|
||||
if tier_usage:
|
||||
persona_name = tier_usage.get("persona")
|
||||
if persona_name:
|
||||
persona = app.controller.personas.get(persona_name)
|
||||
if persona and persona.context_preset:
|
||||
cp_name = persona.context_preset
|
||||
if cp_name in app._focus_md_cache:
|
||||
display_md = app._focus_md_cache[cp_name]
|
||||
else:
|
||||
flat = src.project_manager.flat_config(app.controller.project, app.active_discussion)
|
||||
cp = app.controller.project.get('context_presets', {}).get(cp_name)
|
||||
if cp:
|
||||
flat["files"]["paths"] = cp.get("files", [])
|
||||
flat["screenshots"]["paths"] = cp.get("screenshots", [])
|
||||
full_md, _, _ = src.aggregate.run(flat)
|
||||
app._focus_md_cache[cp_name] = full_md
|
||||
display_md = full_md
|
||||
if imgui.button("Copy"): imgui.set_clipboard_text(display_md)
|
||||
with imscope.child("last_agg_md", 0, 0, True):
|
||||
markdown_helper.render(display_md, context_id="snapshot_agg")
|
||||
with imscope.tab_item("System Prompt") as (exp, _):
|
||||
if exp:
|
||||
if imgui.button("Copy"): imgui.set_clipboard_text(app.last_resolved_system_prompt)
|
||||
with imscope.child("last_sys_prompt", 0, 0, True):
|
||||
markdown_helper.render(app.last_resolved_system_prompt, context_id="snapshot_sys")
|
||||
|
||||
#endregion: Context Management
|
||||
|
||||
@@ -3375,9 +3372,8 @@ def render_discussion_hub(app: App) -> None:
|
||||
if exp:
|
||||
if imgui.button("Copy to Clipboard"):
|
||||
imgui.set_clipboard_text(app.context_preview_text)
|
||||
imgui.begin_child("ctx_preview_scroll_tab", imgui.ImVec2(0, 0), True)
|
||||
markdown_helper.render(app.context_preview_text, context_id="ctx_preview_tab")
|
||||
imgui.end_child()
|
||||
with imscope.child("ctx_preview_scroll_tab", 0, 0, True):
|
||||
markdown_helper.render(app.context_preview_text, context_id="ctx_preview_tab")
|
||||
with imscope.tab_item("Snapshot") as (exp, opened):
|
||||
if exp: render_snapshot_tab(app)
|
||||
with imscope.tab_item("Takes") as (exp, opened):
|
||||
@@ -4461,9 +4457,8 @@ def render_approve_script_modal(app: App) -> None:
|
||||
|
||||
avail_y = imgui.get_content_region_avail().y - 40 # reserve space for buttons
|
||||
if app.ui_approve_modal_preview:
|
||||
imgui.begin_child("preview_child", imgui.ImVec2(-1, avail_y), True)
|
||||
markdown_helper.render(f"```powershell\n{dlg._script}\n```", context_id="approve_script_preview")
|
||||
imgui.end_child()
|
||||
with imscope.child("preview_child", -1, avail_y, True):
|
||||
markdown_helper.render(f"```powershell\n{dlg._script}\n```", context_id="approve_script_preview")
|
||||
else:
|
||||
ch, dlg._script = imgui.input_text_multiline("##confirm_script", dlg._script, imgui.ImVec2(-1, avail_y))
|
||||
imgui.separator()
|
||||
@@ -5482,7 +5477,6 @@ def render_context_preview_window(app: App) -> None:
|
||||
imgui.same_line()
|
||||
if imgui.button("Copy to Clipboard"):
|
||||
imgui.set_clipboard_text(app.context_preview_text)
|
||||
imgui.begin_child("ctx_preview_scroll", imgui.ImVec2(0, 0), True)
|
||||
markdown_helper.render(app.context_preview_text, context_id="ctx_preview")
|
||||
imgui.end_child()
|
||||
with imscope.child("ctx_preview_scroll", 0, 0, True):
|
||||
markdown_helper.render(app.context_preview_text, context_id="ctx_preview")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user