refactor(paths): v3 design - explicit initialize_paths + frozen PathsConfig singleton

This commit is contained in:
ed
2026-06-19 09:40:01 -04:00
parent 3fb9f9ff8e
commit 327b388800
11 changed files with 338 additions and 251 deletions
+9 -2
View File
@@ -1311,7 +1311,7 @@ class App:
cfg_path = paths.get_config_path()
if cfg_path.exists(): shutil.copy(cfg_path, str(cfg_path) + ".bak")
self.save_config()
paths.reset_resolved()
paths.initialize_paths(cfg_path)
self.init_state()
self.ai_status = 'paths applied and session reset'
@@ -2341,10 +2341,17 @@ def render_paths_panel(app: App) -> None:
render_path_field("Logs Directory", "ui_logs_dir", "logs_dir", "Directory where session JSON-L logs and artifacts are stored.")
render_path_field("Scripts Directory", "ui_scripts_dir", "scripts_dir", "Directory for AI-generated PowerShell scripts.")
imgui.separator()
if imgui.button("Apply", imgui.ImVec2(120, 0)): app._save_paths()
imgui.same_line()
if imgui.button("Refresh Paths", imgui.ImVec2(140, 0)):
paths.initialize_paths(paths.get_config_path())
app.init_state()
app.ai_status = "paths reloaded from config.toml"
if imgui.is_item_hovered():
imgui.set_tooltip("Re-read [paths] section from config.toml and rebuild the PathsConfig singleton. Use after editing config.toml directly or after importing a new config.")
imgui.same_line()
if imgui.button("Reset", imgui.ImVec2(120, 0)):
app.init_state()
app.ai_status = "paths reset to defaults"