This commit is contained in:
2026-01-21 22:52:52 -08:00
parent d94e321148
commit 201663bb62
9 changed files with 377 additions and 124 deletions

View File

@@ -379,7 +379,7 @@ class ConfigModal(ModalScreen):
classes = _discover_store_classes()
if stype in classes:
cls = classes[stype]
if hasattr(cls, "config") and callable(cls.config):
if hasattr(cls, "config_schema") and callable(cls.config_schema):
for field_def in cls.config_schema():
k = field_def.get("key")
if k:
@@ -394,7 +394,7 @@ class ConfigModal(ModalScreen):
from ProviderCore.registry import get_provider_class
try:
pcls = get_provider_class(item_name)
if pcls and hasattr(pcls, "config") and callable(pcls.config):
if pcls and hasattr(pcls, "config_schema") and callable(pcls.config_schema):
for field_def in pcls.config_schema():
k = field_def.get("key")
if k:
@@ -665,7 +665,7 @@ class ConfigModal(ModalScreen):
all_classes = _discover_store_classes()
options = []
for stype, cls in all_classes.items():
if hasattr(cls, "config") and callable(cls.config):
if hasattr(cls, "config_schema") and callable(cls.config_schema):
try:
if cls.config_schema():
options.append(stype)
@@ -678,7 +678,7 @@ class ConfigModal(ModalScreen):
from ProviderCore.registry import get_provider_class
for ptype in provider_names:
pcls = get_provider_class(ptype)
if pcls and hasattr(pcls, "config") and callable(pcls.config):
if pcls and hasattr(pcls, "config_schema") and callable(pcls.config_schema):
try:
if pcls.config_schema():
options.append(ptype)
@@ -855,7 +855,7 @@ class ConfigModal(ModalScreen):
if stype in classes:
cls = classes[stype]
# Use schema for defaults if present
if hasattr(cls, "config") and callable(cls.config):
if hasattr(cls, "config_schema") and callable(cls.config_schema):
for field_def in cls.config_schema():
key = field_def.get("key")
if key:
@@ -889,7 +889,7 @@ class ConfigModal(ModalScreen):
new_config = {}
if pcls:
# Use schema for defaults
if hasattr(pcls, "config") and callable(pcls.config):
if hasattr(pcls, "config_schema") and callable(pcls.config_schema):
for field_def in pcls.config_schema():
key = field_def.get("key")
if key:
@@ -987,7 +987,7 @@ class ConfigModal(ModalScreen):
pcls = get_provider_class(item_name)
if pcls:
# Collect required keys from schema
if hasattr(pcls, "config") and callable(pcls.config):
if hasattr(pcls, "config_schema") and callable(pcls.config_schema):
for field_def in pcls.config_schema():
if field_def.get("required"):
k = field_def.get("key")