This commit is contained in:
2026-01-11 00:39:17 -08:00
parent 13caa8d5fa
commit 6eb02f22b5
9 changed files with 736 additions and 40 deletions

57
TUI.py
View File

@@ -455,6 +455,7 @@ class PipelineHubApp(App):
yield Button("Tags", id="tags-button")
yield Button("Metadata", id="metadata-button")
yield Button("Relationships", id="relationships-button")
yield Button("Config", id="config-button")
yield Static("Ready", id="status-panel")
yield OptionList(id="cmd-suggestions")
@@ -514,6 +515,9 @@ class PipelineHubApp(App):
self.refresh_workers()
if self.command_input:
self.command_input.focus()
# Run startup check automatically
self._run_pipeline_background(".status")
# ------------------------------------------------------------------
# Actions
@@ -547,6 +551,12 @@ class PipelineHubApp(App):
self.notify("Enter a pipeline to run", severity="warning", timeout=3)
return
# Special interception for .config
if pipeline_text.lower().strip() == ".config":
self._open_config_popup()
self.command_input.value = ""
return
pipeline_text = self._apply_store_path_and_tags(pipeline_text)
self._pipeline_running = True
@@ -593,6 +603,47 @@ class PipelineHubApp(App):
self._open_metadata_popup()
elif event.button.id == "relationships-button":
self._open_relationships_popup()
elif event.button.id == "config-button":
self._open_config_popup()
def _open_config_popup(self) -> None:
from TUI.modalscreen.config_modal import ConfigModal
self.push_screen(ConfigModal(), callback=self.on_config_closed)
def on_config_closed(self, result: Any = None) -> None:
"""Call when the config modal is dismissed to reload session data."""
try:
from SYS.config import load_config
from cmdlet._shared import SharedArgs
# Force a fresh load from disk
cfg = load_config()
# Clear UI state to show a "fresh" start
self._clear_results()
self._clear_log()
self._append_log_line(">>> RESTARTING SESSION (Config updated)")
self._set_status("Reloading config…", level="info")
# Clear shared caches (especially store selection choices)
SharedArgs._refresh_store_choices_cache(cfg)
# Update the global SharedArgs choices so cmdlets pick up new stores
SharedArgs.STORE.choices = SharedArgs.get_store_choices(cfg, force=True)
# Re-build our local dropdown
self._populate_store_options()
# Reload cmdlet names (in case new ones were added or indexed)
self._load_cmdlet_names(force=True)
# Optionally update executor config if needed
self.executor._config_loader.load()
self.notify("Configuration reloaded")
# Use the existing background runner to show the status table
# This will append the IGNITIO table to the logs/results
self._run_pipeline_background(".status")
except Exception as exc:
self.notify(f"Error refreshing config: {exc}", severity="error")
def on_input_submitted(self, event: Input.Submitted) -> None:
if event.input.id == "pipeline-input":
@@ -886,10 +937,10 @@ class PipelineHubApp(App):
except Exception:
pass
def _load_cmdlet_names(self) -> None:
def _load_cmdlet_names(self, force: bool = False) -> None:
try:
ensure_registry_loaded()
names = list_cmdlet_names() or []
ensure_registry_loaded(force=force)
names = list_cmdlet_names(force=force) or []
self._cmdlet_names = sorted(
{str(n).replace("_",
"-")