xuang7 opened a new issue, #7522:
URL: https://github.com/apache/texera/issues/7522
### Feature Summary
Step 4 of the operator-demo video generator: add a controller that fills in
an operator's properties, so the demo shows what a user is expected to enter.
Operator fields are rendered as text boxes, numbers, single and multi-select
dropdowns, toggles, repeated rows, and full code editors, and each needs its
own way of being driven and its own way of being confirmed.
### Proposed Solution or Design
Add a new FormControllerBuilder (plus shared FormHelpers) to the Playwright
layer. Given the sample values for an operator, it fills the property panel
field by field, dispatching on the value's type.
```
new FormControllerBuilder(ctx)
.fillFieldJsonValues(OperatorFieldValues.typedValues(operatorType))
.execute()
```
**Locating a field**: Fields are resolved by their per-field test id
(form-field-<key>), with the schema's UI label as a fallback, since the config
is keyed by the operator's JSON property name while the panel renders a
human-readable title (code shows as "Python script").
The field types it handles:
- Text and number inputs: Direct fill.
- Dropdowns: Click to open, wait for the option list to render, then select
by text. Attribute dropdowns are populated from the upstream schema, so the
options can arrive late and the selection has to be retried rather than assumed.
- Toggles and checkboxes: Set to a target state rather than blindly clicked,
so a value that already matches is left alone.
- Repeated rows (array fields): A row must be added before its sub-fields
exist, and each row's sub-fields are then filled within that row's scope, so
values do not leak into a neighbouring row.
- Code editors: Operators whose value is a script (Python, R, Java UDF)
never expose an input in the panel at all: it shows only an "Edit code content"
button that opens a separate Monaco overlay. The controller opens the overlay
and inserts the code as a paste rather than typing it, because Monaco's
auto-indent stacks on top of the code's own leading whitespace and turns valid
Python into IndentationError. It then holds briefly on the filled editor so the
code is readable in the recording.
Frontend hooks. Adds the data-testid attributes this controller relies on: a
per-field id on each operator property field (form-field-<key>), plus the
property panel and its title; extends the guard test.
### Affected Area
_No response_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]