From 3ef3bca340647b454d5c5214f0b8d9a028380b30 Mon Sep 17 00:00:00 2001 From: Nose Date: Fri, 23 Jan 2026 14:11:09 -0800 Subject: [PATCH] m --- SYS/config.py | 23 ----------------------- TUI/modalscreen/config_modal.py | 7 ++----- 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/SYS/config.py b/SYS/config.py index 34f120e..9dd21d4 100644 --- a/SYS/config.py +++ b/SYS/config.py @@ -354,19 +354,6 @@ def reload_config( return load_config(config_dir=config_dir, filename=filename) -def _validate_config_safety(config: Dict[str, Any]) -> None: - """Validate configuration safety. - - Folder store validation has been removed because the folder store backend - is no longer supported. - """ - return - - -def _serialize_conf(config: Dict[str, Any]) -> str: - """Serialize configuration to a string for legacy .conf files.""" - return json.dumps(config, indent=4) - def save_config( config: Dict[str, Any], @@ -405,16 +392,6 @@ def save_config( except Exception as e: log(f"Failed to save config to database: {e}") - # 2. Legacy fallback: write to .conf for now (optional, but keep for backward compat for a bit) - if config_path.suffix.lower() == ".conf": - # Safety Check: placeholder (folder store validation removed) - _validate_config_safety(config) - - try: - config_path.write_text(_serialize_conf(config), encoding="utf-8") - except OSError as exc: - log(f"Failed to write legacy config to {config_path}: {exc}") - cache_key = _make_cache_key(config_dir, filename, config_path) _CONFIG_CACHE[cache_key] = config diff --git a/TUI/modalscreen/config_modal.py b/TUI/modalscreen/config_modal.py index f46a109..508bd09 100644 --- a/TUI/modalscreen/config_modal.py +++ b/TUI/modalscreen/config_modal.py @@ -5,7 +5,6 @@ from textual.widgets import Static, Button, Input, Label, ListView, ListItem, Ru from textual import on, work from typing import Any -from pathlib import Path from SYS.config import load_config, save_config, global_config from Store.registry import _discover_store_classes, _required_keys_for from ProviderCore.registry import list_providers @@ -111,12 +110,10 @@ class ConfigModal(ModalScreen): def __init__(self) -> None: super().__init__() # Load config from the workspace root (parent of SYS) - workspace_root = Path(__file__).resolve().parent.parent.parent - self.config_data = load_config(config_dir=workspace_root) + self.config_data = load_config() self.current_category = "globals" self.editing_item_type = None # 'store' or 'provider' self.editing_item_name = None - self.workspace_root = workspace_root self._button_id_map = {} self._input_id_map = {} @@ -738,7 +735,7 @@ class ConfigModal(ModalScreen): self._update_config_value(event.select.id, event.value) def save_all(self) -> None: - save_config(self.config_data, config_dir=self.workspace_root) + save_config(self.config_data) def validate_current_editor(self) -> bool: """Ensure all required fields for the current item are filled."""