enhancement
major
minor
defect
critical
major
minor
major
#30266
React Configuration Editor: Multi-line text (HTML, Markdown, code, multi-line) uses the entire line by default
Context
In the React interface’s configuration editor (e.g., in the View Designer and in forms using <config-form>), the properties of a configuration are displayed in a multi-column grid. So far, a field only takes up the full width if the property or its value type is annotated with @RenderWholeLine. Fields with multi-line text—internationalized HTML, HTML source code, Markdown (@CommonMark), code (@Code), and multi-line text (@MultiLine)—are therefore displayed in a narrow column of the grid and are difficult to edit.
The classic configuration editor, on the other hand, allocates the entire line to any internationalized text (ResKey, HtmlResKey); model-based forms also display multi-line text (@MultiLine) across the entire line.
Behavior
- By default, a field whose text spans multiple lines takes up the entire line in the React configuration editor: @Html, @CommonMark, @Code, and @MultiLine—each as both plain and internationalized text—as well as the WYSIWYG editor, the code editor, and the TL Script editor.
- Single-line internationalized text remains within the grid: In React, it is edited as a single input field in the user’s language (other languages are accessible via a dialog) and does not require the entire line.
- An explicit @RenderWholeLine annotation (including @RenderWholeLine(false)) still takes precedence.
- Properties of type HtmlResKey (e.g., the description of “Internationalized”) are edited per language as internationalized HTML text (using the WYSIWYG editor, without displaying it as HTML source code per language) and displayed across the entire line. Previously, they were displayed as a single-line text field containing the encoded key.
Technical Notes
- Whether a field requires the entire line is determined by the provider that generates the input field: ConfigControlProvider#rendersWholeLine(ConfigFieldModel) or ConfigAnnotationControlProvider#rendersWholeLine(ConfigFieldModel, A), default value false —analogous to FieldProvider.renderWholeLine() in model-based forms. Similarly, a module that replaces an editor (WYSIWYG, code editor) makes this decision for its own editor. ConfigControlService#rendersWholeLine(ConfigFieldModel) queries the same provider used by createControl; ConfigEditorControl uses it if no @RenderWholeLine annotation is present.
- HtmlResKey: Format mapping for DefaultHtmlResKey$ValueFormat to I18NHtmlFormatProvider (configedit) or I18NHtmlWysiwygFormatProvider (react.wysiwyg). The conversion between HtmlResKey and ResKey is handled by the general adapter MappedFieldModel (com.top_logic.layout.react). ConfigControlService#isEditedInField (#30223) determines whether such a property appears in the form with its own translations.
Migration
Only for applications with their own ` ConfigAnnotationControlProvider ` (React configuration editor): A provider no longer rejects a property by returning `null` from `createControl(...)`, but rather via the ` accepts(ConfigFieldModel model, A annotation)` method. createControl is now called only for accepted properties and must not return null. The previous condition for returning null is moved to an override of accepts (e.g., return ConfigControlService.holdsText(model);). If the generated input field is to occupy the entire line (multi-line content), additionally override rendersWholeLine(ConfigFieldModel, A) with true.