enhancement
major
minor
major
minor
major
#29608
TL Views: value-input with a placeholder, accessible name when the label is hidden, conditional display of elements using visible-if
Problem
Discovered while implementing a ticket search in the app bar: a <value-input type="tl.core:String" value="ticketSearch"> with an <on-submit> chain in the <children> of the <app-bar>.
- No placeholder. <value-input> supports label and label-position, but not a placeholder. A search field that states its purpose within the field itself—the standard form in an app bar—cannot be declared.
- `hide-label` leaves the field without an accessible name. With ` label-position="hide-label"`, neither a visible label nor an `aria-label` is rendered; the input field has no name for assistive technology.
- An element cannot be conditionally displayed at full size without a container. Only a command has an <executability>; an element has no visibility rule. The only declarative conditional display, <switch>, renders a container with width: 100%; height: 100%: inline in the app bar, it occupies 823 out of 1600 px and squeezes the breadcrumb and account display together. A search field intended only for logged-in sessions must therefore also be displayed to anonymous sessions.
Solution
Placeholder. The placeholder is a property of the field description (FieldSpec) and is assigned to the generated input control at a single point. This allows any page that creates a field to provide a placeholder without each control having to wire it in individually. It is declared as <value-input placeholder="…"> (multilingual text). It is displayed for both text and numeric input.
Accessible name when the label is hidden. If the label is hidden, the field border wraps the input with a <label> element, whose text is visually hidden but available to assistive technology. The field receives its name via HTML’s built-in assignment—which applies to every input control at once—and clicking on the area places the focus in the input field. To prevent a <label> from being nested within another <label>, the radio button representation of a Boolean value names its options using `id` and `for` instead of wrapping them.
Conditional display. The deck abandons its fixed size of 100% and follows the fill contract: it fills its container as long as the displayed content fills it, and otherwise grows with its content. Inline—such as in the app bar—it thus takes up only the space its content requires. Additionally, there is the element <visible-if expr="…" input="…">: it displays its content as long as the TL script predicate is true based on the value of the input channel, and nothing else—the shorthand for a single condition that previously had to be written as a `<switch> ` with a `<case>`.
The end of the fill chain. The body of a <panel> and the <inset> are the boxes where the fill chain ends, but they were not flex containers: content that wanted to fill them could not resolve its height there and fell back to its content height. As long as the deck strictly enforced its 100%, this wasn’t noticeable. Both are now the described limited flex column: content that fills takes the available height, content with its own size retains it, and the panel scrolls whatever doesn’t fit. This means that a document or PDF viewer and a tab bar also fill their space within a tile’s body—which was not the case before.
Not part of this ticket: the display of a visible field label on the colored background of the app bar.