option to close panels, menu bar ribbon

This commit is contained in:
2026-02-22 00:14:18 -05:00
parent 0cccaf05a3
commit 7a32a5138f
3 changed files with 42 additions and 14 deletions

49
gui.py
View File

@@ -281,7 +281,7 @@ class ConfirmDialog:
label=f"Approve PowerShell Command #{self._uid}",
tag=self._tag,
modal=True,
no_close=True,
no_close=False,
pos=(px, py),
width=w,
height=h,
@@ -399,6 +399,22 @@ class App:
self.last_file_items: list = []
self.send_thread: threading.Thread | None = None
self.models_thread: threading.Thread | None = None
self.window_info = {
"Projects": "win_projects",
"Files": "win_files",
"Screenshots": "win_screenshots",
"Discussion History": "win_discussion",
"Provider": "win_provider",
"Message": "win_message",
"Response": "win_response",
"Tool Calls": "win_tool_log",
"Comms History": "win_comms",
"System Prompts": "win_system_prompts",
"Theme": "win_theme",
"Last Script Output": "win_script_output",
"Text Viewer": "win_text_viewer",
}
self._pending_dialog: ConfirmDialog | None = None
self._pending_dialog_lock = threading.Lock()
@@ -1509,7 +1525,7 @@ class App:
pos=(416, 516),
width=400,
height=280,
no_close=True,
no_close=False,
):
dpg.add_text("Palette")
dpg.add_combo(
@@ -1554,6 +1570,15 @@ class App:
)
def _build_ui(self):
with dpg.viewport_menu_bar():
with dpg.menu(label="Windows"):
for label, tag in self.window_info.items():
dpg.add_menu_item(label=label, callback=lambda s, a, u: dpg.show_item(u), user_data=tag)
with dpg.menu(label="Project"):
dpg.add_menu_item(label="Save All", callback=self.cb_save_config)
dpg.add_menu_item(label="Reset Session", callback=self.cb_reset_session)
dpg.add_menu_item(label="Generate MD Only", callback=self.cb_md_only)
# ---- Projects panel ----
with dpg.window(
@@ -1562,7 +1587,7 @@ class App:
pos=(8, 8),
width=400,
height=380,
no_close=True,
no_close=False,
):
proj_meta = self.project.get("project", {})
proj_name = proj_meta.get("name", Path(self.active_project_path).stem)
@@ -1616,7 +1641,7 @@ class App:
pos=(8, 396),
width=400,
height=360,
no_close=True,
no_close=False,
):
dpg.add_text("Base Dir")
with dpg.group(horizontal=True):
@@ -1644,7 +1669,7 @@ class App:
pos=(416, 8),
width=400,
height=500,
no_close=True,
no_close=False,
):
dpg.add_text("Base Dir")
with dpg.group(horizontal=True):
@@ -1671,7 +1696,7 @@ class App:
pos=(824, 8),
width=420,
height=600,
no_close=True,
no_close=False,
):
# Discussion selector section
with dpg.collapsing_header(label="Discussions", default_open=True):
@@ -1714,7 +1739,7 @@ class App:
pos=(1252, 8),
width=420,
height=260,
no_close=True,
no_close=False,
):
dpg.add_text("Provider")
dpg.add_combo(
@@ -1744,7 +1769,7 @@ class App:
pos=(1252, 276),
width=420,
height=280,
no_close=True,
no_close=False,
):
dpg.add_input_text(
tag="ai_input",
@@ -1766,7 +1791,7 @@ class App:
pos=(1252, 564),
width=420,
height=300,
no_close=True,
no_close=False,
):
dpg.add_input_text(
tag="ai_response",
@@ -1787,7 +1812,7 @@ class App:
pos=(1252, 872),
width=420,
height=300,
no_close=True,
no_close=False,
):
with dpg.group(horizontal=True):
dpg.add_text("Tool call history")
@@ -1803,7 +1828,7 @@ class App:
pos=(1680, 8),
width=520,
height=1164,
no_close=True,
no_close=False,
):
with dpg.group(horizontal=True):
dpg.add_text("Status: idle", tag="ai_status", color=(200, 220, 160))
@@ -1829,7 +1854,7 @@ class App:
pos=(416, 804),
width=400,
height=300,
no_close=True,
no_close=False,
):
dpg.add_text("Global System Prompt (all projects)")
dpg.add_input_text(