One source for the card column and status tag markup, instead of six
The status tag and the labeled column were written out by hand in six places
across two languages, so a class renamed in cards.css had to be found in six
files, and the surfaces had already drifted apart in small ways.
orchestra_presentation now owns that markup as theme hooks, and every surface
renders them instead of retyping spans:
| Theme hook | Variables |
|---|---|
orchestra_status_tag |
label, classes |
orchestra_lifecycle_marker |
label, classes |
orchestra_card_column |
label, value, classes |
orchestra_card_row |
fields plus the part mapping |
Three things worth reviewing:
PHP builds, Twig prints. No template assembles markup from label/value data
any more. InstanceReadController builds its meta columns and its status column
(through CardColumnsTrait, which it only claimed to use until now), so
orchestra-instance.html.twig is {{ column }} and {{ status }}. The card row
is a theme hook with an initial preprocess that turns a row's fields and the
caller's part mapping into built columns, so the two shipped Views row templates
are one line each and say which field plays which part from their own preprocess.
Everything is overridable. The card row used to be reachable only as a namespaced Twig include, which no theme could override; it is a theme hook now, as are the tag, the marker and the column, so a theme restyles a tag once for every surface.
The status and the state are not bundled. They are separate hooks, and a column shows whatever parts its caller gives it, in that order, so a surface can show an authored status alone, an engine state alone, or one under the other. The pairing stays the caller's decision.
Every class beyond the base one is still passed in by the caller (the status
term's palette, orchestra-task-state--*, orchestra-lifecycle--*), so a
workflow still introduces a tone by naming a class a theme styles.
Tests: a new SharedMarkupTest covers each hook (registered, template on disk,
base class and caller classes in the markup, parts in the order given, and the
row's mapping laying fields out as columns), and each surface now asserts the
rendered orchestra-status-tag rather than a render array's internals.
Docs and the module description updated; no new translatable string.