Adding Robot Form UI Field Components
Add new robot-form controls as explicit robot_payload_ui(...) item kinds so plugin authors can opt in without Studio-specific React code in plugins.
Read these first:
application/docs/robot-plugins.md
application/docs/explanation/robot-plugin-architecture.md
application/plugin/src/physicalai_studio_plugin/ui_schema.py
application/ui/src/features/robots/robot-form/robot-schema/schema-form.tsx
Workflow
Define the UX contract and ownership model.
- Pick an explicit
kind name (for example calibration) and required item shape (name, optional label, optional description, etc.).
- Keep ownership semantics aligned with existing controls: item-owned fields must not also be rendered as
field or owned by another item.
- Prefer explicit opt-in (
kind) over heuristic detection in the UI.
- Done when: you can describe exactly which payload field(s) the item owns and how plugins enable it.
Add SDK typing + validation for the new item kind.
- Edit
application/plugin/src/physicalai_studio_plugin/ui_schema.py:
- add a new
TypedDict for the item kind,
- include it in
RobotUiItem union,
- validate required fields and field type constraints,
- enforce ownership conflict checks.
- Keep validation errors precise and actionable for plugin authors.
- Done when: invalid metadata fails
validate_robot_payload_ui(...) with a clear error and valid metadata passes.
Render the field in SchemaForm using kind-based dispatch.
- Add a component under
application/ui/src/features/robots/robot-form/robot-schema/components/.
- Integrate it in
application/ui/src/features/robots/robot-form/robot-schema/schema-form.tsx in SchemaFormItem next to existing connection / ip_address handling.
- Reuse shared visibility rules; do not create ad-hoc visibility behavior for a single kind.
- Honor
robot_field_ui({"advanced_configuration": True}) and required/optional behavior consistently.
- Done when: rendering is triggered only by explicit
kind items and matches default form behavior for advanced/required fields.
Implement robust field UX and payload updates.
- Parse and validate user input in the component before mutating payload.
- Show clear inline errors for invalid input.
- Keep labels/descriptions visually consistent with existing form controls.
- For structured payloads (like calibration maps), include a compact preview so users can verify imported values.
- Done when: happy path updates payload correctly, invalid path is recoverable, and the control is readable in dense forms.
Adopt the new kind in built-in catalog payloads.
- Update backend payload UI metadata in the relevant catalog file(s), e.g.
application/backend/src/robots/catalog/so101.py.
- Replace generic
field usage with the new item kind where appropriate.
- Keep business semantics in field descriptions (for example: when a provided calibration bypasses guided calibration).
- Done when:
/api/robots/catalog/{type}/schema emits the expected x-physicalai-ui item and Studio renders the new control.
Add tests at all affected layers.
- UI component tests (new file):
application/ui/src/features/robots/robot-form/robot-schema/components/<new-field>.test.tsx
- cover parse success, parse failure, required/optional markers, preview/sorting, and clear/reset behavior.
- Schema form integration tests:
application/ui/src/features/robots/robot-form/robot-schema/schema-form.test.tsx
- assert kind-driven rendering, advanced visibility, and payload wiring.
- Feature-level tests where used (example bimanual forms):
application/ui/src/features/robots/robot-form/catalog/*.test.tsx
- Plugin SDK contract tests:
application/plugin/tests/test_contracts.py
- cover valid item metadata, type errors, missing fields, and ownership conflicts.
- Done when: all changed test suites pass locally.
Update docs and communicate to plugin authors.
- Update public docs:
application/docs/robot-plugins.md (supported item kinds + usage snippet)
application/docs/explanation/robot-plugin-architecture.md (architecture list of supported kinds)
- Add a handoff note for plugin maintainers when behavior changes materially:
application/docs/handoff-<feature>.md (expected JSON format, migration guidance, limitations)
- Include copy-paste plugin snippet showing new
robot_payload_ui usage.
- Call out rollout notes explicitly for affected plugin owners (for example SO101, BimanualSO101, LeKiwi):
- what to change,
- what stays backward compatible,
- what validation/runtime behavior changes.
- Done when: plugin authors can adopt the feature without reading UI source code.
Verify
From application/ui/:
npm run type-check
npm run test:unit -- src/features/robots/robot-form/robot-schema/components/<new-field>.test.tsx
npm run test:unit -- src/features/robots/robot-form/robot-schema/schema-form.test.tsx
From repo root (or environment where plugin tests run):
uv run python -m pytest application/plugin/tests/test_contracts.py
When skill files changed:
python3 .github/scripts/skills/agent_skills.py sync
python3 .github/scripts/skills/agent_skills.py validate
References
application/ui/src/features/robots/robot-form/robot-schema/schema-form.tsx
application/ui/src/features/robots/robot-form/robot-schema/components/connection-field.tsx
application/ui/src/features/robots/robot-form/robot-schema/components/ip-address-field.tsx
application/ui/src/features/robots/robot-form/robot-schema/components/calibration-field.tsx
application/plugin/src/physicalai_studio_plugin/ui_schema.py
application/plugin/tests/test_contracts.py
1---2name: studio-adding-robot-form-ui-fields3description: Adds a new interactive robot form UI field for plugin payload schemas. Use when introducing a new `robot_payload_ui` item kind, wiring renderer support under application/ui/src/features/robots/robot-form/robot-schema/components, updating plugin SDK UI-schema validation, and documenting how plugin authors adopt the field.4license: Apache-2.05---67# Adding Robot Form UI Field Components89Add new robot-form controls as explicit `robot_payload_ui(...)` item kinds so plugin authors can opt in without Studio-specific React code in plugins.1011Read these first:1213- `application/docs/robot-plugins.md`14- `application/docs/explanation/robot-plugin-architecture.md`15- `application/plugin/src/physicalai_studio_plugin/ui_schema.py`16- `application/ui/src/features/robots/robot-form/robot-schema/schema-form.tsx`1718## Workflow19201. **Define the UX contract and ownership model.**2122 - Pick an explicit `kind` name (for example `calibration`) and required item shape (`name`, optional `label`, optional `description`, etc.).23 - Keep ownership semantics aligned with existing controls: item-owned fields must not also be rendered as `field` or owned by another item.24 - Prefer explicit opt-in (`kind`) over heuristic detection in the UI.25 - Done when: you can describe exactly which payload field(s) the item owns and how plugins enable it.26272. **Add SDK typing + validation for the new item kind.**2829 - Edit `application/plugin/src/physicalai_studio_plugin/ui_schema.py`:30 - add a new `TypedDict` for the item kind,31 - include it in `RobotUiItem` union,32 - validate required fields and field type constraints,33 - enforce ownership conflict checks.34 - Keep validation errors precise and actionable for plugin authors.35 - Done when: invalid metadata fails `validate_robot_payload_ui(...)` with a clear error and valid metadata passes.36373. **Render the field in SchemaForm using kind-based dispatch.**3839 - Add a component under `application/ui/src/features/robots/robot-form/robot-schema/components/`.40 - Integrate it in `application/ui/src/features/robots/robot-form/robot-schema/schema-form.tsx` in `SchemaFormItem` next to existing `connection` / `ip_address` handling.41 - Reuse shared visibility rules; do not create ad-hoc visibility behavior for a single kind.42 - Honor `robot_field_ui({"advanced_configuration": True})` and required/optional behavior consistently.43 - Done when: rendering is triggered only by explicit `kind` items and matches default form behavior for advanced/required fields.44454. **Implement robust field UX and payload updates.**4647 - Parse and validate user input in the component before mutating payload.48 - Show clear inline errors for invalid input.49 - Keep labels/descriptions visually consistent with existing form controls.50 - For structured payloads (like calibration maps), include a compact preview so users can verify imported values.51 - Done when: happy path updates payload correctly, invalid path is recoverable, and the control is readable in dense forms.52535. **Adopt the new kind in built-in catalog payloads.**5455 - Update backend payload UI metadata in the relevant catalog file(s), e.g. `application/backend/src/robots/catalog/so101.py`.56 - Replace generic `field` usage with the new item kind where appropriate.57 - Keep business semantics in field descriptions (for example: when a provided calibration bypasses guided calibration).58 - Done when: `/api/robots/catalog/{type}/schema` emits the expected `x-physicalai-ui` item and Studio renders the new control.59606. **Add tests at all affected layers.**6162 - UI component tests (new file):63 - `application/ui/src/features/robots/robot-form/robot-schema/components/<new-field>.test.tsx`64 - cover parse success, parse failure, required/optional markers, preview/sorting, and clear/reset behavior.65 - Schema form integration tests:66 - `application/ui/src/features/robots/robot-form/robot-schema/schema-form.test.tsx`67 - assert kind-driven rendering, advanced visibility, and payload wiring.68 - Feature-level tests where used (example bimanual forms):69 - `application/ui/src/features/robots/robot-form/catalog/*.test.tsx`70 - Plugin SDK contract tests:71 - `application/plugin/tests/test_contracts.py`72 - cover valid item metadata, type errors, missing fields, and ownership conflicts.73 - Done when: all changed test suites pass locally.74757. **Update docs and communicate to plugin authors.**7677 - Update public docs:78 - `application/docs/robot-plugins.md` (supported item kinds + usage snippet)79 - `application/docs/explanation/robot-plugin-architecture.md` (architecture list of supported kinds)80 - Add a handoff note for plugin maintainers when behavior changes materially:81 - `application/docs/handoff-<feature>.md` (expected JSON format, migration guidance, limitations)82 - Include copy-paste plugin snippet showing new `robot_payload_ui` usage.83 - Call out rollout notes explicitly for affected plugin owners (for example SO101, BimanualSO101, LeKiwi):84 - what to change,85 - what stays backward compatible,86 - what validation/runtime behavior changes.87 - Done when: plugin authors can adopt the feature without reading UI source code.8889## Verify9091From `application/ui/`:9293```bash94npm run type-check95npm run test:unit -- src/features/robots/robot-form/robot-schema/components/<new-field>.test.tsx96npm run test:unit -- src/features/robots/robot-form/robot-schema/schema-form.test.tsx97```9899From repo root (or environment where plugin tests run):100101```bash102uv run python -m pytest application/plugin/tests/test_contracts.py103```104105When skill files changed:106107```bash108python3 .github/scripts/skills/agent_skills.py sync109python3 .github/scripts/skills/agent_skills.py validate110```111112## References113114- `application/ui/src/features/robots/robot-form/robot-schema/schema-form.tsx`115- `application/ui/src/features/robots/robot-form/robot-schema/components/connection-field.tsx`116- `application/ui/src/features/robots/robot-form/robot-schema/components/ip-address-field.tsx`117- `application/ui/src/features/robots/robot-form/robot-schema/components/calibration-field.tsx`118- `application/plugin/src/physicalai_studio_plugin/ui_schema.py`119- `application/plugin/tests/test_contracts.py`