Follow-up to #492 (see the summary comment there for the full behavior audit).
Current behavior
Dialog(enable=...) is parsed in setUIInfo() (parser.ts:767-778) into instance.enable. In
Component.getInputs(), a literal enable=false blanks the component's childInputs
(parser.ts:896-899: this.enable === false || this.deadEnd), making its compositional elements
unreachable in the instance tree — while an enable expression that evaluates to false does not
(the check is strict === false). Note the component's type is already fully and recursively parsed
either way (parser.ts:893, 935-938); only the inputs reference lists are severed.
This breaks the recommended templates pattern
(https://lbl-srg.github.io/modelica-buildings-templates/guide/#subrecord-with-configuration-parameters),
where the cfg instance inside each parameter record is annotated Dialog(enable=false) and its
parameters are referenced by enable expressions and bindings throughout the record (e.g. 101
cfg.* references in Plants/HeatPumps/Components/Data/Controller). Client-side resolution walks
the inputs/options arrays (client interpreter.ts:147-155, 274-276), so severed lists mean those
expressions resolve to null.
Proposed change
Make Dialog(enable=...) a pure UI feature, consistent for literals and expressions:
- Parser: stop blanking
childInputs on enable === false (parser.ts:897). The class instantiated
with this annotation is fully parsed (already the case today) and childInputs fully populated.
Keep enable on the emitted entry.
- Client: implement display propagation in the instance tree — if any parent instance is disabled,
its children must not be displayed. Today getOptionInstance (interpreter.ts:1225-1236) computes
display per option in isolation; without the propagation rule, previously hidden parameters
(e.g. record cfg members) would start rendering. This is a prerequisite for the parser change,
not a follow-up. It must operate on the instance tree, since the same class can be reachable via
both a disabled and an enabled instance path.
schedule.ts keeps reading component.enable into the schedule attributes (schedule.ts:446-453) —
unchanged.
Follow-up to #492 (see the summary comment there for the full behavior audit).
Current behavior
Dialog(enable=...)is parsed insetUIInfo()(parser.ts:767-778) intoinstance.enable. InComponent.getInputs(), a literalenable=falseblanks the component'schildInputs(parser.ts:896-899:
this.enable === false || this.deadEnd), making its compositional elementsunreachable in the instance tree — while an enable expression that evaluates to false does not
(the check is strict
=== false). Note the component's type is already fully and recursively parsedeither way (parser.ts:893, 935-938); only the
inputsreference lists are severed.This breaks the recommended templates pattern
(https://lbl-srg.github.io/modelica-buildings-templates/guide/#subrecord-with-configuration-parameters),
where the
cfginstance inside each parameter record is annotatedDialog(enable=false)and itsparameters are referenced by
enableexpressions and bindings throughout the record (e.g. 101cfg.*references inPlants/HeatPumps/Components/Data/Controller). Client-side resolution walksthe
inputs/optionsarrays (client interpreter.ts:147-155, 274-276), so severed lists mean thoseexpressions resolve to null.
Proposed change
Make
Dialog(enable=...)a pure UI feature, consistent for literals and expressions:childInputsonenable === false(parser.ts:897). The class instantiatedwith this annotation is fully parsed (already the case today) and
childInputsfully populated.Keep
enableon the emitted entry.its children must not be displayed. Today
getOptionInstance(interpreter.ts:1225-1236) computesdisplayper option in isolation; without the propagation rule, previously hidden parameters(e.g. record
cfgmembers) would start rendering. This is a prerequisite for the parser change,not a follow-up. It must operate on the instance tree, since the same class can be reachable via
both a disabled and an enabled instance path.
schedule.tskeeps readingcomponent.enableinto the schedule attributes (schedule.ts:446-453) —unchanged.