#110099Resolve EXT:form variants lazily per step
Description
Today, applying a rendering variant changes the renderable directly: label,
rendering options, properties, default value and validators are overwritten the
moment variants are processed. Because variant application uses merge semantics
and is never reverted, the base state of a renderable is lost once a variant has
been applied.
In a multi-step form this is a real limitation. A variant condition may evaluate
differently depending on the current step (e.g. values submitted on a previous
step). Since the original state is already gone, the variant outcome cannot be
re-evaluated reliably for each step. The effective state of an element therefore
depends on the order and number of times variants were processed, which is hard
to reason about and error prone.
Idea
Treat variants as a declarative overlay on top of an immutable base state
instead of a destructive mutation.
- The base state of a renderable stays untouched with respect to variants.
- The form runtime sets a request-scoped variant context for the step that is
currently being rendered/processed.
- The renderable getters resolve the effective value on demand: they overlay the
patches of all variants whose condition matches the current context on top of
the base value.
This way the same renderable can produce different effective values for
different steps without ever losing its base definition, and the result is fully
determined by the current context rather than by side effects of earlier
processing.
Reviews 1
History 010
-
Gerrit Code Review pushed patch set 4 for main to change 94572 status
NewUnder Review <span data-processor="relativetime" data-value="2026-06-24T18:57:53+00:00" > 06/24/26, 18:57 </span> -
Gerrit Code Review pushed patch set 5 for main to change 94572 <span data-processor="relativetime" data-value="2026-06-24T19:06:12+00:00" > 06/24/26, 19:06 </span>
-
Gerrit Code Review pushed patch set 6 for main to change 94572 <span data-processor="relativetime" data-value="2026-06-24T19:07:59+00:00" > 06/24/26, 19:07 </span>
-
Gerrit Code Review pushed patch set 7 for main to change 94572 <span data-processor="relativetime" data-value="2026-06-24T19:35:18+00:00" > 06/24/26, 19:35 </span>
-
Gerrit Code Review pushed patch set 8 for main to change 94572 <span data-processor="relativetime" data-value="2026-06-24T20:42:00+00:00" > 06/24/26, 20:42 </span>
-
Gerrit Code Review pushed patch set 9 for main to change 94572 <span data-processor="relativetime" data-value="2026-06-24T20:58:20+00:00" > 06/24/26, 20:58 </span>
-
Gerrit Code Review pushed patch set 10 for main to change 94572 <span data-processor="relativetime" data-value="2026-07-03T17:02:10+00:00" > 07/03/26, 17:02 </span>
-
Gerrit Code Review pushed patch set 11 for main to change 94572 <span data-processor="relativetime" data-value="2026-09-24T15:25:48+00:00" > 09/24/26, 15:25 </span>
-
Gerrit Code Review pushed patch set 12 for main to change 94572 <span data-processor="relativetime" data-value="2026-09-24T15:49:17+00:00" > 09/24/26, 15:49 </span>
-
Gerrit Code Review pushed patch set 13 for main to change 94572 <span data-processor="relativetime" data-value="2026-09-25T06:33:42+00:00" > 09/25/26, 06:33 </span>