cog
c49cfa6d - fix: resolve choices= and default= expressions against module-level scope

Commit
12 days ago
fix: resolve choices= and default= expressions against module-level scope The static schema generator (cog-schema-gen) now resolves non-literal expressions in Input(choices=...) and Input(default=...) by looking up module-level variable assignments. This fixes the cog-flux aspect_ratio dropdown regression where choices=list(ASPECT_RATIOS.keys()) was silently dropped, producing a plain text field instead of an enum. Supported patterns: - choices=MY_LIST (identifier referencing a module-level list literal) - choices=list(DICT.keys()) / list(DICT.values()) - choices=expr + expr (concatenation, e.g. list(D.keys()) + ["custom"]) - default=MY_CONSTANT (identifier referencing any module-level literal) Unresolvable choices= expressions now produce a hard error instead of being silently dropped. Adds 19 regression tests.
Author
Parents
Loading